riku
2025-10-27 0f58aa8ea118c3bd0b28396febc58fdbd94eef75
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
package cn.flightfeather.thirdappmodule.repository
 
import cn.flightfeather.thirdappmodule.bean.entity.Subtask
import cn.flightfeather.thirdappmodule.common.net.ResponseBodyCallBack
import cn.flightfeather.thirdappmodule.common.net.ResultCallBack
import cn.flightfeather.thirdappmodule.common.net.RetrofitFactory
import cn.flightfeather.thirdappmodule.httpservice.SubTaskService
import okhttp3.ResponseBody
 
/**
 * @author riku
 * Date: 2020/4/3
 * 子任务相关数据处理
 */
class SubTaskRepository {
    private val retrofit = RetrofitFactory.instance.retrofit
 
    fun deleteSubTask(subTaskId: String, resultCallBack: ResultCallBack<ResponseBody>) {
        retrofit.create(SubTaskService::class.java).deleteSubTask(subTaskId)
                .enqueue(ResponseBodyCallBack(resultCallBack))
    }
 
    fun getSubTaskByDate(dateStr: String, userId: String, resultCallBack: ResultCallBack<List<Subtask>>) {
        retrofit.create(SubTaskService::class.java).findByDate(dateStr, userId)
            .enqueue(ResponseBodyCallBack(resultCallBack))
    }
 
    fun getByTopTaskAndDate(topTaskId: String, startTime: String, endTime: String, resultCallBack: ResultCallBack<List<Subtask>>) {
        retrofit.create(SubTaskService::class.java).getByTopTaskAndDate(topTaskId, startTime, endTime)
            .enqueue(ResponseBodyCallBack(resultCallBack))
    }
}