站内信通知

This commit is contained in:
ran.shang
2025-06-20 14:51:25 +08:00
parent 676abc2631
commit 2649ec853f
4 changed files with 33 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ public enum NoticeFirstTypeEnum {
ASYNC_TASK_NOTICE("async_task_notice"), ASYNC_TASK_NOTICE("async_task_notice"),
/** 聊天 */ /** 聊天 */
CHAT("chat"), CHAT("chat"),
/** 站内信 */
SITE("site")
; ;
private String type; private String type;

View File

@@ -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;
}
}

View File

@@ -1,5 +1,6 @@
package com.newyetai.usercenter.notice.dto; package com.newyetai.usercenter.notice.dto;
import com.newyetai.usercenter.notice.constant.NoticeChannelTypeEnum;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@@ -35,11 +36,14 @@ public class NoticeSendRecordOperateDTO extends BaseOperateDTO implements Serial
// 或模版code // 或模版code
@ApiModelProperty("通知模版code") @ApiModelProperty("通知模版code")
private String templateCode; private String templateCode;
@ApiModelProperty("消息体模版id") @ApiModelProperty("消息体模版id")
private Long contentTemplateId ; private Long contentTemplateId ;
// 或消息体通道类型 // 或消息体通道类型
@ApiModelProperty("消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)") @ApiModelProperty("消息通道类型:1站内信,2短信,3钉钉,4企业微信,5邮件(见notice_channel_type)")
private Integer channelType ; @Default
private Integer channelType = NoticeChannelTypeEnum.SITE.getType();
@ApiModelProperty("接收方机构id,不传平台模版取1,非平台模版取当前上下文机构id") @ApiModelProperty("接收方机构id,不传平台模版取1,非平台模版取当前上下文机构id")
private Long receiverOrgId ; private Long receiverOrgId ;
@ApiModelProperty("消息体参数") @ApiModelProperty("消息体参数")

View File

@@ -1,5 +1,8 @@
package com.newyetai.usercenter.notice.service.provider; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -32,14 +35,8 @@ public class SiteNoticeChannelProvider extends AbstractNoticeChannelProvider {
public AlitaResult<?> invoke(NoticeSendRecordDTO noticeSendRecordDTO, public AlitaResult<?> invoke(NoticeSendRecordDTO noticeSendRecordDTO,
NoticeSendRecordDetailDTO noticeSendRecordDetailDTO) { NoticeSendRecordDetailDTO noticeSendRecordDetailDTO) {
/* TODO mq实现通知各系统(websocket) NoticeUtils.sendAsyncNotice(
AlitaResult<?> mqResult = MqSendUtils.send(UcMqConstants.ROUTING_KEY_SITE_NOTICE, detail); NoticeMsgDTO.create(noticeSendRecordDetailDTO.getUserId(), NoticeFirstTypeEnum.SITE.getType(), noticeSendRecordDTO));
Long detailId = detail.getId();
if (mqResult.getSuccess()) {
return true;
} else {
return false;
}*/
return noticeSendRecordDTO.getContent() != null ? AlitaResult.success() return noticeSendRecordDTO.getContent() != null ? AlitaResult.success()
: AlitaResult.bizError("消息内容为空,模版替换失败"); : AlitaResult.bizError("消息内容为空,模版替换失败");
} }