From e33cc6968e5c7c57013413b077421b77714ed69b Mon Sep 17 00:00:00 2001 From: liyj <1003249715@qq.com> Date: Tue, 20 Aug 2024 14:48:17 +0800 Subject: [PATCH] 1、修改代码生成器 2、优化网关解析token信息 3、web端登录授权操作 4、web端修改密码操作 --- dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUseroleService.java | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUseroleService.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUseroleService.java index a801d7e..db88b89 100644 --- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUseroleService.java +++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/service/CtUseroleService.java @@ -6,8 +6,10 @@ import cn.huge.module.client.api.impl.UtilsClientImpl; import cn.huge.module.ctuser.dao.mapper.CtUseroleMapper; import cn.huge.module.ctuser.domain.po.CtUserole; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +35,9 @@ @Service @Transactional(rollbackFor = Exception.class) public class CtUseroleService extends ServiceImpl<CtUseroleMapper, CtUserole>{ + + @Autowired + private RedisTemplate<String, Object> redisTemplate; @Autowired private CtUseroleMapper mapper; @@ -116,7 +121,7 @@ */ public void saveCtUserole(CtUserole ctUserole){ try{ - Date nowDate = DateUtils.getMowDate(); + Date nowDate = DateUtils.getNowDate(); // 判断是否新增 if (IdUtils.checkNewId(ctUserole.getId())){ ctUserole.setId(utilsClient.getNewTimeId()); @@ -130,4 +135,16 @@ } } -} + /** + * 根据userId查询 + * @param userId 用户编号 + * @return + */ + public List<CtUserole> listByUserId(String userId){ + QueryWrapper<CtUserole> ctUseroleQueryWrapper = new QueryWrapper<>(); + ctUseroleQueryWrapper.eq("user_id", userId); + List<CtUserole> ctUseroleList = mapper.selectList(ctUseroleQueryWrapper); + return ctUseroleList; + } + +} \ No newline at end of file -- Gitblit v1.8.0