package com.yidian.shenghuoquan.newscontent.personnel.http

import com.yidian.bcommon.http.HttpResult
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.*

/**
 * 人员管理相关的请求
 */
interface PersonalService {

  private companion object {
    const val accountList = "/merchant/enterprise/get_account_role_list"
    const val changeRole = "/merchant/enterprise/change_role"
    const val sendMobileCode = "/sms/sms/send_code"
    const val checkMobileCode = "/merchant/enterprise/check_mobile_code"
    const val addUser = "/merchant/enterprise/add_user"
    const val disassociate = "/merchant/enterprise/delete_life_user"
  }

  /**
   * 获取账号列表
   */
  @GET(accountList)
  fun getAccountList(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 更换生活号管理员
   */
  @GET(changeRole)
  fun getChangeManager(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 变更管理员 发送短信，老管理员/新管理员
   */
  @GET(sendMobileCode)
  fun getSmsCode(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 变更管理员 验证短信，老管理员/新管理员
   */
  @GET(checkMobileCode)
  fun getCheckSmsCode(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 添加非管理员
   */
  @Headers("Content-Type: application/json")
  @POST(addUser)
  fun postAddUser(@QueryMap commonParams: Map<String, String>, @Body requestParams: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 解除关系
   */
  @GET(disassociate)
  fun getDissolveRelationship(
    @QueryMap commonParams: Map<String, String>,
    @QueryMap params: Map<String, String?>
  ): Observable<HttpResult<Any?>>
}
