|
|
@ -18,6 +18,7 @@ |
|
|
|
package com.epmet.modules.notice.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.annotation.LoginUser; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -63,7 +64,7 @@ public class NoticeController { |
|
|
|
public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddNoticeFormDTO formDTO){ |
|
|
|
ValidatorUtils.validateEntity(formDTO, AddNoticeFormDTO.Add.class, AddNoticeFormDTO.AddUserShow.class); |
|
|
|
if(formDTO.getExpirationTime().before(new Date())){ |
|
|
|
throw new RenException("通知过期时间不能早于当前时间"); |
|
|
|
throw new RenException(EpmetErrorCode.NOTICE_EXPIRATION_TIME.getCode()); |
|
|
|
} |
|
|
|
formDTO.setUserId(tokenDto.getUserId()); |
|
|
|
noticeService.add(formDTO); |
|
|
|