fix: queryTaskIds 和 lookTaskDetail 改为 POST
服务端所有任务接口都要求 POST,GET 返回 405 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -23,13 +23,13 @@ interface TaskApi {
|
||||
@GET("watchTask/myCurrentAttendance")
|
||||
suspend fun getAttendance(): ApiResponse<AttendanceInfo>
|
||||
|
||||
/** 获取任务ID列表(按状态筛选,旧版 queryTaskIds) */
|
||||
@GET("watchTask/queryTaskIds")
|
||||
suspend fun getTaskIds(@Query("status") status: Int): ApiResponse<List<TaskItem>>
|
||||
/** 获取任务列表(按状态筛选) */
|
||||
@POST("watchTask/queryTaskIds")
|
||||
suspend fun getTaskIds(@Body params: HashMap<String, Any>): ApiResponse<List<TaskItem>>
|
||||
|
||||
/** 任务详情 */
|
||||
@GET("watchTask/lookTaskDetail")
|
||||
suspend fun getTaskDetail(@Query("id") taskId: Long): ApiResponse<TaskDetail>
|
||||
@POST("watchTask/lookTaskDetail")
|
||||
suspend fun getTaskDetail(@Body params: HashMap<String, Any>): ApiResponse<TaskDetail>
|
||||
|
||||
/** 抢单 */
|
||||
@POST("task/grabTask")
|
||||
|
||||
@@ -61,7 +61,8 @@ class TaskDetailFragment : BaseFragment<FragmentTaskDetailBinding>() {
|
||||
/** 获取任务详情 */
|
||||
private fun fetchDetail(taskId: Long) {
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
val result = safeApiCall { taskApi.getTaskDetail(taskId) }
|
||||
val params = hashMapOf<String, Any>("id" to taskId)
|
||||
val result = safeApiCall { taskApi.getTaskDetail(params) }
|
||||
when (result) {
|
||||
is ApiResult.Success -> {
|
||||
result.data?.let { detail ->
|
||||
|
||||
@@ -118,7 +118,8 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
|
||||
private fun fetchTasks() {
|
||||
viewLifecycleOwner.lifecycleScope.launch {
|
||||
binding.swipeRefresh.isRefreshing = true
|
||||
val result = safeApiCall { taskApi.getTaskIds(currentStatus) }
|
||||
val params = hashMapOf<String, Any>("status" to currentStatus)
|
||||
val result = safeApiCall { taskApi.getTaskIds(params) }
|
||||
binding.swipeRefresh.isRefreshing = false
|
||||
|
||||
when (result) {
|
||||
|
||||
Reference in New Issue
Block a user