refactor: TransportTaskApiImpl 改为 Feign 模式,新增 TransportTaskApi 接口和 RpcConfiguration
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* Task 服务 RPC API 接口
|
||||
* <p>
|
||||
* LMS/WMS 等调用方通过 Feign 客户端注入此接口,调用 Task 服务
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 搬运任务")
|
||||
public interface TransportTaskApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/transport";
|
||||
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "创建搬运任务(LMS/WMS 调用)")
|
||||
CommonResult<Long> createTransportTask(@Valid @RequestBody TransportTaskCreateReqDTO reqDTO);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
*
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/14 18:57
|
||||
*/package cn.code.nl.module.task.api;
|
||||
@@ -1,39 +0,0 @@
|
||||
package cn.code.nl.module.task.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 任务事件 MQ 消息体
|
||||
*/
|
||||
@Data
|
||||
public class TaskEventMessage {
|
||||
|
||||
/** 事件ID */
|
||||
private String eventId;
|
||||
|
||||
/** 事件类型:TASK_FINISHED / TASK_CANCELLED */
|
||||
private String eventType;
|
||||
|
||||
/** 任务ID */
|
||||
private Long taskId;
|
||||
|
||||
/** 任务编码 */
|
||||
private String taskCode;
|
||||
|
||||
/** 业务归属服务:LMS / WMS */
|
||||
private String ownerService;
|
||||
|
||||
/** 业务类型 */
|
||||
private String bizType;
|
||||
|
||||
/** 业务侧标识 */
|
||||
private String bizId;
|
||||
|
||||
/** 业务回调处理器编码 */
|
||||
private String handleCode;
|
||||
|
||||
/** 扩展数据 */
|
||||
private Map<String, Object> payload;
|
||||
}
|
||||
Reference in New Issue
Block a user