update 优化 规范DTO命名

This commit is contained in:
疯狂的狮子Li
2026-03-13 14:38:42 +08:00
parent 40ea2e55bb
commit 2a4dbdd974
14 changed files with 60 additions and 61 deletions

View File

@@ -1,7 +1,7 @@
package org.dromara.demo.controller;
import org.dromara.common.core.domain.R;
import org.dromara.common.websocket.dto.WebSocketMessageDto;
import org.dromara.common.websocket.dto.WebSocketMessageDTO;
import org.dromara.common.websocket.utils.WebSocketUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -26,7 +26,7 @@ public class WebSocketController {
* @param dto 发送内容
*/
@GetMapping("/send")
public R<Void> send(WebSocketMessageDto dto) throws InterruptedException {
public R<Void> send(WebSocketMessageDTO dto) throws InterruptedException {
WebSocketUtils.publishMessage(dto);
return R.ok("操作成功");
}

View File

@@ -5,7 +5,7 @@ import lombok.Data;
import java.math.BigDecimal;
@Data
public class BillDto {
public class BillDTO {
/**
* 账单ID

View File

@@ -7,7 +7,7 @@ import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.common.log.SnailJobLog;
import com.aizuda.snailjob.model.dto.ExecuteResult;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.job.entity.BillDto;
import org.dromara.job.entity.BillDTO;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@@ -23,20 +23,20 @@ import java.math.BigDecimal;
public class AlipayBillTask {
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
BillDto billDto = new BillDto();
billDto.setBillId(23456789L);
billDto.setBillChannel("alipay");
BillDTO billDTO = new BillDTO();
billDTO.setBillId(23456789L);
billDTO.setBillChannel("alipay");
// 设置清算日期
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
if (StrUtil.equals(settlementDate, "sysdate")) {
settlementDate = DateUtil.today();
}
billDto.setBillDate(settlementDate);
billDto.setBillAmount(new BigDecimal("2345.67"));
// 把billDto对象放入上下文进行传递
jobArgs.appendContext("alipay", JsonUtils.toJsonString(billDto));
billDTO.setBillDate(settlementDate);
billDTO.setBillAmount(new BigDecimal("2345.67"));
// 把billDTO对象放入上下文进行传递
jobArgs.appendContext("alipay", JsonUtils.toJsonString(billDTO));
SnailJobLog.REMOTE.info("上下文: {}", jobArgs.getWfContext());
return ExecuteResult.success(billDto);
return ExecuteResult.success(billDTO);
}
}

View File

@@ -6,7 +6,7 @@ import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.common.log.SnailJobLog;
import com.aizuda.snailjob.model.dto.ExecuteResult;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.job.entity.BillDto;
import org.dromara.job.entity.BillDTO;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@@ -26,15 +26,15 @@ public class SummaryBillTask {
BigDecimal wechatAmount = BigDecimal.valueOf(0);
String wechat = (String) jobArgs.getWfContext("wechat");
if (StrUtil.isNotBlank(wechat)) {
BillDto wechatBillDto = JsonUtils.parseObject(wechat, BillDto.class);
wechatAmount = wechatBillDto.getBillAmount();
BillDTO wechatBillDTO = JsonUtils.parseObject(wechat, BillDTO.class);
wechatAmount = wechatBillDTO.getBillAmount();
}
// 获得支付宝账单
BigDecimal alipayAmount = BigDecimal.valueOf(0);
String alipay = (String) jobArgs.getWfContext("alipay");
if (StrUtil.isNotBlank(alipay)) {
BillDto alipayBillDto = JsonUtils.parseObject(alipay, BillDto.class);
alipayAmount = alipayBillDto.getBillAmount();
BillDTO alipayBillDTO = JsonUtils.parseObject(alipay, BillDTO.class);
alipayAmount = alipayBillDTO.getBillAmount();
}
// 汇总账单
BigDecimal totalAmount = wechatAmount.add(alipayAmount);

View File

@@ -7,7 +7,7 @@ import com.aizuda.snailjob.client.job.core.dto.JobArgs;
import com.aizuda.snailjob.common.log.SnailJobLog;
import com.aizuda.snailjob.model.dto.ExecuteResult;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.job.entity.BillDto;
import org.dromara.job.entity.BillDTO;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
@@ -23,21 +23,21 @@ import java.math.BigDecimal;
public class WechatBillTask {
public ExecuteResult jobExecute(JobArgs jobArgs) throws InterruptedException {
BillDto billDto = new BillDto();
billDto.setBillId(123456789L);
billDto.setBillChannel("wechat");
BillDTO billDTO = new BillDTO();
billDTO.setBillId(123456789L);
billDTO.setBillChannel("wechat");
// 从上下文中获得清算日期并设置,如果上下文中清算日期
// 是sysdate设置为当前日期否则取管理页面设置的值
String settlementDate = (String) jobArgs.getWfContext().get("settlementDate");
if (StrUtil.equals(settlementDate, "sysdate")) {
settlementDate = DateUtil.today();
}
billDto.setBillDate(settlementDate);
billDto.setBillAmount(new BigDecimal("1234.56"));
// 把billDto对象放入上下文进行传递
jobArgs.appendContext("wechat", JsonUtils.toJsonString(billDto));
billDTO.setBillDate(settlementDate);
billDTO.setBillAmount(new BigDecimal("1234.56"));
// 把billDTO对象放入上下文进行传递
jobArgs.appendContext("wechat", JsonUtils.toJsonString(billDTO));
SnailJobLog.REMOTE.info("上下文: {}", jobArgs.getWfContext());
return ExecuteResult.success(billDto);
return ExecuteResult.success(billDTO);
}
}

View File

@@ -10,7 +10,7 @@ import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mail.utils.MailUtils;
import org.dromara.common.sse.dto.SseMessageDto;
import org.dromara.common.sse.dto.SseMessageDTO;
import org.dromara.common.sse.utils.SseMessageUtils;
import org.dromara.warm.flow.core.FlowEngine;
import org.dromara.warm.flow.core.entity.Node;
@@ -92,7 +92,7 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
try {
switch (messageTypeEnum) {
case SYSTEM_MESSAGE -> {
SseMessageDto dto = new SseMessageDto();
SseMessageDTO dto = new SseMessageDTO();
dto.setUserIds(userIds);
dto.setMessage(message);
SseMessageUtils.publishMessage(dto);