Merge remote-tracking branch 'origin/group5-msg'

pull/3/head
fengshuonan 2021-01-10 13:48:55 +08:00
commit c5e7b318ce
59 changed files with 2300 additions and 12 deletions

View File

@ -43,7 +43,7 @@ public class GunsLogAutoConfiguration {
* @date 2020/12/28 22:09
*/
@Bean
@ConditionalOnMissingBean(SysLogServiceImpl.class)
@ConditionalOnMissingBean(SysLogService.class)
@ConditionalOnProperty(prefix = SYS_LOG_PREFIX, name = "type", havingValue = "db")
public SysLogService sysLogService() {
return new SysLogServiceImpl();

View File

@ -0,0 +1,3 @@
系统消息模块
系统消息模块可以发送消息记录,已读未读状态

View File

@ -0,0 +1 @@
系统消息模块的api

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-message</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>message-api</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--auth模块的api-->
<!--记录日志时候有可能需要记录当前登录用户id-->
<!--如果不要记录当前登录用户id时就不用本模块所以optional=true-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>auth-api</artifactId>
<version>1.0.0</version>
<optional>true</optional>
</dependency>
<!--参数校验模块-->
<!--包含带参数校验注解的类-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>validator-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--数据库模块 api-->
<!--分页查询需要用到PageResult相关类-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>db-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--web-->
<!--LogRecordFactory快速创建http类的日志参数会用到-->
<!--如果不要记录当前请求的http接口信息就不用本模块所以optional=true-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,124 @@
package cn.stylefeng.roses.kernel.message.api;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageResponse;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageSendParam;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import java.util.List;
/**
*
* <p>
*
*
* @author liuhanqing
* @date 2021/1/2 21:21
*/
public interface MessageApi {
/**
*
*
* @param messageSendParam
* @author liuhanqing
* @date 2021/1/2 21:21
*/
void sendMessage(MessageSendParam messageSendParam);
/**
*
*
* @param messageParam
* @author liuhanqing
* @date 2021/1/2 22:15
*/
void updateReadFlag(MessageParam messageParam);
/**
*
*
* @author liuhanqing
* @date 2021/1/2 22:15
*/
void allMessageReadFlag();
/**
*
*
* @param messageIds id
* @author liuhanqing
* @date 2021/1/4 21:21
*/
void batchReadFlagByMessageIds(String messageIds, MessageReadFlagEnum flagEnum);
/**
*
*
* @param messageId id
* @author liuhanqing
* @date 2021/1/2 21:21
*/
void deleteByMessageId(Long messageId);
/**
*
*
* @param messageIds id
* @author liuhanqing
* @date 2021/1/2 21:21
*/
void batchDeleteByMessageIds(String messageIds);
/**
*
*
* @param messageParam
* @return
* @author liuhanqing
* @date 2021/1/2 21:21
*/
MessageResponse messageDetail(MessageParam messageParam);
/**
*
*
* @param messageParam
* @return
* @author liuhanqing
* @date 2021/1/2 21:21
*/
PageResult<MessageResponse> queryPage(MessageParam messageParam);
/**
*
*
* @param messageParam
* @return
* @author liuhanqing
* @date 2021/1/2 21:21
*/
List<MessageResponse> queryList(MessageParam messageParam);
/**
*
*
* @param messageParam
* @return
* @author liuhanqing
* @date 2021/1/2 21:21
*/
PageResult<MessageResponse> queryPageCurrentUser(MessageParam messageParam);
/**
*
*
* @param messageParam
* @return
* @author liuhanqing
* @date 2021/1/2 21:21
*/
List<MessageResponse> queryListCurrentUser(MessageParam messageParam);
}

View File

@ -0,0 +1,36 @@
package cn.stylefeng.roses.kernel.message.api.constants;
/**
* message
*
* @author liuhanqing
* @date 2021/1/1 20:58
*/
public interface MessageConstants {
/**
*
*/
String MESSAGE_MODULE_NAME = "kernel-s-message";
/**
*
*/
String MESSAGE_EXCEPTION_STEP_CODE = "23";
/**
*
*/
String RECEIVE_ALL_USER_FLAG = "all";
/**
*
*/
Integer DEFAULT_BEGIN_PAGE_NO = 1;
/**
*
*/
Integer DEFAULT_PAGE_SIZE = 10;
}

View File

@ -0,0 +1,24 @@
package cn.stylefeng.roses.kernel.message.api.context;
import cn.hutool.extra.spring.SpringUtil;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
/**
* api
*
* @author liuhanqing
* @date 2021/1/1 21:13
*/
public class MessageContext {
/**
* api
*
* @author liuhanqing
* @date 2021/1/1 21:13
*/
public static MessageApi me() {
return SpringUtil.getBean(MessageApi.class);
}
}

View File

@ -0,0 +1,44 @@
package cn.stylefeng.roses.kernel.message.api.enums;
import lombok.Getter;
/**
*
*
* @author liuhanqing
* @date 2021/1/4 22:26
*/
@Getter
public enum MessageBusinessTypeEnum {
/**
*
*/
SYS_NOTICE("sys_notice", "系统通知", "/sysNotice/detail");
private final String code;
private final String name;
private final String url;
MessageBusinessTypeEnum(String code, String name, String url) {
this.code = code;
this.name = name;
this.url = url;
}
public static MessageBusinessTypeEnum getByCode(String code) {
if (code == null) {
return null;
}
for (MessageBusinessTypeEnum flagEnum : MessageBusinessTypeEnum.values()) {
if (flagEnum.getCode().equals(code)) {
return flagEnum;
}
}
return null;
}
}

View File

@ -0,0 +1,50 @@
package cn.stylefeng.roses.kernel.message.api.enums;
import lombok.Getter;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:26
*/
@Getter
public enum MessageProrityLevelEnum {
/**
*
*/
HIGH("high", "高"),
/**
*
*/
MIDDLE("middle", "中"),
/**
*
*/
LOW("low", "低");
private final String code;
private final String name;
MessageProrityLevelEnum(String code, String name) {
this.code = code;
this.name = name;
}
public static String getName(String code) {
if (code == null) {
return null;
}
for (MessageProrityLevelEnum flagEnum : MessageProrityLevelEnum.values()) {
if (flagEnum.getCode().equals(code)) {
return flagEnum.name;
}
}
return null;
}
}

View File

@ -0,0 +1,45 @@
package cn.stylefeng.roses.kernel.message.api.enums;
import lombok.Getter;
/**
*
*
* @author liuhanqing
* @date 2021/1/4 22:26
*/
@Getter
public enum MessageReadFlagEnum {
/**
*
*/
UNREAD(0, "未读"),
/**
*
*/
READ(1, "已读");
private final Integer code;
private final String name;
MessageReadFlagEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public static String getName(Integer code) {
if (code == null) {
return null;
}
for (MessageReadFlagEnum flagEnum : MessageReadFlagEnum.values()) {
if (flagEnum.getCode().equals(code)) {
return flagEnum.name;
}
}
return null;
}
}

View File

@ -0,0 +1,19 @@
package cn.stylefeng.roses.kernel.message.api.exception;
import cn.stylefeng.roses.kernel.message.api.constants.MessageConstants;
import cn.stylefeng.roses.kernel.rule.abstracts.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
/**
*
*
* @author liuhanqing
* @date 2021/1/1 20:55
*/
public class MessageException extends ServiceException {
public MessageException(AbstractExceptionEnum exception) {
super(MessageConstants.MESSAGE_MODULE_NAME, exception);
}
}

View File

@ -0,0 +1,37 @@
package cn.stylefeng.roses.kernel.message.api.exception.enums;
import cn.stylefeng.roses.kernel.message.api.constants.MessageConstants;
import cn.stylefeng.roses.kernel.rule.abstracts.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import lombok.Getter;
/**
*
*
* @author liuhanqing
* @date 2021/1/1 21:14
*/
@Getter
public enum MessageExceptionEnum implements AbstractExceptionEnum {
/**
* receiveUserIds
*/
ERROR_RECEIVE_USER_IDS(RuleConstants.BUSINESS_ERROR_TYPE_CODE + MessageConstants.MESSAGE_EXCEPTION_STEP_CODE + "01", "接收用户id字符串不合法");
/**
*
*/
private final String errorCode;
/**
*
*/
private final String userTip;
MessageExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}

View File

@ -0,0 +1,92 @@
package cn.stylefeng.roses.kernel.message.api.pojo;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
*
*
* @author liuhanqing
* @date 2021/1/1 20:23
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MessageParam extends BaseRequest {
/**
* id
*/
@NotNull(message = "messageId不能为空", groups = {edit.class, delete.class, detail.class, updateStatus.class})
private Long messageId;
/**
* id
*/
private Long receiveUserId;
/**
* id
*/
private Long sendUserId;
/**
*
*/
private String messageTitle;
/**
*
*/
private String messageContent;
/**
*
*/
private String messageType;
/**
*
*/
private String priorityLevel;
/**
*
*/
private Date messageSendTime;
/**
* id
*/
private Long businessId;
/**
*
*/
private String businessType;
/**
* 0-1-
*/
@NotNull(message = "阅读状态不能为空", groups = {updateStatus.class})
private Integer readFlag;
/**
* id
*/
@NotEmpty(message = "消息id集合不能为空请检查messageIdList参数", groups = {updateReadFlag.class})
private List<Long> messageIdList;
/**
*
*/
public @interface updateReadFlag {
}
}

View File

@ -0,0 +1,72 @@
package cn.stylefeng.roses.kernel.message.api.pojo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
*
* @author liuhanqing
* @date 2021/1/2 21:23
*/
@Data
public class MessageResponse implements Serializable {
/**
* id
*/
private Long messageId;
/**
* id
*/
private Long receiveUserId;
/**
* id
*/
private Long sendUserId;
/**
*
*/
private String messageTitle;
/**
*
*/
private String messageContent;
/**
*
*/
private String priorityLevel;
/**
*
*/
private String messageType;
/**
*
*/
private Date messageSendTime;
/**
* id
*/
private Long businessId;
/**
*
*/
private String businessType;
/**
* 0-1-
*/
private Integer readFlag;
}

View File

@ -0,0 +1,59 @@
package cn.stylefeng.roses.kernel.message.api.pojo;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
*
*
* @author liuhanqing
* @date 2021/1/1 20:23
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class MessageSendParam extends BaseRequest {
/**
* id,
*/
@NotBlank(message = "接收用户ID字符串不能为空", groups = {add.class, edit.class})
private String receiveUserIds;
/**
*
*/
@NotBlank(message = "消息标题不能为空", groups = {add.class, edit.class})
private String messageTitle;
/**
*
*/
private String messageContent;
/**
*
*/
private String messageType;
/**
*
*/
private String priorityLevel;
/**
* id
*/
@NotNull(message = "业务id不能为空", groups = {add.class, edit.class})
private Long businessId;
/**
*
*/
@NotBlank(message = "业务类型不能为空", groups = {add.class, edit.class})
private String businessType;
}

View File

@ -0,0 +1 @@
系统消息业务模块,包含发送消息,查看消息,消息列表,已读消息,未读消息的业务

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-d-log</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>message-business</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--消息api模块-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>message-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--资源api模块-->
<!--用在资源控制器,资源扫描上-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>scanner-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--参数校验模块-->
<!--用在控制器,参数校验-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>validator-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--数据库sdk-->
<!--数据库dao框架-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>db-sdk-mp</artifactId>
<version>1.0.0</version>
</dependency>
<!--web模块-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,120 @@
package cn.stylefeng.roses.kernel.message.modular.manage.controller;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageSendParam;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*
* @author liuhanqing
* @date 2021/1/1 22:30
*/
@RestController
@ApiResource(name = "系统消息控制器")
public class SysMessageController {
/**
* api
*/
@Autowired
private MessageApi messageApi;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@PostResource(name = "发送系统消息", path = "/sysMessage/sendMessage")
public ResponseData sendMessage(@RequestBody @Validated(MessageSendParam.add.class) MessageSendParam messageSendParam) {
messageApi.sendMessage(messageSendParam);
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@PostResource(name = "批量更新系统消息状态", path = "/sysMessage/batchUpdateReadFlag")
public ResponseData batchUpdateReadFlag(@RequestBody @Validated(MessageParam.updateReadFlag.class) MessageParam messageParam) {
List<Long> messageIdList = messageParam.getMessageIdList();
messageApi.batchReadFlagByMessageIds(StrUtil.join(",", messageIdList), MessageReadFlagEnum.READ);
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@GetResource(name = "系统消息全部修改已读", path = "/sysMessage/allMessageReadFlag")
public ResponseData allMessageReadFlag() {
messageApi.allMessageReadFlag();
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@PostResource(name = "删除系统消息", path = "/sysMessage/delete")
public ResponseData delete(@RequestBody @Validated(MessageParam.delete.class) MessageParam messageParam) {
messageApi.deleteByMessageId(messageParam.getMessageId());
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@GetResource(name = "查看系统消息", path = "/sysMessage/detail")
public ResponseData detail(@Validated(MessageParam.detail.class) MessageParam messageParam) {
return new SuccessResponseData(messageApi.messageDetail(messageParam));
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@GetResource(name = "分页查询系统消息列表", path = "/sysMessage/page")
public ResponseData page(MessageParam messageParam) {
return new SuccessResponseData(messageApi.queryPageCurrentUser(messageParam));
}
/**
*
*
* @author liuhanqing
* @date 2021/1/8 13:50
*/
@GetResource(name = "系统消息列表", path = "/sysMessage/list")
public ResponseData list(MessageParam messageParam) {
return new SuccessResponseData(messageApi.queryListCurrentUser(messageParam));
}
}

View File

@ -0,0 +1 @@
系统消息记录的sdk用于将消息记录到数据库中提供相关消息管理接口

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-message</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>message-sdk-db</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--消息模块的api-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>message-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--数据库sdk-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>db-sdk-mp</artifactId>
<version>1.0.0</version>
</dependency>
<!--发送消息需要用到用户相关的接口-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>system-api</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,197 @@
package cn.stylefeng.roses.kernel.message.db;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.constants.MessageConstants;
import cn.stylefeng.roses.kernel.message.api.enums.MessageReadFlagEnum;
import cn.stylefeng.roses.kernel.message.api.exception.MessageException;
import cn.stylefeng.roses.kernel.message.api.exception.enums.MessageExceptionEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageResponse;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageSendParam;
import cn.stylefeng.roses.kernel.message.db.entity.SysMessage;
import cn.stylefeng.roses.kernel.message.db.service.SysMessageService;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import cn.stylefeng.roses.kernel.system.UserServiceApi;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
*
*
* @author liuhanqing
* @date 2021/1/2 22:00
*/
@Slf4j
@Service
public class MessageDbServiceImpl implements MessageApi {
@Resource
private UserServiceApi userServiceApi;
@Resource
private SysMessageService sysMessageService;
@Override
@Transactional(rollbackFor = Exception.class)
public void sendMessage(MessageSendParam messageSendParam) {
String receiveUserIds = messageSendParam.getReceiveUserIds();
// 获取当前登录人
LoginUser loginUser = LoginContext.me().getLoginUser();
List<SysMessage> sendMsgList = new ArrayList<>();
List<Long> userIds;
// 发送所有人判断
if (MessageConstants.RECEIVE_ALL_USER_FLAG.equals(receiveUserIds)) {
// 查询所有用户
userIds = userServiceApi.queryAllUserIdList(new SysUserRequest());
} else {
String[] userIdArr = receiveUserIds.split(",");
userIds = Convert.toList(Long.class, userIdArr);
}
if (userIds == null || userIds.isEmpty()) {
throw new MessageException(MessageExceptionEnum.ERROR_RECEIVE_USER_IDS);
}
Set<Long> userIdSet = new HashSet<>(userIds);
SysMessage sysMessage = new SysMessage();
BeanUtil.copyProperties(messageSendParam, sysMessage);
// 初始化默认值
sysMessage.setReadFlag(MessageReadFlagEnum.UNREAD.getCode());
sysMessage.setSendUserId(loginUser.getUserId());
sysMessage.setMessageSendTime(new Date());
userIdSet.forEach(userId -> {
// 判断用户是否存在
if (userServiceApi.userExist(userId)) {
sysMessage.setReceiveUserId(userId);
sendMsgList.add(sysMessage);
}
});
sysMessageService.saveBatch(sendMsgList);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateReadFlag(MessageParam messageParam) {
Long messageId = messageParam.getMessageId();
SysMessage sysMessage = sysMessageService.getById(messageId);
Optional.ofNullable(sysMessage).ifPresent(msg -> {
msg.setReadFlag(messageParam.getReadFlag());
sysMessageService.updateById(msg);
});
}
@Override
public void allMessageReadFlag() {
// 获取当前登录人
LoginUser loginUser = LoginContext.me().getLoginUser();
Long userId = loginUser.getUserId();
LambdaUpdateWrapper<SysMessage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(SysMessage::getReadFlag, MessageReadFlagEnum.READ.getCode())
.eq(SysMessage::getReadFlag, MessageReadFlagEnum.UNREAD.getCode())
.eq(SysMessage::getReceiveUserId, userId)
.set(SysMessage::getDelFlag, YesOrNotEnum.N.getCode());
sysMessageService.update(updateWrapper);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void batchReadFlagByMessageIds(String messageIds, MessageReadFlagEnum flagEnum) {
LambdaUpdateWrapper<SysMessage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.inSql(SysMessage::getMessageId, messageIds).set(SysMessage::getReadFlag, flagEnum.getCode());
sysMessageService.update(updateWrapper);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByMessageId(Long messageId) {
LambdaUpdateWrapper<SysMessage> updateWrapper = new LambdaUpdateWrapper<>();
// 修改为逻辑删除
updateWrapper.eq(SysMessage::getMessageId, messageId)
.set(SysMessage::getDelFlag, YesOrNotEnum.Y.getCode());
sysMessageService.update(updateWrapper);
// sysMessageService.remove(updateWrapper);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void batchDeleteByMessageIds(String messageIds) {
LambdaUpdateWrapper<SysMessage> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.inSql(SysMessage::getMessageId, messageIds)
.set(SysMessage::getDelFlag, YesOrNotEnum.Y.getCode());
sysMessageService.update(updateWrapper);
}
@Override
public MessageResponse messageDetail(MessageParam messageParam) {
SysMessage sysMessage = sysMessageService.getById(messageParam.getMessageId());
// 判断消息为未读状态更新为已读
Optional.ofNullable(sysMessage).ifPresent(msg -> {
if(MessageReadFlagEnum.UNREAD.getCode().equals(sysMessage.getReadFlag())){
msg.setReadFlag(MessageReadFlagEnum.READ.getCode());
sysMessageService.updateById(msg);
}
});
MessageResponse messageResponse = new MessageResponse();
BeanUtil.copyProperties(sysMessage, messageResponse);
return messageResponse;
}
@Override
public PageResult<MessageResponse> queryPage(MessageParam messageParam) {
PageResult<SysMessage> pageResult = sysMessageService.page(messageParam);
PageResult<MessageResponse> result = new PageResult<>();
BeanUtil.copyProperties(pageResult, result);
return result;
}
@Override
public List<MessageResponse> queryList(MessageParam messageParam) {
List<SysMessage> messageList = sysMessageService.list(messageParam);
List<MessageResponse> resultList = messageList.stream().map(msg -> {
MessageResponse response = new MessageResponse();
BeanUtil.copyProperties(msg, response);
return response;
}).collect(Collectors.toList());
return resultList;
}
@Override
public PageResult<MessageResponse> queryPageCurrentUser(MessageParam messageParam) {
if (ObjectUtil.isEmpty(messageParam)) {
messageParam = new MessageParam();
}
// 获取当前登录人
LoginUser loginUser = LoginContext.me().getLoginUser();
messageParam.setReceiveUserId(loginUser.getUserId());
return this.queryPage(messageParam);
}
@Override
public List<MessageResponse> queryListCurrentUser(MessageParam messageParam) {
if (ObjectUtil.isEmpty(messageParam)) {
messageParam = new MessageParam();
}
// 获取当前登录人
LoginUser loginUser = LoginContext.me().getLoginUser();
messageParam.setReceiveUserId(loginUser.getUserId());
return this.queryList(messageParam);
}
}

View File

@ -0,0 +1,93 @@
package cn.stylefeng.roses.kernel.message.db.entity;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author liuhanqing
* @date 2020/12/31 20:09
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_message")
public class SysMessage extends BaseEntity {
/**
*
*/
@TableId(value = "message_id", type = IdType.ASSIGN_ID)
private Long messageId;
/**
* id
*/
@TableField(value = "receive_user_id")
private Long receiveUserId;
/**
* id
*/
@TableField(value = "send_user_id")
private Long sendUserId;
/**
*
*/
@TableField(value = "message_title")
private String messageTitle;
/**
*
*/
@TableField(value = "message_content")
private String messageContent;
/**
*
*/
@TableField(value = "message_type")
private String messageType;
/**
*
*/
@TableField(value = "priority_level")
private String priorityLevel;
/**
*
*/
@TableField(value = "message_send_time")
private Date messageSendTime;
/**
* id
*/
@TableField(value = "business_id")
private Long businessId;
/**
*
*/
@TableField(value = "business_type")
private String businessType;
/**
* 0-1-
*/
@TableField(value = "read_flag")
private Integer readFlag;
/**
* Y-N-
*/
@TableField(value = "del_flag", fill = FieldFill.INSERT)
private String delFlag;
}

View File

@ -0,0 +1,14 @@
package cn.stylefeng.roses.kernel.message.db.mapper;
import cn.stylefeng.roses.kernel.message.db.entity.SysMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper
*
* @author liuhanqing
* @date 2020/12/31 20:09
*/
public interface SysMessageMapper extends BaseMapper<SysMessage> {
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.stylefeng.roses.kernel.message.db.mapper.SysMessageMapper">
</mapper>

View File

@ -0,0 +1,34 @@
package cn.stylefeng.roses.kernel.message.db.service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.db.entity.SysMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* service
*
* @author liuhanqing
* @date 2020/12/31 20:09
*/
public interface SysMessageService extends IService<SysMessage> {
/**
*
*
* @param messageParam
* @author liuhanqing
* @date 2021/1/2 15:21
*/
PageResult<SysMessage> page(MessageParam messageParam);
/**
*
*
* @param messageParam
* @author liuhanqing
* @date 2021/1/8 15:21
*/
List<SysMessage> list(MessageParam messageParam);
}

View File

@ -0,0 +1,80 @@
package cn.stylefeng.roses.kernel.message.db.service.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageParam;
import cn.stylefeng.roses.kernel.message.db.entity.SysMessage;
import cn.stylefeng.roses.kernel.message.db.mapper.SysMessageMapper;
import cn.stylefeng.roses.kernel.message.db.service.SysMessageService;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* service
*
* @author liuhanqing
* @date 2020/12/31 20:09
*/
@Service
public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMessage> implements SysMessageService {
@Override
public PageResult<SysMessage> page(MessageParam messageParam) {
LambdaQueryWrapper<SysMessage> wrapper = createWrapper(messageParam);
Page<SysMessage> page = this.page(PageFactory.defaultPage(), wrapper);
return PageResultFactory.createPageResult(page);
}
@Override
public List<SysMessage> list(MessageParam messageParam) {
LambdaQueryWrapper<SysMessage> wrapper = createWrapper(messageParam);
return this.list(wrapper);
}
/**
* wrapper
*
* @author liuhanqing
* @date 2021/1/8 14:16
*/
private LambdaQueryWrapper<SysMessage> createWrapper(MessageParam messageParam) {
LambdaQueryWrapper<SysMessage> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotNull(messageParam)) {
// 拼接消息标题
if (ObjectUtil.isNotEmpty(messageParam.getMessageTitle())) {
queryWrapper.like(SysMessage::getMessageTitle, messageParam.getMessageTitle());
}
// 拼接接收人id查询条件
if (ObjectUtil.isNotEmpty(messageParam.getReceiveUserId())) {
queryWrapper.eq(SysMessage::getReceiveUserId, messageParam.getReceiveUserId());
}
// 拼接消息类型
if (ObjectUtil.isNotEmpty(messageParam.getMessageType())) {
queryWrapper.eq(SysMessage::getMessageType, messageParam.getMessageType());
}
// 拼接阅读状态
if (ObjectUtil.isNotEmpty(messageParam.getReadFlag())) {
queryWrapper.eq(SysMessage::getReadFlag, messageParam.getReadFlag());
}
}
// 查询未删除的
queryWrapper.ne(SysMessage::getDelFlag, YesOrNotEnum.Y.getCode());
// 按发送事件倒序
queryWrapper.orderByDesc(SysMessage::getMessageSendTime);
return queryWrapper;
}
}

View File

@ -0,0 +1 @@
系统消息的spring boot自动加载模块

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-message</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>message-spring-boot-starter</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--消息管理-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>message-business</artifactId>
<version>1.0.0</version>
</dependency>
<!--消息默认记录到库中-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>message-sdk-db</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,16 @@
package cn.stylefeng.roses.kernel.message.starter;
import org.springframework.context.annotation.Configuration;
/**
*
*
* @author liuhanqing
* @date 2020/12/31 18:50
*/
@Configuration
public class GunsMessageAutoConfiguration {
}

View File

@ -0,0 +1,2 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.stylefeng.roses.kernel.message.starter.GunsMessageAutoConfiguration

36
kernel-s-message/pom.xml Normal file
View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>roses-kernel</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>kernel-s-message</artifactId>
<packaging>pom</packaging>
<modules>
<module>message-api</module>
<module>message-business</module>
<module>message-sdk-db</module>
<module>message-spring-boot-starter</module>
</modules>
<dependencies>
<!-- 开发规则 -->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-a-rule</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -258,7 +258,7 @@ CREATE TABLE `sys_log` (
`app_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '服务名称一般为spring.application.name',
`request_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当前用户请求的url',
`request_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT 'http或方法的请求参数体',
`request_result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT 'http或方法的请求结果',
`request_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT 'http或方法的请求结果',
`server_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '当前服务器的ip',
`client_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '客户端的ip',
`user_id` bigint(20) NULL DEFAULT NULL COMMENT '用户id',
@ -945,4 +945,50 @@ CREATE TABLE `sys_user_role` (
-- ----------------------------
INSERT INTO `sys_user_role` VALUES (1339554696976781379, 1339550467939639299, 1339550467939639303, '2020-12-17 20:57:31', NULL, NULL, NULL);
-- ----------------------------
-- Table structure for sys_message
-- ----------------------------
DROP TABLE IF EXISTS `sys_message`;
CREATE TABLE `sys_message` (
`message_id` bigint(0) NOT NULL COMMENT '主键',
`receive_user_id` bigint(0) NULL DEFAULT NULL COMMENT '接收用户id',
`send_user_id` bigint(0) NULL DEFAULT NULL COMMENT '发送用户id',
`message_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '消息标题',
`message_content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '消息内容',
`message_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '消息类型',
`priority_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '优先级',
`message_send_time` datetime(0) NULL DEFAULT NULL COMMENT '消息发送时间',
`business_id` bigint(0) NULL DEFAULT NULL COMMENT '业务id',
`business_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '业务类型(根据业务id和业务类型可以确定业务数据)',
`read_flag` tinyint(0) NULL DEFAULT 0 COMMENT '阅读状态0-未读1-已读',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'N' COMMENT '是否删除Y-被删除N-未删除',
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`message_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统消息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for sys_notice
-- ----------------------------
DROP TABLE IF EXISTS `sys_notice`;
CREATE TABLE `sys_notice` (
`notice_id` bigint(0) NOT NULL COMMENT '主键',
`notice_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '通知标题',
`notice_summary` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '通知摘要',
`notice_content` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '通知内容',
`priority_level` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '优先级',
`notice_begin_time` datetime(0) NULL DEFAULT NULL COMMENT '开始时间',
`notice_end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间',
`notice_scope` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '通知范围用户id字符串',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'N' COMMENT '是否删除Y-被删除N-未删除',
`create_user` bigint(0) NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
`update_user` bigint(0) NULL DEFAULT NULL COMMENT '修改人',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`notice_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '通知管理' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -23,6 +23,7 @@
<module>system-business-user</module>
<module>system-business-role</module>
<module>system-business-menu</module>
<module>system-business-notice</module>
<module>system-spring-boot-starter</module>
</modules>

View File

@ -58,6 +58,10 @@
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
</dependencies>

View File

@ -0,0 +1,12 @@
package cn.stylefeng.roses.kernel.system;
/**
* api
*
* @author liuhanqing
* @date 2021/1/8 21:40
*/
public interface NoticeServiceApi {
}

View File

@ -1,8 +1,10 @@
package cn.stylefeng.roses.kernel.system;
import cn.stylefeng.roses.kernel.system.pojo.user.SysUserDTO;
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
import cn.stylefeng.roses.kernel.system.pojo.user.SysUserResponse;
import cn.stylefeng.roses.kernel.system.pojo.user.UserLoginInfoDTO;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import java.util.Date;
import java.util.List;
@ -92,4 +94,37 @@ public interface UserServiceApi {
*/
SysUserResponse getUserInfoByUserId(Long userId);
/**
* ID()
*
* @param sysUserRequest
* @return List<Long> id
* @author liuhanqing
* @date 2021/1/4 22:09
*/
List<Long> queryAllUserIdList(SysUserRequest sysUserRequest);
/**
*
*
* @param userId id
* @return
* @author liuhanqing
* @date 2021/1/4 22:09
*/
SysUserDTO getUserInfo(Long userId);
/**
* id
*
* @param userId id
* @return
* @author liuhanqing
* @date 2021/1/4 22:55
*/
Boolean userExist(Long userId);
}

View File

@ -0,0 +1,65 @@
/*
Copyright [2020] [https://www.stylefeng.cn]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
GunsAPACHE LICENSE 2.0使
1.LICENSE
2.Guns
3.
4. https://gitee.com/stylefeng/guns-separation
5. https://gitee.com/stylefeng/guns-separation
6.Guns https://www.stylefeng.cn
*/
package cn.stylefeng.roses.kernel.system.exception.enums;
import cn.stylefeng.roses.kernel.rule.abstracts.AbstractExceptionEnum;
import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
import cn.stylefeng.roses.kernel.system.constants.SystemConstants;
import lombok.Getter;
/**
*
*
* @author liuhanqing
* @date 2021/1/9 16:11
*/
@Getter
public enum NoticeExceptionEnum implements AbstractExceptionEnum {
/**
*
*/
NOTICE_NOT_EXIST(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "91", "通知不存在"),
/**
*
*/
NOTICE_SCOPE_NOT_EDIT(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "92", "通知范围不允许修改");
/**
*
*/
private final String errorCode;
/**
*
*/
private final String userTip;
NoticeExceptionEnum(String errorCode, String userTip) {
this.errorCode = errorCode;
this.userTip = userTip;
}
}

View File

@ -0,0 +1,71 @@
package cn.stylefeng.roses.kernel.system.pojo.notice;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 21:53
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class SysNoticeRequest extends BaseRequest {
/**
* id
*/
@NotNull(message = "noticeId不能为空", groups = {edit.class, delete.class, detail.class})
private Long noticeId;
/**
*
*/
@NotBlank(message = "通知标题不能为空", groups = {add.class, edit.class})
private String noticeTitle;
/**
*
*/
private String noticeSummary;
/**
*
*/
@NotBlank(message = "通知优先级不能为空", groups = {add.class, edit.class})
private String priorityLevel;
/**
*
*/
@NotNull(message = "通知开始时间不能为空", groups = {add.class, edit.class})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date noticeBeginTime;
/**
*
*/
@NotNull(message = "通知开始时间不能为空", groups = {add.class, edit.class})
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date noticeEndTime;
/**
*
*/
private String noticeContent;
/**
*
*/
private String noticeScope;
}

View File

@ -0,0 +1,81 @@
package cn.stylefeng.roses.kernel.system.pojo.user;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author fengshuonan
* @date 2020/4/2 9:19
*/
@Data
public class SysUserDTO {
/**
*
*/
private Long userId;
/**
*
*/
private String account;
/**
*
*/
private String nickName;
/**
*
*/
private String realName;
/**
*
*/
private Long avatar;
/**
*
*/
private Date birthday;
/**
* M-F-
*/
private String sex;
/**
*
*/
private String email;
/**
*
*/
private String phone;
/**
*
*/
private String tel;
/**
*
*/
private Long orgId;
/**
*
*/
private Long positionId;
/**
*
*/
private Integer statusFlag;
}

View File

@ -1,4 +1,4 @@
package cn.stylefeng.roses.kernel.system.modular.user.pojo.request;
package cn.stylefeng.roses.kernel.system.pojo.user.request;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.roses.kernel.validator.validators.date.DateValue;

View File

@ -0,0 +1 @@
通知模块

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>kernel-s-system</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>system-business-notice</artifactId>
<packaging>jar</packaging>
<dependencies>
<!--系统管理api模块-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>system-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--通知api模块-->
<!--用在通知控制器,通知扫描上-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>scanner-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--参数校验模块-->
<!--用在控制器,参数校验-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>validator-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--数据库sdk-->
<!--数据库dao框架-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>db-sdk-mp</artifactId>
<version>1.0.0</version>
</dependency>
<!--web模块-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>message-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,98 @@
package cn.stylefeng.roses.kernel.notice.modular.controller;
import cn.stylefeng.roses.kernel.notice.modular.service.SysNoticeService;
import cn.stylefeng.roses.kernel.resource.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.resource.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.system.pojo.notice.SysNoticeRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 19:47
*/
@RestController
@ApiResource(name = "通知管理")
public class NoticeController {
@Autowired
private SysNoticeService sysResourceService;
/**
*
*
* @author liuhanqing
* @date 2021/1/9 14:44
*/
@PostResource(name = "添加通知管理", path = "/sysNotice/add")
public ResponseData add(@RequestBody @Validated(SysNoticeRequest.add.class) SysNoticeRequest sysNoticeParam) {
sysResourceService.add(sysNoticeParam);
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 14:54
*/
@PostResource(name = "编辑通知管理", path = "/sysNotice/edit")
public ResponseData edit(@RequestBody @Validated(SysNoticeRequest.edit.class) SysNoticeRequest sysNoticeParam) {
sysResourceService.edit(sysNoticeParam);
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 14:54
*/
@PostResource(name = "删除通知管理", path = "/sysNotice/delete")
public ResponseData delete(@RequestBody @Validated(SysNoticeRequest.delete.class) SysNoticeRequest sysNoticeParam) {
sysResourceService.delete(sysNoticeParam);
return new SuccessResponseData();
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 9:49
*/
@GetResource(name = "查看通知管理", path = "/sysNotice/detail")
public ResponseData detail(@Validated(SysNoticeRequest.detail.class) SysNoticeRequest sysNoticeParam) {
return new SuccessResponseData(sysResourceService.detail(sysNoticeParam));
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 21:23
*/
@GetResource(name = "查询通知管理", path = "/sysNotice/page")
public ResponseData page(SysNoticeRequest sysNoticeParam) {
return new SuccessResponseData(sysResourceService.page(sysNoticeParam));
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 14:55
*/
@GetResource(name = "通知管理列表", path = "/sysNotice/list")
public ResponseData list(SysNoticeRequest sysNoticeParam) {
return new SuccessResponseData(sysResourceService.list(sysNoticeParam));
}
}

View File

@ -0,0 +1,80 @@
package cn.stylefeng.roses.kernel.notice.modular.entity;
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 22:45
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_notice")
public class SysNotice extends BaseEntity {
/**
* id
*/
@TableId("notice_id")
private Long noticeId;
/**
*
*/
@TableField("notice_title")
private String noticeTitle;
/**
*
*/
@TableField("notice_summary")
private String noticeSummary;
/**
*
*/
@TableField(value = "priority_level")
private String priorityLevel;
/**
*
*/
@TableField(value = "notice_begin_time")
private Date noticeBeginTime;
/**
*
*/
@TableField(value = "notice_end_time")
private Date noticeEndTime;
/**
*
*/
@TableField("notice_content")
private String noticeContent;
/**
*
*/
@TableField("notice_scope")
private String noticeScope;
/**
* Y-N-
*/
@TableField(value = "del_flag", fill = FieldFill.INSERT)
private String delFlag;
}

View File

@ -0,0 +1,14 @@
package cn.stylefeng.roses.kernel.notice.modular.mapper;
import cn.stylefeng.roses.kernel.notice.modular.entity.SysNotice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper
*
* @author liuhanqing
* @date 2021/1/8 22:45
*/
public interface SysNoticeMapper extends BaseMapper<SysNotice> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.stylefeng.roses.kernel.notice.modular.mapper.SysNoticeMapper">
</mapper>

View File

@ -0,0 +1,78 @@
package cn.stylefeng.roses.kernel.notice.modular.service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.notice.modular.entity.SysNotice;
import cn.stylefeng.roses.kernel.system.NoticeServiceApi;
import cn.stylefeng.roses.kernel.system.pojo.notice.SysNoticeRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 19:56
*/
public interface SysNoticeService extends IService<SysNotice>, NoticeServiceApi {
/**
*
*
* @param SysNoticeParam
* @author liuhanqing
* @date 2021/1/9 14:57
*/
void add(SysNoticeRequest SysNoticeParam);
/**
*
*
* @param SysNoticeParam
* @author liuhanqing
* @date 2021/1/9 14:58
*/
void edit(SysNoticeRequest SysNoticeParam);
/**
*
*
* @param SysNoticeParam
* @author liuhanqing
* @date 2021/1/9 14:57
*/
void delete(SysNoticeRequest SysNoticeParam);
/**
*
*
* @param SysNoticeParam
* @return
* @author liuhanqing
* @date 2021/1/9 14:56
*/
SysNotice detail(SysNoticeRequest SysNoticeParam);
/**
*
*
* @param SysNoticeParam
* @return
* @author liuhanqing
* @date 2021/1/9 14:56
*/
PageResult<SysNotice> page(SysNoticeRequest SysNoticeParam);
/**
*
*
* @param SysNoticeParam
* @return
* @author liuhanqing
* @date 2021/1/9 14:56
*/
List<SysNotice> list(SysNoticeRequest SysNoticeParam);
}

View File

@ -0,0 +1,167 @@
package cn.stylefeng.roses.kernel.notice.modular.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.message.api.MessageApi;
import cn.stylefeng.roses.kernel.message.api.enums.MessageBusinessTypeEnum;
import cn.stylefeng.roses.kernel.message.api.pojo.MessageSendParam;
import cn.stylefeng.roses.kernel.notice.modular.entity.SysNotice;
import cn.stylefeng.roses.kernel.notice.modular.mapper.SysNoticeMapper;
import cn.stylefeng.roses.kernel.notice.modular.service.SysNoticeService;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.roses.kernel.system.exception.enums.NoticeExceptionEnum;
import cn.stylefeng.roses.kernel.system.pojo.notice.SysNoticeRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*
* @author liuhanqing
* @date 2021/1/8 22:45
*/
@Service
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice> implements SysNoticeService {
private static String NOTICE_SCOPE_ALL = "all";
@Autowired
private SysNoticeMapper noticeMapper;
/**
* api
*/
@Autowired
private MessageApi messageApi;
private void sendMessage(SysNotice sysNotice){
MessageSendParam message = new MessageSendParam();
// 消息标题
message.setMessageTitle(sysNotice.getNoticeTitle());
// 消息内容
message.setMessageContent(sysNotice.getNoticeSummary());
// 消息优先级
message.setPriorityLevel(sysNotice.getPriorityLevel());
// 消息发送范围
message.setReceiveUserIds(sysNotice.getNoticeScope());
// 消息业务类型
message.setBusinessType(MessageBusinessTypeEnum.SYS_NOTICE.getCode());
message.setBusinessId(sysNotice.getNoticeId());
messageApi.sendMessage(message);
}
@Override
public void add(SysNoticeRequest sysNoticeRequest) {
SysNotice sysNotice = new SysNotice();
BeanUtil.copyProperties(sysNoticeRequest, sysNotice);
if(StrUtil.isBlank(sysNotice.getNoticeScope())){
sysNotice.setNoticeScope(NOTICE_SCOPE_ALL);
}
// 如果保存成功调用发送消息
if(this.save(sysNotice)){
sendMessage(sysNotice);
}
}
@Override
public void edit(SysNoticeRequest sysNoticeRequest) {
SysNotice sysNotice = this.querySysNotice(sysNoticeRequest);
String noticeScope = sysNotice.getNoticeScope();
if(StrUtil.isBlank(sysNoticeRequest.getNoticeScope())){
sysNoticeRequest.setNoticeScope(NOTICE_SCOPE_ALL);
}
if(sysNoticeRequest.equals(sysNotice.getNoticeScope())){
throw new ServiceException(NoticeExceptionEnum.NOTICE_SCOPE_NOT_EDIT);
}
BeanUtil.copyProperties(sysNoticeRequest, sysNotice);
// 通知范围不允许修改
sysNotice.setNoticeScope(noticeScope);
if(this.updateById(sysNotice)){
sendMessage(sysNotice);
}
}
@Override
public void delete(SysNoticeRequest sysNoticeRequest) {
SysNotice sysNotice = this.querySysNotice(sysNoticeRequest);
// 逻辑删除
sysNotice.setDelFlag(YesOrNotEnum.Y.getCode());
this.updateById(sysNotice);
}
@Override
public SysNotice detail(SysNoticeRequest sysNoticeRequest) {
return this.querySysNotice(sysNoticeRequest);
}
@Override
public PageResult<SysNotice> page(SysNoticeRequest sysNoticeRequest) {
LambdaQueryWrapper<SysNotice> wrapper = createWrapper(sysNoticeRequest);
Page<SysNotice> page = this.page(PageFactory.defaultPage(), wrapper);
return PageResultFactory.createPageResult(page);
}
@Override
public List<SysNotice> list(SysNoticeRequest sysNoticeRequest) {
LambdaQueryWrapper<SysNotice> wrapper = createWrapper(sysNoticeRequest);
return this.list(wrapper);
}
/**
*
*
* @author liuhanqing
* @date 2021/1/9 16:56
*/
private SysNotice querySysNotice(SysNoticeRequest sysNoticeRequest) {
SysNotice sysNotice = this.getById(sysNoticeRequest.getNoticeId());
if (ObjectUtil.isNull(sysNotice)) {
throw new ServiceException(NoticeExceptionEnum.NOTICE_NOT_EXIST);
}
return sysNotice;
}
/**
* wrapper
*
* @author liuhanqing
* @date 2020/1/9 16:16
*/
private LambdaQueryWrapper<SysNotice> createWrapper(SysNoticeRequest sysNoticeRequest) {
LambdaQueryWrapper<SysNotice> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotNull(sysNoticeRequest)) {
// 根据id查询
if (ObjectUtil.isNotEmpty(sysNoticeRequest.getNoticeId())) {
queryWrapper.eq(SysNotice::getNoticeId, sysNoticeRequest.getNoticeId());
}
// 根据消息标题模糊查询
if (ObjectUtil.isNotEmpty(sysNoticeRequest.getNoticeTitle())) {
queryWrapper.like(SysNotice::getNoticeTitle, sysNoticeRequest.getNoticeTitle()).or().like(SysNotice::getNoticeSummary, sysNoticeRequest.getNoticeTitle()).or().like(SysNotice::getNoticeContent, sysNoticeRequest.getNoticeTitle());
}
}
// 查询未删除状态的
queryWrapper.eq(SysNotice::getDelFlag, YesOrNotEnum.N.getCode());
return queryWrapper;
}
}

View File

@ -8,7 +8,7 @@ import cn.stylefeng.roses.kernel.resource.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserRoleService;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService;
import org.springframework.validation.annotation.Validated;

View File

@ -9,7 +9,7 @@ import cn.stylefeng.roses.kernel.rule.enums.SexEnum;
import cn.stylefeng.roses.kernel.rule.enums.YesOrNotEnum;
import cn.stylefeng.roses.kernel.system.enums.UserStatusEnum;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
/**
*

View File

@ -3,7 +3,7 @@ package cn.stylefeng.roses.kernel.system.modular.user.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.response.SysUserResponse;
import org.apache.ibatis.annotations.Param;

View File

@ -1,7 +1,7 @@
package cn.stylefeng.roses.kernel.system.modular.user.service;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserDataScope;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;

View File

@ -1,7 +1,7 @@
package cn.stylefeng.roses.kernel.system.modular.user.service;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserRole;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;

View File

@ -4,7 +4,7 @@ import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
import cn.stylefeng.roses.kernel.system.UserServiceApi;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.response.SysUserResponse;
import com.baomidou.mybatisplus.extension.service.IService;

View File

@ -2,7 +2,7 @@ package cn.stylefeng.roses.kernel.system.modular.user.service.impl;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserDataScope;
import cn.stylefeng.roses.kernel.system.modular.user.mapper.SysUserDataScopeMapper;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserDataScopeService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

View File

@ -4,7 +4,7 @@ import cn.stylefeng.roses.kernel.system.exception.SystemModularException;
import cn.stylefeng.roses.kernel.system.exception.enums.SysUserExceptionEnum;
import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserRole;
import cn.stylefeng.roses.kernel.system.modular.user.mapper.SysUserRoleMapper;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserRoleService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

View File

@ -28,7 +28,8 @@ import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUserRole;
import cn.stylefeng.roses.kernel.system.modular.user.factory.SysUserCreateFactory;
import cn.stylefeng.roses.kernel.system.modular.user.factory.UserLoginInfoFactory;
import cn.stylefeng.roses.kernel.system.modular.user.mapper.SysUserMapper;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.pojo.user.SysUserDTO;
import cn.stylefeng.roses.kernel.system.pojo.user.request.SysUserRequest;
import cn.stylefeng.roses.kernel.system.modular.user.pojo.response.SysUserResponse;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserDataScopeService;
import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserOrgService;
@ -54,6 +55,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -484,6 +486,58 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
return null;
}
@Override
public List<Long> queryAllUserIdList(SysUserRequest sysUserRequest) {
LambdaQueryWrapper<SysUser> wrapper = createWrapper(sysUserRequest);
// 排除超级管理员
// wrapper.ne(SysUser::getSuperAdminFlag, YesOrNotEnum.Y.getCode());
// 只查询id
wrapper.select(SysUser::getUserId);
// 查询全部用户ID
Function<Object, Long> mapper = id -> Long.valueOf(id.toString());
List<Long> userIds = this.listObjs(wrapper, mapper);
return userIds;
}
/**
*
*
* @author liuhanqing
* @date 2021/1/4 22:54
*/
@Override
public SysUserDTO getUserInfo(Long userId) {
SysUser sysUser = this.getById(userId);
if (ObjectUtil.isNull(sysUser)) {
throw new SystemModularException(SysUserExceptionEnum.USER_NOT_EXIST, userId);
}
SysUserDTO userDTO = new SysUserDTO();
BeanUtil.copyProperties(sysUser, userDTO);
return userDTO;
}
@Override
public Boolean userExist(Long userId) {
SysUserRequest userRequest = new SysUserRequest();
userRequest.setUserId(userId);
LambdaQueryWrapper<SysUser> wrapper = createWrapper(userRequest);
// 只查询id
wrapper.select(SysUser::getUserId);
// 查询用户
SysUser sysUser = this.getOne(wrapper);
if (sysUser == null || sysUser.getUserId() == null) {
return Boolean.FALSE;
}
return Boolean.TRUE;
}
/**
*
*

View File

@ -59,6 +59,13 @@
<version>1.0.0</version>
</dependency>
<!--通知管理的业务-->
<dependency>
<groupId>cn.stylefeng.roses</groupId>
<artifactId>system-business-notice</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</project>

View File

@ -73,6 +73,9 @@
<!--字典业务模块-->
<module>kernel-s-dict</module>
<!--系统消息模块-->
<module>kernel-s-message</module>
<!--系统管理基础业务-->
<module>kernel-s-system</module>
</modules>