1、修改redis配置
2、修改代码生成器
3、修改base依赖
3 files added
87 files modified
| | |
| | | @Value("${jwt.secret-key}") |
| | | private String secretKey; |
| | | |
| | | @Value("${jwt.iss_user.format}") |
| | | @Value("${jwt.iss-user}") |
| | | private String issUser; |
| | | |
| | | @Value("${jwt.auth-skip-urls}") |
| | |
| | | #jwt生成密钥 |
| | | secret-key: asdfghjkl |
| | | #用户 |
| | | iss_user: HUGEINFO |
| | | iss-user: HUGEINFO |
| | | refresh-token-key: |
| | | #refreshToken 存储key |
| | | format: JWT_REFRESH_TOKEN::%s |
| | |
| | | <artifactId>spring-test</artifactId> |
| | | <version>RELEASE</version> |
| | | </dependency> |
| | | <dependency> |
| | | <!-- <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-jpa</artifactId> |
| | | </dependency> |
| | | </dependency> --> |
| | | <!-- spring end --> |
| | | |
| | | <!-- reactor-core --> |
| | |
| | | <!-- mockito测试类 end --> |
| | | |
| | | <!-- Redis --> |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web<#if classPath??>/${classPath}</#if>/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web<#if classPath??>/${classPath}</#if>/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | |
| | | /** |
| | | * 条件查询多个 |
| | | * @url {ctx}/api/v1<#if classPath??>/${classPath}</#if>/listQuery |
| | | * @url {ctx}/api/wechat<#if classPath??>/${classPath}</#if>/listQuery |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/listQuery") |
| | |
| | | |
| | | /** |
| | | * 条件分页查询 |
| | | * @url {ctx}/api/v1<#if classPath??>/${classPath}</#if>/pageQuery |
| | | * @url {ctx}/api/wechat<#if classPath??>/${classPath}</#if>/pageQuery |
| | | * @param page 页码 |
| | | * @param size 每页数量 |
| | | * @return Object |
| | |
| | | |
| | | /** |
| | | * 根据编号查询单个 |
| | | * @url {ctx}/api/v1<#if classPath??>/${classPath}</#if>/getById |
| | | * @url {ctx}/api/wechat<#if classPath??>/${classPath}</#if>/getById |
| | | * @param id 主键编号 |
| | | * @return Object |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/v1<#if classPath??>/${classPath}</#if>/removeByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/wechat<#if classPath??>/${classPath}</#if>/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/removeByIds") |
| | | public Object removeByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.deleteById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | |
| | | /** |
| | | * 新增或更新对象 |
| | | * @url {ctx}/api/v1<#if classPath??>/${classPath}</#if>/save${className} |
| | | * @url {ctx}/api/wechat<#if classPath??>/${classPath}</#if>/save${className} |
| | | * @param ${lowerName} 实体对象 |
| | | * @return Object |
| | | */ |
New file |
| | |
| | | package cn.huge.module.config; |
| | | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.connection.RedisConnectionFactory; |
| | | import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; |
| | | import org.springframework.data.redis.serializer.StringRedisSerializer; |
| | | |
| | | import java.time.Duration; |
| | | |
| | | /** |
| | | * @title: MybatisPlus配置 |
| | | * @description: MybatisPlus配置 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2021-11-05 16:51:48 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Configuration |
| | | public class RedisConfig { |
| | | |
| | | @Bean |
| | | public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) { |
| | | // 创建RedisTemplate实例 |
| | | RedisTemplate<String, Object> template = new RedisTemplate<>(); |
| | | // 设置链接工厂 |
| | | template.setConnectionFactory(factory); |
| | | // 设置key和value的序列化方式 |
| | | template.setKeySerializer(new StringRedisSerializer()); |
| | | // 使用GenericJackson2JsonRedisSerializer,反序列化时保留泛型信息 |
| | | template.setValueSerializer(new GenericJackson2JsonRedisSerializer()); |
| | | template.afterPropertiesSet(); |
| | | |
| | | return template; |
| | | } |
| | | } |
| | | /** |
| | | * -------------------_ooOoo_------------------- |
| | | * ------------------o8888888o------------------ |
| | | * ------------------88" . "88------------------ |
| | | * ------------------(| -_- |)------------------ |
| | | * ------------------O\ = /O------------------ |
| | | * ---------------____/`---'\____--------------- |
| | | * -------------.' \\| |// `.------------- |
| | | * ------------/ \\||| : |||// \------------ |
| | | * -----------/ _||||| -:- |||||- \----------- |
| | | * -----------| | \\\ - /// | |----------- |
| | | * -----------| \_| ''\---/'' | |----------- |
| | | * -----------\ .-\__ `-` ___/-. /----------- |
| | | * ---------___`. .' /--.--\ `. . __---------- |
| | | * ------."" '< `.___\_<|>_/___.' >'"".------- |
| | | * -----| | : `- \`.;`\ _ /`;.`/ - ` : | |----- |
| | | * -----\ \ `-. \_ __\ /__ _/ .-` / /----- |
| | | * ======`-.____`-.___\_____/___.-`____.-'====== |
| | | * -------------------`=---=' |
| | | * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| | | * ---------佛祖保佑---hugeinfo---永无BUG---------- |
| | | */ |
| | |
| | | * @description: 角色表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/cRole/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/cRole/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户角色数据权限表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctRoledata/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctRoledata/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户角色菜单权限表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctRolefun/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctRolefun/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctrole.dao.mapper.CRoleMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:33:41 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctrole.dao.mapper.CtRoledataMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:33:41 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctrole.dao.mapper.CtRolefunMapper"> |
| | |
| | | * @description: 角色表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctrole.domain.po.CRole |
| | | */ |
| | |
| | | * @description: 客户角色数据权限表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctrole.domain.po.CtRoledata |
| | | */ |
| | |
| | | * @description: 客户角色菜单权限表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctrole.domain.po.CtRolefun |
| | | */ |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_role") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_roledata") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_rolefun") |
| | |
| | | * @Description 角色表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户角色数据权限表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:33:41 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户角色菜单权限表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:33:41 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @description: 客户用户账号表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:56 |
| | | * @time: 2024-08-19 20:04:18 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctAccount/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctAccount/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户部门表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctDept/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctDept/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户岗位表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctPost/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctPost/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户组织信息表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctUnit/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctUnit/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户用户配岗表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctUsepost/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctUsepost/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户用户表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctUser/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctUser/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 客户用户角色表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/ctUserole/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/ctUserole/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:56 |
| | | * @time: 2024-08-19 20:04:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:56 |
| | | * @time:2024-08-19 20:04:18 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtAccountMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtDeptMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtPostMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtUnitMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtUsepostMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtUserMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:30:57 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.ctuser.dao.mapper.CtUseroleMapper"> |
| | |
| | | * @description: 客户用户账号表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:56 |
| | | * @time: 2024-08-19 20:04:18 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtAccount |
| | | */ |
| | |
| | | * @description: 客户部门表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtDept |
| | | */ |
| | |
| | | * @description: 客户岗位表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtPost |
| | | */ |
| | |
| | | * @description: 客户组织信息表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtUnit |
| | | */ |
| | |
| | | * @description: 客户用户配岗表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtUsepost |
| | | */ |
| | |
| | | * @description: 客户用户表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtUser |
| | | */ |
| | |
| | | * @description: 客户用户角色表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.ctuser.domain.po.CtUserole |
| | | */ |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:56 |
| | | * @time: 2024-08-19 20:04:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_account") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_dept") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_post") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_unit") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_usepost") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_user") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:57 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_ct_userole") |
| | |
| | | * @Description 客户用户账号表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:56 |
| | | * @Time 2024-08-19 20:04:18 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户部门表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户岗位表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户组织信息表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户用户配岗表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户用户表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 客户用户角色表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:57 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @description: 公众用户账号表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/paAccount/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/paAccount/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @description: 公众用户表接口api |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:42 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据主键单个/批量删除 |
| | | * @url {ctx}/api/web/paUser/deleteByIds |
| | | * 根据主键单个 |
| | | * @url {ctx}/api/web/paUser/deleteById |
| | | * @param ids 主键编号 |
| | | * @return Object |
| | | */ |
| | | @GetMapping("/deleteByIds") |
| | | public Object deleteByIds(@RequestParam(value = "ids") String ids) { |
| | | @GetMapping("/deleteById") |
| | | public Object deleteById(@RequestParam(value = "id") String id) { |
| | | try { |
| | | if (ids.indexOf(",") != -1) { |
| | | service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); |
| | | }else{ |
| | | service.removeById(ids); |
| | | } |
| | | service.removeById(id); |
| | | return ReturnSucUtils.getRepInfo(); |
| | | } catch (Exception e) { |
| | | return ReturnFailUtils.getRepInfo(); |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @Description 此处仅涉及复杂SQL操作,务必不要在此再次写单表的CRUD操作,因为mybatisPlus已经实现。 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:42 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Repository |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:33:41 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.pauser.dao.mapper.PaAccountMapper"> |
| | |
| | | * @description: 自定义sql,请自行实现业务逻辑 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time:2024-08-17 15:33:42 |
| | | * @time:2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | --> |
| | | <mapper namespace="cn.huge.module.pauser.dao.mapper.PaUserMapper"> |
| | |
| | | * @description: 公众用户账号表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.pauser.domain.po.PaAccount |
| | | */ |
| | |
| | | * @description: 公众用户表业务扩展类 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:42 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version: 1.0.0 |
| | | * @see cn.huge.module.pauser.domain.po.PaUser |
| | | */ |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:41 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_pa_account") |
| | |
| | | * @description: PO中的属性与数据表是一一对应关系,如需根据业务处理不同,请使用BO对象。 |
| | | * @company:hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:33:42 |
| | | * @time: 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @TableName(value = "dyh_pa_user") |
| | |
| | | * @Description 公众用户账号表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:33:41 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
| | |
| | | * @Description 公众用户表业务逻辑处理 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:33:42 |
| | | * @Time 2024-08-19 20:04:19 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Slf4j |
New file |
| | |
| | | package cn.huge.module.redis.controller; |
| | | |
| | | import cn.huge.base.common.utils.ReturnSucUtils; |
| | | import cn.huge.module.redis.service.RedisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * @title: redis简单测试 |
| | | * @description: redis简单测试 |
| | | * @company: hugeinfo |
| | | * @author: liyj |
| | | * @time: 2024-08-17 15:30:56 |
| | | * @version: 1.0.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/api/redis/test") |
| | | public class RedisTestController { |
| | | |
| | | @Autowired(required = false) |
| | | private HttpServletRequest request; |
| | | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | |
| | | /** |
| | | * 作用: 处理 HTTP POST 请求,设置 Redis 中的键值对 |
| | | * 1.使用 @RequestParam 注解获取请求参数 key 和 value |
| | | * 2.调用 redisService.setValue(key, value) 方法,将 key 和 value 存储到 Redis 中 |
| | | * 3.返回一个简单的字符串 "Value set" 作为响应 |
| | | * 请求:POST /set?key=myKey&value=myValue |
| | | * 响应:"Value set" |
| | | * RequestParam注解:获取请求参数: 它从 HTTP 请求中获取参数,并将这些参数绑定到控制器方法的参数上 |
| | | * @url {ctx}/api/redis/test/setValue?key=&value= |
| | | */ |
| | | @GetMapping("/setValue") |
| | | public Object setValue(@RequestParam String key, @RequestParam String value) { |
| | | redisService.setValue(key, value); |
| | | return ReturnSucUtils.getRepInfo("Value:(" + key + ") set"); |
| | | } |
| | | |
| | | /** |
| | | * 作用: 处理 HTTP GET 请求,从 Redis 中获取指定键的值 |
| | | * 1.使用 @RequestParam 注解获取请求参数 key |
| | | * 2.调用 redisService.getValue(key) 方法,从 Redis 中获取 key 对应的值,并将结果转换为 String 类型 |
| | | * 3.返回获取的值 |
| | | * 请求:GET /get?key=myKey |
| | | * 响应:"myValue" // Redis 中对应 `myKey` 的值 |
| | | * @url {ctx}/api/redis/test/getValue?key= |
| | | */ |
| | | @GetMapping("/getValue") |
| | | public Object getValue(@RequestParam String key) { |
| | | return ReturnSucUtils.getRepInfo(redisService.getValue(key)); |
| | | } |
| | | |
| | | /** |
| | | * 作用: 处理 HTTP POST 请求,删除 Redis 中指定键的值 |
| | | * 1.使用 @RequestParam 注解获取请求参数 key |
| | | * 2.调用 redisService.deleteValue(key) 方法,从 Redis 中删除 key 对应的键值对 |
| | | * 3.返回一个简单的字符串 "Value deleted" 作为响应 |
| | | * 请求:POST /delete?key=myKey |
| | | * 响应:"Value deleted" |
| | | * @url {ctx}/api/redis/test/deleteValue?key= |
| | | */ |
| | | @GetMapping("/deleteValue") |
| | | public Object deleteValue(@RequestParam String key) { |
| | | redisService.deleteValue(key); |
| | | return ReturnSucUtils.getRepInfo("Value:(" + key + ") deleted"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.huge.module.redis.service; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * @title: RedisService 类提供了简化的 Redis 操作接口,用于在 Spring Boot 应用中存储和检索数据。 |
| | | * @Description 它通过 RedisTemplate 与 Redis 服务器交互,执行常见的操作如设置值、获取值、设置值带过期时间和删除值。 |
| | | * @company hugeinfo |
| | | * @author liyj |
| | | * @Time 2024-08-17 15:30:56 |
| | | * @version 1.0.0 |
| | | */ |
| | | @Service |
| | | public class RedisService { |
| | | |
| | | /** |
| | | * 意义: RedisTemplate 是 Spring 提供的一个 Redis 操作模板,它抽象了 Redis 的底层访问, |
| | | * 使开发者可以用 Java 对象操作 Redis。使用 @Autowired 注解,Spring 自动将配置好的 RedisTemplate 注入到 RedisService 类中 |
| | | */ |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | /** |
| | | * 向 Redis 中存储一个键值对 |
| | | * @param key |
| | | * @param value |
| | | */ |
| | | public void setValue(String key, Object value) { |
| | | redisTemplate.opsForValue().set(key, value); |
| | | } |
| | | |
| | | /** |
| | | * 从 Redis 中获取指定键的值 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public Object getValue(String key) { |
| | | return redisTemplate.opsForValue().get(key); |
| | | } |
| | | |
| | | /** |
| | | * 向 Redis 中存储一个键值对,并设置其过期时间 |
| | | * @param key |
| | | * @param value |
| | | * @param timeout |
| | | * @param timeUnit |
| | | */ |
| | | public void setValueWithExpiry(String key, Object value, long timeout, TimeUnit timeUnit) { |
| | | redisTemplate.opsForValue().set(key, value, timeout, timeUnit); |
| | | } |
| | | |
| | | /** |
| | | * 从 Redis 中删除指定键及其对应的值 |
| | | * @param key |
| | | */ |
| | | public void deleteValue(String key) { |
| | | redisTemplate.delete(key); |
| | | } |
| | | } |
| | |
| | | secretKey = secret_Key; |
| | | } |
| | | |
| | | @Value("${jwt.iss_user}") |
| | | @Value("${jwt.iss-user}") |
| | | public void setIssUser(String iss_user) { |
| | | issUser = iss_user; |
| | | } |
| | |
| | | # 用来验证数据库连接是否仍然可用的 SQL 查询 |
| | | validation-query: SELECT 1 |
| | | |
| | | # redis配置,单机版,集群另外配置 |
| | | redis: |
| | | host: 183.2.142.21 |
| | | port: 9017 |
| | | password: hugeinfo123 |
| | | # 使用的Redis数据库索引(默认为0) |
| | | database: 0 |
| | | # 连接超时时间(毫秒) |
| | | timeout: 5000 |
| | | lettuce: |
| | | pool: |
| | | # 连接池最大连接数 |
| | | max-active: 100 |
| | | # 连接池最大阻塞等待时间 |
| | | max-wait: 100000 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 10 |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | |
| | | #注册中心配置 |
| | | eureka: |
| | | client: |
| | |
| | | # 用来验证数据库连接是否仍然可用的 SQL 查询 |
| | | validation-query: SELECT 1 |
| | | |
| | | # redis配置,单机版,集群另外配置 |
| | | redis: |
| | | host: 183.2.142.21 |
| | | port: 9017 |
| | | password: hugeinfo123 |
| | | # 使用的Redis数据库索引(默认为0) |
| | | database: 0 |
| | | # 连接超时时间(毫秒) |
| | | timeout: 5000 |
| | | lettuce: |
| | | pool: |
| | | # 连接池最大连接数 |
| | | max-active: 100 |
| | | # 连接池最大阻塞等待时间 |
| | | max-wait: 100000 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 10 |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | |
| | | #注册中心配置 |
| | | eureka: |
| | | client: |
| | |
| | | # 用来验证数据库连接是否仍然可用的 SQL 查询 |
| | | validation-query: SELECT 1 |
| | | |
| | | # redis配置,单机版,集群另外配置 |
| | | redis: |
| | | host: 183.2.142.21 |
| | | port: 9017 |
| | | password: hugeinfo123 |
| | | # 使用的Redis数据库索引(默认为0) |
| | | database: 0 |
| | | # 连接超时时间(毫秒) |
| | | timeout: 5000 |
| | | lettuce: |
| | | pool: |
| | | # 连接池最大连接数 |
| | | max-active: 100 |
| | | # 连接池最大阻塞等待时间 |
| | | max-wait: 100000 |
| | | # 连接池中的最大空闲连接 |
| | | max-idle: 10 |
| | | # 连接池中的最小空闲连接 |
| | | min-idle: 0 |
| | | |
| | | #注册中心配置 |
| | | eureka: |
| | | client: |
| | |
| | | #jwt生成密钥 |
| | | secret-key: asdfghjkl |
| | | #用户 |
| | | iss_user: HUGEINFO |
| | | iss-user: HUGEINFO |
| | | refresh-token-key: |
| | | #refreshToken 存储key |
| | | format: JWT_REFRESH_TOKEN::%s |
| | |
| | | </encoder> |
| | | </appender> |
| | | |
| | | <!-- 为 MyBatis 设置 DEBUG 级别的日志 --> |
| | | <logger name="org.apache.ibatis" level="DEBUG"/> |
| | | <!-- 输出 SQL 语句和参数 --> |
| | | <logger name="org.apache.ibatis.binding" level="DEBUG"/> |
| | | <!-- 输出 SQL 语句执行情况 --> |
| | | <logger name="org.apache.ibatis.session" level="DEBUG"/> |
| | | <!-- 输出 SQL 语句执行结果 --> |
| | | <logger name="org.apache.ibatis.executor" level="DEBUG"/> |
| | | <!-- 输出 SQL 语句 --> |
| | | <logger name="org.apache.ibatis.scripting" level="DEBUG"/> |
| | | |
| | | <!-- 设置根日志级别,如果日志级别低于设置的级别,则该日志不会被记录。如果日志级别高于设置的级别,那么这条日志将会被记录 --> |
| | | <root level="DEBUG"> |
| | | <root level="INFO"> |
| | | <appender-ref ref="CONSOLE" /> |
| | | </root> |
| | | |
| | | <!-- 为 MyBatis 设置 DEBUG 级别的日志 --> |
| | | <logger name="com.baomidou.mybatisplus" level="INFO" additivity="false"> |
| | | <appender-ref ref="CONSOLE" /> |
| | | </logger> |
| | | </springProfile> |
| | | |
| | | <!-- 测试环境+生产环境,多个使用逗号隔开 --> |
| | |
| | | |
| | | @Test |
| | | public void buildAllTest() { |
| | | service.buildAll(basePackage, packageName, className, tableSchema, tableName, author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtAccount", tableSchema, "dyh_ct_account", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtDept", tableSchema, "dyh_ct_dept", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtPost", tableSchema, "dyh_ct_post", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtUnit", tableSchema, "dyh_ct_unit", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtUsepost", tableSchema, "dyh_ct_usepost", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtUser", tableSchema, "dyh_ct_user", author, version); |
| | | service.buildAll(basePackage, "ctuser", "CtUserole", tableSchema, "dyh_ct_userole", author, version); |
| | | |
| | | service.buildAll(basePackage, "ctrole", "CRole", tableSchema, "dyh_ct_role", author, version); |
| | | service.buildAll(basePackage, "ctrole", "CtRoledata", tableSchema, "dyh_ct_roledata", author, version); |
| | | service.buildAll(basePackage, "ctrole", "CtRolefun", tableSchema, "dyh_ct_rolefun", author, version); |
| | | |
| | | service.buildAll(basePackage, "pauser", "PaAccount", tableSchema, "dyh_pa_account", author, version); |
| | | service.buildAll(basePackage, "pauser", "PaUser", tableSchema, "dyh_pa_user", author, version); |
| | | |
| | | } |
| | | |
| | |
| | | package cn.huge.module; |
| | | |
| | | import cn.huge.base.common.utils.JwtUtils; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | |
| | | public class DyhUtilsApplication { |
| | | |
| | | public static void main(String[] args) { |
| | | SpringApplication.run(DyhSyncApplication.class, args); |
| | | SpringApplication.run(DyhUtilsApplication.class, args); |
| | | } |
| | | } |
| | |
| | | package cn.huge.module; |
| | | |
| | | import cn.huge.base.common.utils.JwtUtils; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.boot.test.context.SpringBootTest; |