package com.wms_main.controller.wms;

import com.wms_main.model.dto.request.wms.WmsTaskRequest;
import com.wms_main.model.dto.response.wms.BaseWmsApiResponse;
import com.wms_main.service.controller.ITaskOperationControllerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 任务操作控制类
 * 包括拣选任务
 */
@RestController
@ResponseBody
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/wms/taskOperation")
public class TaskOperationController {
    private final ITaskOperationControllerService taskOperationControllerService;

    /**
     * 删除任务
     * @param wmsTaskRequest 请求
     * @return 结果
     */
    @PostMapping("/deleteWmsTask")
    public BaseWmsApiResponse deleteWmsTask(@RequestBody WmsTaskRequest wmsTaskRequest) {
        return taskOperationControllerService.deleteWmsTask(wmsTaskRequest);
    }

    /**
     * 更新任务
     * @param wmsTaskRequest 请求
     * @return 结果
     */
    @PostMapping("/updateWmsTask")
    public BaseWmsApiResponse updateWmsTask(@RequestBody WmsTaskRequest wmsTaskRequest) {
        return taskOperationControllerService.updateWmsTask(wmsTaskRequest);
    }
}
