mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 08:57:14 +08:00
refactor: 优化部分代码
This commit is contained in:
@@ -101,7 +101,6 @@ public class UserInfoVO implements Serializable {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Schema(description = "创建时间", example = "2023-08-08 08:08:08", type = "string")
|
||||
@JsonIgnore
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
@@ -62,22 +62,18 @@ public class AnnouncementVO extends BaseVO {
|
||||
private LocalDateTime terminateTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
* 状态(1:待发布,2:已发布,3:已过期)
|
||||
*
|
||||
* @return 公告状态
|
||||
*/
|
||||
@Schema(description = "状态(1:待发布,2:已发布,3:已过期)", example = "1")
|
||||
public Integer getStatus() {
|
||||
int status = 2;
|
||||
if (null != this.effectiveTime) {
|
||||
if (this.effectiveTime.isAfter(LocalDateTime.now())) {
|
||||
status = 1;
|
||||
}
|
||||
if (null != this.effectiveTime && this.effectiveTime.isAfter(LocalDateTime.now())) {
|
||||
status = 1;
|
||||
}
|
||||
if (null != this.terminateTime) {
|
||||
if (this.terminateTime.isBefore(LocalDateTime.now())) {
|
||||
status = 3;
|
||||
}
|
||||
if (null != this.terminateTime && this.terminateTime.isBefore(LocalDateTime.now())) {
|
||||
status = 3;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
Reference in New Issue
Block a user