package com.phlx.anchorcollect_p.data.http;



import com.phlx.anchorcollect_p.entity.BreedingRecordDetailEntity;
import com.phlx.anchorcollect_p.entity.BreedingRecordEntity;
import com.phlx.anchorcollect_p.entity.CattleResumeEntity;
import com.phlx.anchorcollect_p.entity.DictEntity;
import com.phlx.anchorcollect_p.entity.GenData;
import com.phlx.anchorcollect_p.entity.ImmuneBatchDetailEntity;
import com.phlx.anchorcollect_p.entity.ImmuneBatchEntity;
import com.phlx.anchorcollect_p.entity.LoginData;
import com.phlx.anchorcollect_p.entity.MedicalRecordEntity;
import com.phlx.anchorcollect_p.entity.PerformanceEntity;
import com.phlx.anchorcollect_p.entity.WeightManEntity;
import com.phlx.anchorcollect_p.params.BaseResponse;
import com.phlx.anchorcollect_p.params.CollectResponse;
import com.phlx.anchorcollect_p.params.ListResponse;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * Created by goldze on 2019/3/26.
 */
public interface HttpDataSource {



    /**
     * 获取版本号
     */
    Observable<BaseResponse<Double>> versionGet();

    /**
     * 下载新版本
     */
    Observable<BaseResponse> DownloadApp();

    /**
     * 登录
     */
    Observable<CollectResponse<LoginData>> loginPost(@FieldMap Map<String, String> map);

    /**
     * 获取页面配置
     */
    Observable<CollectResponse<GenData>> genGet();

    /**
     * 获取基础信息列表
     */
    Observable<ListResponse<CattleResumeEntity>> downloadCattleList(@FieldMap Map<String, String> map);

    /**
     * 获取基础信息列表-返回
     */
    Observable<CollectResponse> downloadCattleListSync(@Body RequestBody body);

    /**
     * 上传基础信息列表
     */
    Observable<ListResponse<Long>> uploadCattleList(@Body RequestBody body);

    /**
     * 获取字典项列表
     */
    Observable<ListResponse<DictEntity>> downloadDict();

    /**
     * 获取性能测定列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<PerformanceEntity>> downloadPerformanceList(@FieldMap Map<String, String> map);

    /**
     * 获取性能测定列表-返回
     */
    Observable<CollectResponse> downloadPerformanceListSync(@Body RequestBody body);

    /**
     * 上传性能测定列表
     */
    Observable<ListResponse<Long>> uploadPerformanceList(@Body RequestBody body);

    /**
     * 获取-配种记录主表-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<BreedingRecordEntity>> downloadBreedingRecordList(@FieldMap Map<String, String> map);

    /**
     * 获取-配种记录主表-列表-返回
     */
    Observable<CollectResponse> downloadBreedingRecordListSync(@Body RequestBody body);

    /**
     * 上传-配种记录主表-列表
     */
    Observable<ListResponse<Long>> uploadBreedingRecordList(@Body RequestBody body);

    /**
     * 获取-配种记录子表-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<BreedingRecordDetailEntity>> downloadBreedingRecordDetailList(@FieldMap Map<String, String> map);

    /**
     * 获取-配种记录子表-列表-返回
     */
    Observable<CollectResponse> downloadBreedingRecordDetailListSync(@Body RequestBody body);

    /**
     * 上传-配种记录子表-列表
     */
    Observable<ListResponse<Long>> uploadBreedingRecordDetailList(@Body RequestBody body);

    /**
     * 获取-称重管理-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<WeightManEntity>> downloadWeightManList(@FieldMap Map<String, String> map);

    /**
     * 获取-称重管理-列表-返回
     */
    Observable<CollectResponse> downloadWeightManListSync(@Body RequestBody body);

    /**
     * 上传-称重管理-列表
     */
    Observable<ListResponse<Long>> uploadWeightManList(@Body RequestBody body);

    /**
     * 获取-诊疗记录-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<MedicalRecordEntity>> downloadMedicalRecordList(@FieldMap Map<String, String> map);

    /**
     * 获取-诊疗记录-列表-返回
     */
    Observable<CollectResponse> downloadMedicalRecordListSync(@Body RequestBody body);

    /**
     * 上传-诊疗记录-列表
     */
    Observable<ListResponse<Long>> uploadMedicalRecordList(@Body RequestBody body);

    /**
     * 获取-免疫记录-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<ImmuneBatchEntity>> downloadImmuneBatchList(@FieldMap Map<String, String> map);

    /**
     * 获取-免疫记录-列表-返回
     */
    Observable<CollectResponse> downloadImmuneBatchListSync(@Body RequestBody body);

    /**
     * 上传-免疫记录-列表
     */
    Observable<ListResponse<Long>> uploadImmuneBatchList(@Body RequestBody body);

    /**
     * 获取-免疫记录-子表-列表
     * SyncState 0根据记录更新，1重新更新
     */
    Observable<ListResponse<ImmuneBatchDetailEntity>> downloadImmuneBatchDetailList(@FieldMap Map<String, String> map);

    /**
     * 获取-免疫记录-子表-列表-返回
     */
    Observable<CollectResponse> downloadImmuneBatchDetailListSync(@Body RequestBody body);

    /**
     * 上传-免疫记录-子表-列表
     */
    Observable<ListResponse<Long>> uploadImmuneBatchDetailList(@Body RequestBody body);

    /**
     * 上传-错误记录
     */
    Observable<CollectResponse> uploadErrorData(@Body RequestBody body);
}
