mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-23 07:25:07 +08:00
站内信基础代码整理,接口定义。
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.system.api.notify;
|
||||
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 站内信发送 API 接口
|
||||
*
|
||||
* @author xrcoder
|
||||
*/
|
||||
public interface NotifyMessageSendApi {
|
||||
|
||||
/**
|
||||
* 发送单条站内信给 Admin 用户
|
||||
* <p>
|
||||
* 在 mobile 为空时,使用 userId 加载对应 Admin 的手机号
|
||||
*
|
||||
* @param reqDTO 发送请求
|
||||
* @return 发送消息ID
|
||||
*/
|
||||
Long sendSingleMessageToAdmin(@Valid NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 发送单条站内信给 Member 用户
|
||||
* <p>
|
||||
* 在 mobile 为空时,使用 userId 加载对应 Member 的手机号
|
||||
*
|
||||
* @param reqDTO 发送请求
|
||||
* @return 发送消息ID
|
||||
*/
|
||||
Long sendSingleMessageToMember(@Valid NotifySendSingleToUserReqDTO reqDTO);
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.system.api.notify.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 站内信发送给 Admin 或者 Member 用户
|
||||
*
|
||||
* @author xrcoder
|
||||
*/
|
||||
@Data
|
||||
public class NotifySendSingleToUserReqDTO {
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
@NotNull(message = "用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 站内信模板编号
|
||||
*/
|
||||
@NotEmpty(message = "站内信模板编号不能为空")
|
||||
private String templateCode;
|
||||
|
||||
/**
|
||||
* 站内信模板参数
|
||||
*/
|
||||
private Map<String, Object> templateParams;
|
||||
}
|
@ -142,4 +142,10 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode OAUTH2_CODE_NOT_EXISTS = new ErrorCode(1002022000, "code 不存在");
|
||||
ErrorCode OAUTH2_CODE_EXPIRE = new ErrorCode(1002022000, "code 已过期");
|
||||
|
||||
// ========== 站内信模版 1002023000 ==========
|
||||
ErrorCode NOTIFY_TEMPLATE_NOT_EXISTS = new ErrorCode(1002023000, "站内信模版不存在");
|
||||
|
||||
// ========== 站内信 1002024000 ==========
|
||||
ErrorCode NOTIFY_MESSAGE_NOT_EXISTS = new ErrorCode(1002024000, "站内信不存在");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.system.enums.notify;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 站内信阅读状态枚举类
|
||||
*
|
||||
* @author xrcoder
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum NotifyReadStatusEnum {
|
||||
|
||||
UNREAD(0),
|
||||
READ(1);
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer status;
|
||||
}
|
Reference in New Issue
Block a user