package com.cooleshow.base.data.api;

import com.cooleshow.base.bean.AddressBean;
import com.cooleshow.base.bean.UploadTokenInfoBean;
import com.cooleshow.base.bean.request.EditAddressEntry;
import com.cooleshow.base.data.net.BaseResponse;

import java.util.List;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

import static com.cooleshow.base.common.BaseConstant.AUTH_GROUP;
import static com.cooleshow.base.common.BaseConstant.MALL_PORTAL_SERVER;
import static com.cooleshow.base.common.BaseConstant.TEACHER_GROUP;
import static com.cooleshow.base.common.BaseConstant.STUDENT_GROUP;

/**
 * Author by pq, Date on 2022/5/11.
 */
public interface UploadApi {
    /**
     * 根据月份获取老师该月有课的日期
     *
     * @param
     * @return
     */
    @POST(TEACHER_GROUP + "getUploadSign")
    Observable<BaseResponse<UploadTokenInfoBean>> getUploadTokenForTeacher(@Body RequestBody body);

    /**
     * 根据月份获取老师该月有课的日期
     *
     * @param
     * @return
     */
    @POST(STUDENT_GROUP + "getUploadSign")
    Observable<BaseResponse<UploadTokenInfoBean>> getUploadTokenForStudent(@Body RequestBody body);

    /**
     * 获取所有收货地址
     *
     * @return
     */
    @GET(MALL_PORTAL_SERVER + "member/address/list")
    Observable<BaseResponse<List<AddressBean>>> companyAddressList();

    /**
     * 添加收货地址
     *
     * @param body
     * @return
     */
    @POST(MALL_PORTAL_SERVER + "member/address/add")
    Observable<BaseResponse<Object>> createNewAddress(@Body EditAddressEntry body);

    /**
     * 修改地址
     *
     * @param id
     * @param body
     * @return
     */
    @POST(MALL_PORTAL_SERVER + "member/address/update/{id}")
    Observable<BaseResponse<Object>> updateAddress(@Path("id") int id, @Body EditAddressEntry body);

    /**
     * 删除地址
     *
     * @param id
     * @return
     */
    @POST(MALL_PORTAL_SERVER + "member/address/delete/{id}")
    Observable<BaseResponse<Object>> delAddress(@Path("id") int id);

    /**
     * 删除地址
     *
     * @param code
     * @return
     */
    @GET(AUTH_GROUP + "/doQrLogin")
    Observable<BaseResponse<Object>> doQrLogin(@Query("code") String code);
}
