package com.yidian.shenghuoquan.bgoods.http

import com.yidian.bcommon.http.HttpResult
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.QueryMap

interface CouponService {

  private companion object {
    const val categoryList = "/goods/customer/get_goods_category_list"
    const val searchCategoryList = "/merchant/enterprise/get_account_role_list"
    const val getCommodityManagementList = "/goods/customer/my_goods"
    const val getCommodityStatusList = "/goods/business/my_goods_status_list"
    const val commodityOnline = "/goods/customer/online"
    const val commodityOffline = "/goods/customer/offline"
  }

  /**
   * 获取类目列表
   */
  @GET(categoryList)
  fun getCategoryList(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 搜索类目列表(可能会共用上面的接口)
   */
  @GET(searchCategoryList)
  fun searchCategoryList(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>

  /**
   * 1016 获取商品列表
   */
  @GET(getCommodityManagementList)
  fun getCommodityManagementList(
    @QueryMap commonParams: Map<String, String>,
    @QueryMap requestParams: Map<String, String?>
  ): Observable<HttpResult<Any?>>

  /**
   * 1025 获取商品状态列表
   * e.g. 上架中，审核中，被驳回，已下架
   */
  @GET(getCommodityStatusList)
  fun getCommodityStatusList(
    @QueryMap commonParams: Map<String, String>,
    @QueryMap requestParams: Map<String, String?>
  ): Observable<HttpResult<Any?>>

  /**
   * 1012 商品上架
   */
  @POST(commodityOnline)
  @Headers("Content-Type: application/json")
  fun commodityOnline(
    @QueryMap commonParams: Map<String, String>,
    @QueryMap requestParams: Map<String, String?>
  ): Observable<HttpResult<Any?>>

  /**
   * 1013 商品下架
   */
  @POST(commodityOffline)
  @Headers("Content-Type: application/json")
  fun commodityOffline(
    @QueryMap commonParams: Map<String, String>,
    @QueryMap requestParams: Map<String, String?>
  ): Observable<HttpResult<Any?>>
}
