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 @@