From 708f473140d0b293622b75944a2c8b1493916b06 Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Wed, 14 Jan 2026 16:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EisPublic=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../other/app/command/user/SendLoveLetterCmdExe.java | 1 + .../user/relation/cp/loveletter/SendLoveLetterCmd.java | 2 ++ .../circle/other/domain/model/cp/CpLoveLetterDomain.java | 9 +++++++++ .../database/rds/entity/user/user/CpLoveLetter.java | 2 ++ .../infra/gateway/user/CpLoveLetterGatewayImpl.java | 2 ++ .../src/main/resources/dao/user/user/CpLoveLetterDAO.xml | 1 + 6 files changed, 17 insertions(+) diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/SendLoveLetterCmdExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/SendLoveLetterCmdExe.java index 19167dd7..8f2fb40d 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/SendLoveLetterCmdExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/user/SendLoveLetterCmdExe.java @@ -63,6 +63,7 @@ public class SendLoveLetterCmdExe { letter.setReceiverId(receiverId); letter.setContent(cmd.getContent()); letter.setStatus(0); + letter.setIsPublic(cmd.getIsPublic() != null ? cmd.getIsPublic() : 1); letter.setCostGold(LOVE_LETTER_COST); letter.setCreateTime(TimestampUtils.now()); letter.setUpdateTime(TimestampUtils.now()); diff --git a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/user/relation/cp/loveletter/SendLoveLetterCmd.java b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/user/relation/cp/loveletter/SendLoveLetterCmd.java index f441e16f..283f899c 100644 --- a/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/user/relation/cp/loveletter/SendLoveLetterCmd.java +++ b/rc-service/rc-service-other/other-client/src/main/java/com/red/circle/other/app/dto/cmd/user/relation/cp/loveletter/SendLoveLetterCmd.java @@ -23,4 +23,6 @@ public class SendLoveLetterCmd extends AppExtCommand { @NotBlank(message = "告白内容不能为空") @Size(max = 80, message = "告白内容不能超过80字符") private String content; + + private Integer isPublic; } diff --git a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/cp/CpLoveLetterDomain.java b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/cp/CpLoveLetterDomain.java index 50098c5f..fe11b676 100644 --- a/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/cp/CpLoveLetterDomain.java +++ b/rc-service/rc-service-other/other-domain/src/main/java/com/red/circle/other/domain/model/cp/CpLoveLetterDomain.java @@ -21,6 +21,8 @@ public class CpLoveLetterDomain { private Integer status; + private Integer isPublic; + private Long costGold; private Timestamp createTime; @@ -40,4 +42,11 @@ public class CpLoveLetterDomain { public void markAsRead() { this.status = 1; } + + /** + * 是否公开 + */ + public boolean isPublic() { + return isPublic != null && isPublic == 1; + } } diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/user/user/CpLoveLetter.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/user/user/CpLoveLetter.java index d747c7d5..9ce4dfa2 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/user/user/CpLoveLetter.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/database/rds/entity/user/user/CpLoveLetter.java @@ -26,6 +26,8 @@ public class CpLoveLetter { private Integer status; + private Integer isPublic; + private Long costGold; @TableLogic diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/CpLoveLetterGatewayImpl.java b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/CpLoveLetterGatewayImpl.java index 3bec7a3e..eefd1e07 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/CpLoveLetterGatewayImpl.java +++ b/rc-service/rc-service-other/other-infrastructure/src/main/java/com/red/circle/other/infra/gateway/user/CpLoveLetterGatewayImpl.java @@ -60,6 +60,7 @@ public class CpLoveLetterGatewayImpl implements CpLoveLetterGateway { entity.setReceiverId(domain.getReceiverId()); entity.setContent(domain.getContent()); entity.setStatus(domain.getStatus()); + entity.setIsPublic(domain.getIsPublic()); entity.setCostGold(domain.getCostGold()); entity.setCreateTime(domain.getCreateTime().toLocalDateTime()); entity.setUpdateTime(domain.getUpdateTime().toLocalDateTime()); @@ -76,6 +77,7 @@ public class CpLoveLetterGatewayImpl implements CpLoveLetterGateway { domain.setReceiverId(entity.getReceiverId()); domain.setContent(entity.getContent()); domain.setStatus(entity.getStatus()); + domain.setIsPublic(entity.getIsPublic()); domain.setCostGold(entity.getCostGold()); domain.setCreateTime(Timestamp.valueOf(entity.getCreateTime())); domain.setUpdateTime(Timestamp.valueOf(entity.getUpdateTime())); diff --git a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/user/user/CpLoveLetterDAO.xml b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/user/user/CpLoveLetterDAO.xml index 58383cef..012810d1 100644 --- a/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/user/user/CpLoveLetterDAO.xml +++ b/rc-service/rc-service-other/other-infrastructure/src/main/resources/dao/user/user/CpLoveLetterDAO.xml @@ -6,6 +6,7 @@