package com.sckw.mine.controller;

import com.sckw.core.web.response.HttpResult;
import com.sckw.mine.entity.req.CompleteTaskParam;
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 HttpResult.ok(taskCardService.taskCardPageList(param));
    }

    /**
    * @Description: 任务状态操作
    * @Author: Lt
    * @Date: 2024/5/29 0029 15:39
    */
    @PostMapping("/action")
    public HttpResult taskAction(@RequestBody @Valid CompleteTaskParam completeTaskParam)
    {
        return HttpResult.ok(taskCardService.taskAction(completeTaskParam));
    }


}
