From c253f1363eee57ef311052b993a7f57b795ad54a Mon Sep 17 00:00:00 2001 From: nixj Date: Wed, 29 May 2024 14:16:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=E3=80=91=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E9=83=A8=E5=88=86bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/application/dtos/system/SystemAnnouncementVO.java | 3 +++ .../chint/domain/aggregates/system/SystemAnnouncement.java | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chint/application/dtos/system/SystemAnnouncementVO.java b/src/main/java/com/chint/application/dtos/system/SystemAnnouncementVO.java index 48f0308a..cf4d5538 100644 --- a/src/main/java/com/chint/application/dtos/system/SystemAnnouncementVO.java +++ b/src/main/java/com/chint/application/dtos/system/SystemAnnouncementVO.java @@ -1,5 +1,6 @@ package com.chint.application.dtos.system; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.time.LocalDateTime; @@ -10,7 +11,9 @@ public class SystemAnnouncementVO { private String title; // 公告的标题 private String content; // 公告的详细内容 private String postedBy; // 发布公告的用户或管理员的用户名 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime postDate; // 公告发布的日期和时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime expiryDate; // 公告的过期日期 private String status; // 公告的状态 private Integer priority; // 公告的优先级,用于排序 diff --git a/src/main/java/com/chint/domain/aggregates/system/SystemAnnouncement.java b/src/main/java/com/chint/domain/aggregates/system/SystemAnnouncement.java index 22c2b54f..4dd750ad 100644 --- a/src/main/java/com/chint/domain/aggregates/system/SystemAnnouncement.java +++ b/src/main/java/com/chint/domain/aggregates/system/SystemAnnouncement.java @@ -6,6 +6,7 @@ import com.chint.application.dtos.system.SystemAnnouncementVO; import com.chint.domain.aggregates.user.User; import com.chint.infrastructure.util.BaseContext; import com.chint.infrastructure.util.DateTimeUtil; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springframework.data.annotation.Id; import org.springframework.data.relational.core.mapping.MappedCollection; @@ -29,7 +30,9 @@ public class SystemAnnouncement implements Serializable { private String title; // 公告的标题 private String content; // 公告的详细内容 private String postedBy; // 发布公告的用户或管理员的用户名 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime postDate; // 公告发布的日期和时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime expiryDate; // 公告的过期日期 private String status; // 公告的状态 private Integer priority; // 公告的优先级,用于排序 @@ -80,7 +83,7 @@ public class SystemAnnouncement implements Serializable { systemAnnouncement.setExpiryDate(expiryTime); } systemAnnouncement.setStatus("1"); - systemAnnouncement.setPriority(0); + systemAnnouncement.setPriority(dto.getPriority()); User currentUser = BaseContext.getCurrentUser(); if (currentUser != null) {