1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package cn.flightfeather.thirdappmodule.httpservice;
 
import java.util.ArrayList;
 
import cn.flightfeather.thirdappmodule.bean.entity.Scense;
import cn.flightfeather.thirdappmodule.bean.entity.Task;
import cn.flightfeather.thirdappmodule.bean.vo.BaseSubScene;
import cn.flightfeather.thirdappmodule.bean.vo.SceneDetailStrVo;
import cn.flightfeather.thirdappmodule.bean.vo.SceneDetailVo;
import cn.flightfeather.thirdappmodule.model.bean.BaseResponse;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Query;
 
/**
 * Created by 林力 on 2018/2/5.
 * 场景相关的service
 */
 
public interface ScenseService {
    @GET("scense/")
    Call<ArrayList<Scense>> getAllScenses();
 
    @PUT("scense/")
    Call<ResponseBody> putScense(@Body Scense scense);
 
    @POST("scense/")
    Call<ResponseBody> updateScense(@Body Scense scense);
 
    @POST("scense/update/list")
    Call<ResponseBody> updateSceneList(@Body ArrayList<Scense> sceneList);
 
    /**
     *
     * @param task 总任务
     * @param mode 0:只会获取总任务对应的监管版本中存在的场景;1:除了监管版本中存在的场景,还会获取剩余的可用场景
     * @return 场景列表
     */
    @POST("scense/getByTask")
    Observable<Response<ArrayList<Scense>>> getByTaskId(@Body Task task, @Query("mode") int mode);
 
    @GET("scense/detail")
    <T extends BaseSubScene> Observable<Response<BaseResponse<SceneDetailVo<T>>>> getSceneDetail(@Query("sceneId") String sceneId);
 
    @POST("scense/detail/update")
    Observable<Response<BaseResponse<String>>> updateSceneDetail(@Query("sceneTypeId") int typeId, @Body SceneDetailStrVo vo);
 
}