feat: TransportTaskApiImpl RPC创建任务接口实现

This commit is contained in:
2026-07-14 17:39:05 +08:00
parent c6dffbcb61
commit c82f309548

View File

@@ -0,0 +1,33 @@
package cn.code.nl.module.task.api;
import cn.code.nl.framework.common.pojo.CommonResult;
import cn.code.nl.module.task.dto.TransportTaskCreateReqDTO;
import cn.code.nl.module.task.enums.ApiConstants;
import cn.code.nl.module.task.service.transporttask.TransportTaskService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
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;
import jakarta.validation.Valid;
import static cn.code.nl.framework.common.pojo.CommonResult.success;
/**
* Task 服务 RPC 接口实现
*/
@RestController
@RequestMapping(ApiConstants.PREFIX)
@Validated
public class TransportTaskApiImpl {
@Resource
private TransportTaskService transportTaskService;
@PostMapping("/transport/create")
public CommonResult<Long> createTransportTask(@Valid @RequestBody TransportTaskCreateReqDTO reqDTO) {
return success(transportTaskService.createTransportTaskByRpc(reqDTO));
}
}