🔨 规范化包结构.

This commit is contained in:
lijiahang
2024-06-07 15:41:52 +08:00
parent 5113aa63bd
commit c39049e5f5
33 changed files with 99 additions and 41 deletions

View File

@@ -2,7 +2,7 @@ package com.orion.visor.module.infra.dao;
import com.orion.visor.framework.mybatis.core.mapper.IMapper;
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
import com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO;
import com.orion.visor.module.infra.entity.po.SystemMessageCountPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -25,7 +25,7 @@ public interface SystemMessageDAO extends IMapper<SystemMessageDO> {
* @param status status
* @return count
*/
List<SystemMessageCountDTO> selectSystemMessageCount(@Param("receiverId") Long receiverId,
@Param("status") Integer status);
List<SystemMessageCountPO> selectSystemMessageCount(@Param("receiverId") Long receiverId,
@Param("status") Integer status);
}

View File

@@ -1,4 +1,4 @@
package com.orion.visor.module.infra.entity.dto;
package com.orion.visor.module.infra.entity.po;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -19,8 +19,8 @@ import java.io.Serializable;
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "SystemMessageCountDTO", description = "系统消息数量对象")
public class SystemMessageCountDTO implements Serializable {
@Schema(name = "SystemMessageCountPO", description = "系统消息数量对象")
public class SystemMessageCountPO implements Serializable {
private static final long serialVersionUID = 1L;

View File

@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
* @version 1.0.0
* @since 2023/10/8 13:48
*/
@Component
@Component("systemPreferenceStrategy")
public class SystemPreferenceStrategy implements IPreferenceStrategy<SystemPreferenceModel> {
@Override

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
* @version 1.0.0
* @since 2023/12/8 14:46
*/
@Component
@Component("terminalPreferenceStrategy")
public class TerminalPreferenceStrategy implements IPreferenceStrategy<TerminalPreferenceModel> {
@Override

View File

@@ -2,6 +2,7 @@ package com.orion.visor.module.infra.handler.upload;
import com.alibaba.fastjson.JSON;
import com.orion.lang.utils.io.Streams;
import com.orion.visor.framework.common.annotation.Keep;
import com.orion.visor.framework.common.constant.ExtraFieldConst;
import com.orion.visor.framework.common.file.FileClient;
import com.orion.visor.framework.websocket.core.utils.WebSockets;
@@ -34,6 +35,7 @@ public class FileUploadMessageDispatcher extends AbstractWebSocketHandler {
private final ConcurrentHashMap<String, IFileUploadHandler> handlers = new ConcurrentHashMap<>();
@Keep
@Resource
private FileClient localFileClient;

View File

@@ -6,6 +6,7 @@ import com.orion.lang.utils.Exceptions;
import com.orion.lang.utils.collect.Lists;
import com.orion.lang.utils.crypto.Signatures;
import com.orion.visor.framework.biz.operator.log.core.utils.OperatorLogs;
import com.orion.visor.framework.common.annotation.Keep;
import com.orion.visor.framework.common.constant.Const;
import com.orion.visor.framework.common.constant.ErrorMessage;
import com.orion.visor.framework.common.security.LoginUser;
@@ -65,6 +66,7 @@ public class AuthenticationServiceImpl implements AuthenticationService {
@Resource
private PermissionService permissionService;
@Keep
@Resource
private RedisTemplate<String, String> redisTemplate;

View File

@@ -2,6 +2,7 @@ package com.orion.visor.module.infra.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.orion.lang.utils.collect.Lists;
import com.orion.visor.framework.common.annotation.Keep;
import com.orion.visor.framework.common.utils.Valid;
import com.orion.visor.framework.redis.core.utils.RedisLists;
import com.orion.visor.framework.redis.core.utils.barrier.CacheBarriers;
@@ -37,6 +38,7 @@ public class FavoriteServiceImpl implements FavoriteService {
@Resource
private FavoriteDAO favoriteDAO;
@Keep
@Resource
private RedisTemplate<String, String> redisTemplate;

View File

@@ -11,7 +11,7 @@ import com.orion.visor.module.infra.dao.SystemMessageDAO;
import com.orion.visor.module.infra.dao.SystemUserDAO;
import com.orion.visor.module.infra.entity.domain.SystemMessageDO;
import com.orion.visor.module.infra.entity.domain.SystemUserDO;
import com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO;
import com.orion.visor.module.infra.entity.po.SystemMessageCountPO;
import com.orion.visor.module.infra.entity.request.message.SystemMessageCreateRequest;
import com.orion.visor.module.infra.entity.request.message.SystemMessageQueryRequest;
import com.orion.visor.module.infra.entity.vo.SystemMessageVO;
@@ -85,11 +85,11 @@ public class SystemMessageServiceImpl implements SystemMessageService {
Long userId = SecurityUtils.getLoginUserId();
Integer status = queryUnread ? MessageStatusEnum.UNREAD.getStatus() : null;
// 查询数量
List<SystemMessageCountDTO> countList = systemMessageDAO.selectSystemMessageCount(userId, status);
List<SystemMessageCountPO> countList = systemMessageDAO.selectSystemMessageCount(userId, status);
// 返回
return countList.stream()
.collect(Collectors.toMap(SystemMessageCountDTO::getClassify,
SystemMessageCountDTO::getCount,
.collect(Collectors.toMap(SystemMessageCountPO::getClassify,
SystemMessageCountPO::getCount,
Functions.right()));
}

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.orion.lang.utils.collect.Lists;
import com.orion.lang.utils.collect.Maps;
import com.orion.visor.framework.common.annotation.Keep;
import com.orion.visor.framework.redis.core.utils.RedisStrings;
import com.orion.visor.module.infra.convert.TagRelConvert;
import com.orion.visor.module.infra.dao.TagDAO;
@@ -38,6 +39,7 @@ public class TagRelServiceImpl implements TagRelService {
@Resource
private TagRelDAO tagRelDAO;
@Keep
@Resource
private RedisTemplate<String, String> redisTemplate;

View File

@@ -18,7 +18,7 @@
<result column="deleted" property="deleted"/>
</resultMap>
<resultMap id="CountResultMap" type="com.orion.visor.module.infra.entity.dto.SystemMessageCountDTO">
<resultMap id="CountResultMap" type="com.orion.visor.module.infra.entity.po.SystemMessageCountPO">
<result column="classify" property="classify"/>
<result column="count" property="count"/>
</resultMap>