牧羊人 4 lat temu
rodzic
commit
68fd6da2a4
2 zmienionych plików z 25 dodań i 1 usunięć
  1. +8
    -1
      src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java
  2. +17
    -0
      src/main/java/com/taauav/front/vo/usernotice/UserNoticeListVo.java

+ 8
- 1
src/main/java/com/taauav/front/service/impl/UserNoticeServiceImpl.java Wyświetl plik

@@ -87,6 +87,14 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
UserNoticeListVo userNoticeListVo = new UserNoticeListVo();
// 拷贝属性
BeanUtils.copyProperties(item, userNoticeListVo);
// 发布人名称
UserAdmin userAdmin = userAdminMapper.selectById(item.getCreateUser());
if (userAdmin != null) {
userNoticeListVo.setPublishUser(item.getCreateUser());
userNoticeListVo.setPublishUserName(userAdmin.getRealname());
}
// 发布时间
userNoticeListVo.setPublishTime(item.getCreateTime());
// 通知类型
userNoticeListVo.setTypeName(UserNoticeConstant.USER_NOTICE_TYPE_LIST.get(item.getType()));
userNoticeListVoList.add(userNoticeListVo);
@@ -156,7 +164,6 @@ public class UserNoticeServiceImpl extends BaseServiceImpl<UserNoticeMapper, Use
// 拷贝属性
UserNoticeInfoVo userNoticeInfoVo = new UserNoticeInfoVo();
if (info != null) {
// 拷贝属性
BeanUtils.copyProperties(info, userNoticeInfoVo);
}
return response.success(userNoticeInfoVo);

+ 17
- 0
src/main/java/com/taauav/front/vo/usernotice/UserNoticeListVo.java Wyświetl plik

@@ -44,4 +44,21 @@ public class UserNoticeListVo {
*/
private Integer viewNum;

/**
* 发布人
*/
private Integer publishUser;

/**
* 发布人名称
*/
private String publishUserName;

/**
* 发布时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date publishTime;

}

Ładowanie…
Anuluj
Zapisz