站内信通知
This commit is contained in:
@@ -9,6 +9,8 @@ public enum NoticeFirstTypeEnum {
|
||||
ASYNC_TASK_NOTICE("async_task_notice"),
|
||||
/** 聊天 */
|
||||
CHAT("chat"),
|
||||
/** 站内信 */
|
||||
SITE("site")
|
||||
;
|
||||
|
||||
private String type;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.newyetai.usercenter.notice.constant;
|
||||
|
||||
public enum NoticeBizTypeEnum {
|
||||
|
||||
/** 岗位报名-邀请面试 */
|
||||
POSITION_INVITE("position_invite"),
|
||||
/** 岗位报名-面试结果 */
|
||||
POSITION_INVITE_result("position_invite_result"),
|
||||
;
|
||||
|
||||
private String type;
|
||||
|
||||
NoticeBizTypeEnum(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.newyetai.usercenter.notice.dto;
|
||||
|
||||
import com.newyetai.usercenter.notice.constant.NoticeChannelTypeEnum;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -35,11 +36,14 @@ public class NoticeSendRecordOperateDTO extends BaseOperateDTO implements Serial
|
||||
// 或模版code
|
||||
@ApiModelProperty("通知模版code")
|
||||
private String templateCode;
|
||||
|
||||
@ApiModelProperty("消息体模版id")
|
||||
private Long contentTemplateId ;
|
||||
// 或消息体通道类型
|
||||
@ApiModelProperty("消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)")
|
||||
private Integer channelType ;
|
||||
@Default
|
||||
private Integer channelType = NoticeChannelTypeEnum.SITE.getType();
|
||||
|
||||
@ApiModelProperty("接收方机构id,不传平台模版取1,非平台模版取当前上下文机构id")
|
||||
private Long receiverOrgId ;
|
||||
@ApiModelProperty("消息体参数")
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.newyetai.usercenter.notice.service.provider;
|
||||
|
||||
import com.newyetai.component.notice.constant.NoticeFirstTypeEnum;
|
||||
import com.newyetai.component.notice.dto.NoticeMsgDTO;
|
||||
import com.newyetai.component.notice.util.NoticeUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -32,14 +35,8 @@ public class SiteNoticeChannelProvider extends AbstractNoticeChannelProvider {
|
||||
|
||||
public AlitaResult<?> invoke(NoticeSendRecordDTO noticeSendRecordDTO,
|
||||
NoticeSendRecordDetailDTO noticeSendRecordDetailDTO) {
|
||||
/* TODO mq实现通知各系统(websocket)
|
||||
AlitaResult<?> mqResult = MqSendUtils.send(UcMqConstants.ROUTING_KEY_SITE_NOTICE, detail);
|
||||
Long detailId = detail.getId();
|
||||
if (mqResult.getSuccess()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}*/
|
||||
NoticeUtils.sendAsyncNotice(
|
||||
NoticeMsgDTO.create(noticeSendRecordDetailDTO.getUserId(), NoticeFirstTypeEnum.SITE.getType(), noticeSendRecordDTO));
|
||||
return noticeSendRecordDTO.getContent() != null ? AlitaResult.success()
|
||||
: AlitaResult.bizError("消息内容为空,模版替换失败");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user