package com.malk.zhongche.controller;

import com.malk.server.common.McR;
import com.malk.zhongche.service.ZhongcheService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class ZhongcheController {
    @Autowired
    private ZhongcheService zhongcheService;

    //获取任务信息
    @GetMapping("/getTaskInfo")
    public McR getTaskInfo(String taskId,String projectId){
        return zhongcheService.getTaskInfo(taskId,projectId);
    }

    //获取项目信息
    @GetMapping("/getProjectInfo")
    public McR getProjectInfo(String projectId){
        return zhongcheService.getProjectInfo(projectId);
    }

    //更新任务延期信息
    @PostMapping("/updateTaskDelayInfo")
    public McR updateTaskDelayInfo(@RequestBody Map map){
        return zhongcheService.updateTaskDelayInfo(map);
    }

    //更新父任务任务类型
    @PostMapping("/updateParentTaskType")
    public McR updateParentTaskType(@RequestBody Map map){
        return zhongcheService.updateParentTaskType(map);
    }

    //上传附件完成任务
    @PostMapping("/finishTask")
    public McR finishTask(@RequestBody Map map){
        return zhongcheService.finishTask(map);
    }
}
