package com.sckw.mine.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.mine.entity.req.ReviewOrderParam;
import com.sckw.mine.entity.req.TaskCardPageListParam;
import com.sckw.mine.service.TaskCardService;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc: 任务卡片
 * @author: Lt
 * @date: 2024-05-29
 */
@RestController
@RequestMapping("/mine/taskCard")
public class TaskCardController {

    @Autowired
    TaskCardService taskCardService;

    @PostMapping("/pageList")
    public HttpResult taskCardPageList(@RequestBody TaskCardPageListParam param)
    {
        return taskCardService.taskCardPageList(param);
    }

    /**
    * @Description: 任务状态页面审核订单
    * @Author: Lt
    * @Date: 2024/5/29 15:39
    */
    @PostMapping("/reviewOrder")
    public HttpResult reviewOrder(@RequestBody @Valid ReviewOrderParam reviewOrderParam)
    {
        return taskCardService.reviewOrder(reviewOrderParam);
    }

    /**
     * @Description: 任务状态弹窗操作订单
     * @Author: Lt
     * @Date: 2024/5/29 15:39
     */
    @PostMapping("/popOrder")
    public HttpResult popOrder(@RequestBody @Valid ReviewOrderParam reviewOrderParam)
    {
        return taskCardService.carryTrack(reviewOrderParam);
    }


}
