fix: 修复针对于还未到发布时间的公告状态

This commit is contained in:
Bull-BCLS
2023-09-01 23:08:55 +08:00
parent 8fac2680f9
commit 46cc4c9307
2 changed files with 7 additions and 6 deletions

View File

@@ -66,17 +66,17 @@ public class AnnouncementVO extends BaseVO {
*
* @return 公告状态
*/
@Schema(description = "状态1发布2已过期", example = "1")
@Schema(description = "状态1发布2发布3过期)", example = "1")
public Integer getStatus() {
int status = 1;
int status = 2;
if (null != this.effectiveTime) {
if (this.effectiveTime.isAfter(LocalDateTime.now())) {
status = 2;
status = 1;
}
}
if (null != this.terminateTime) {
if (this.terminateTime.isBefore(LocalDateTime.now())) {
status = 2;
status = 3;
}
}
return status;