package com.sxyz.rfid.presenter.service;

import com.sxyz.rfid.presenter.model.ApkModel;
import com.sxyz.rfid.presenter.model.DictModel;
import com.sxyz.rfid.presenter.model.LoginModel;
import com.sxyz.rfid.presenter.model.OperatorBean;
import com.sxyz.rfid.presenter.model.OutBoundDetailModel;
import com.sxyz.rfid.presenter.model.OutboundFlowingWaterModel;
import com.sxyz.rfid.presenter.model.OutboundModel;
import com.sxyz.rfid.ui.login.bean.UserBean;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface ApiService {

    //版本更新
    @GET("law/version/1")
    Observable<ApkModel> getApk();

    //登录
    @POST("login")
    Observable<LoginModel> getLogin(@Body UserBean userBean);

    //字典列表
    @GET("system/dict/data/list")
    Observable<DictModel> getDict(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("dictType") String dictType);

    //出库列表http://192.168.19.22:8851/dev-api/ware/wmsOutboundOrder/cancelItem/1
    @GET("ware/wmsOutboundOrder/list")
    Observable<OutboundModel> getOutboundList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum);

    //出库单明细
    @GET("ware/wmsOutboundOrderItem/list")
    Observable<OutBoundDetailModel> getOutboundDetailList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("orderId") int orderId);

    //出库流水
    @GET("ware/wmsOutboundItemInventory/list")
    Observable<OutboundFlowingWaterModel> getOutboundFlowList(@Query("pageSize") int pageSize, @Query("pageNum") int pageNum, @Query("itemId") int itemId);

    //出库明细-撤销操作
    @POST("http://192.168.19.22:8851/dev-api/ware/wmsOutboundOrder/cancelItem/{itemId}")
    Observable<Object> getCancelOutboundOrderCancelItem(@Path("itemId") int itemId, @Body OperatorBean operatorId);

    //出库流水-撤销操作
    @POST("ware/wmsOutboundOrder/cancelOutboundRelations/{relationId}")
    Observable<Object> getCancelOutboundRelations(@Path("relationId") int relationId, @Body OperatorBean operatorId);
}
