Commit 0e019ad1 authored by huyuchen's avatar huyuchen

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/SysRoleService.java
#	yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/service/impl/SysRoleServiceImpl.java
parents 6fa63abe c1fabd26
......@@ -40,5 +40,6 @@
<module>yifu-common-security</module>
<module>yifu-common-test</module>
<module>yifu-common-dapr</module>
<module>yifu-common-swagger</module>
</modules>
</project>
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<description>dapr引入</description>
<artifactId>yifu-common-dapr</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
......
<?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">
<parent>
<artifactId>yifu-common</artifactId>
<groupId>com.yifu.cloud.plus.v1</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<description>swagger引入</description>
<artifactId>yifu-common-swagger</artifactId>
<name>yifu-common-swagger</name>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.8</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
package com.yifu.cloud.plus.v1.yifu.admin.config;
package com.yifu.cloud.plus.v1.yifu.common.swagger.config;
import io.swagger.v3.oas.annotations.ExternalDocumentation;
......@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.info.Contact;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import org.springframework.context.annotation.Configuration;
/**
* @author fxj * @date 2022年05月31日 17:29 @description
......@@ -26,6 +27,7 @@ import io.swagger.v3.oas.annotations.security.SecurityScheme;
)
)
@SecurityScheme(type = SecuritySchemeType.HTTP, name = "JWT", scheme = "bearer", in = SecuritySchemeIn.HEADER)
@Configuration
//@SecurityScheme(type = SecuritySchemeType.OAUTH2,flows = @OAuthFlow( implicit = @OAuthFlow(authorizationUrl = "http://yifu-auth/oauth/check_token",
// scopes = @OAuthScope(name = "write:pets", description = "modify pets in your account"))))
public class Swagger3Config {
......
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.common.swagger.config.Swagger3Config
......@@ -26,5 +26,10 @@ public class SysLogDTO {
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTime;
/**
* 日志标题
*/
@Schema(description = "日志标题")
private String title;
}
......@@ -62,9 +62,8 @@
<version>3.0.0</version>
</dependency>-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.8</version>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
......@@ -104,11 +103,7 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-test</artifactId>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-models</artifactId>
<version>2.1.12</version>
</dependency>
</dependencies>
<build>
......
......@@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RestController;
@AllArgsConstructor
@RequestMapping("/app")
@Tag(name = "移动端登录模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class AppController {
private final AppService appService;
......
......@@ -44,7 +44,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/dept")
@Tag(name = "部门管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class DeptController {
private final SysDeptService sysDeptService;
......
......@@ -51,7 +51,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/dict")
@Tag(name = "字典管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class DictController {
private final SysDictItemService sysDictItemService;
......
......@@ -49,7 +49,6 @@ import javax.servlet.http.HttpServletResponse;
@RequiredArgsConstructor
@RequestMapping("/sys-file")
@Tag(name = "文件管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class FileController {
private final SysFileService sysFileService;
......
......@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/log")
@Tag(name = "日志管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class LogController {
private final SysLogService sysLogService;
......
......@@ -43,7 +43,6 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
@RequestMapping("/menu")
@Tag(name = "菜单管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class MenuController {
private final SysMenuService sysMenuService;
......
......@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/client")
@Tag(name = "客户端管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class OauthClientDetailsController {
private final SysOauthClientDetailsService sysOauthClientDetailsService;
......
......@@ -45,7 +45,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/post")
@Tag(name = "岗位管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class PostController {
private final SysPostService sysPostService;
......
......@@ -42,7 +42,6 @@ import org.springframework.web.bind.annotation.*;
@RequiredArgsConstructor
@RequestMapping("/param")
@Tag(name = "公共参数配置")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class PublicParamController {
private final SysPublicParamService sysPublicParamService;
......
......@@ -21,7 +21,6 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/register")
@RequiredArgsConstructor
@ConditionalOnProperty(name = "register.user", matchIfMissing = true)
public class RegisterController {
private final SysUserService userService;
......
......@@ -47,7 +47,6 @@ import java.util.List;
@RequiredArgsConstructor
@RequestMapping("/role")
@Tag(name = "角色管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class RoleController {
private final SysRoleService sysRoleService;
......@@ -116,8 +115,8 @@ public class RoleController {
* @return 分页对象
*/
@GetMapping("/page")
public R<IPage<SysRole>> getRolePage(Page page) {
return R.ok(sysRoleService.page(page, Wrappers.emptyWrapper()));
public R<IPage<SysRole>> getRolePage(Page page, SysRole sysRole) {
return R.ok(sysRoleService.getSysRoleByPage(page, sysRole));
}
/**
......
......@@ -34,7 +34,6 @@ import java.util.Map;
@RequiredArgsConstructor
@RequestMapping("/token")
@Tag(name = "令牌管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TokenController {
//private final RemoteTokenService remoteTokenService;
......
......@@ -56,8 +56,6 @@ import java.util.Set;
@RestController
@RequiredArgsConstructor
@RequestMapping("/user")
@Tag(name = "用户管理模块")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class UserController {
private final SysUserService userService;
......
......@@ -16,6 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO;
......@@ -55,6 +56,7 @@ public interface SysRoleService extends IService<SysRole> {
*/
List<RoleExcelVO> listRole();
Page<SysRole> getSysRoleByPage(Page page, SysRole sysRole);
/**
* 更新角色信息
* @param sysRole
......
......@@ -66,7 +66,9 @@ public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> impleme
if (StrUtil.isNotBlank(sysLog.getType())) {
wrapper.eq(SysLog::getType, sysLog.getType());
}
if (StrUtil.isNotBlank(sysLog.getTitle())){
wrapper.likeRight(SysLog::getTitle,sysLog.getTitle());
}
if (ArrayUtil.isNotEmpty(sysLog.getCreateTime())) {
wrapper.ge(SysLog::getCreateTime, sysLog.getCreateTime()[0]).le(SysLog::getCreateTime,
sysLog.getCreateTime()[1]);
......
......@@ -18,9 +18,13 @@ package com.yifu.cloud.plus.v1.yifu.admin.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDict;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRole;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysRoleMenu;
import com.yifu.cloud.plus.v1.yifu.admin.api.vo.RoleExcelVO;
......@@ -33,7 +37,6 @@ import com.yifu.cloud.plus.v1.yifu.common.core.exception.ErrorCodes;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.MsgUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
......@@ -134,6 +137,23 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
}).collect(Collectors.toList());
}
@Override
public Page<SysRole> getSysRoleByPage(Page page, SysRole sysRole) {
return baseMapper.selectPage(page, buildQueryWrapper(sysRole));
}
/**
* 构建查询的 wrapper
* @param sysRole 查询条件
* @return LambdaQueryWrapper
*/
private LambdaQueryWrapper buildQueryWrapper(SysRole sysRole) {
LambdaQueryWrapper<SysRole> wrapper = Wrappers.lambdaQuery();
if (StrUtil.isNotBlank(sysRole.getRoleName())){
wrapper.likeRight(SysRole::getRoleName,sysRole.getRoleName());
}
return wrapper;
}
/**
* 插入excel Role
*/
......
......@@ -93,8 +93,8 @@ spring:
activate:
on-profile: test
redis:
host: 192.168.1.65
port: 22379
host: 127.0.0.1
port: 6379
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
......
......@@ -32,20 +32,20 @@
<dependencies>
<!--接口文档-->
<!-- <dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>-->
</dependency>
<!--注册中心客户端-->
<dependency>
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependency>-->
<!--配置中心客户端-->
<dependency>
<!--<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
</dependency>-->
<!--断路器依赖-->
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
......
......@@ -20,7 +20,6 @@ import com.yifu.cloud.plus.v1.yifu.common.datasource.annotation.EnableDynamicDat
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author lengleng
......@@ -29,7 +28,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
//@EnableYifuDoc
@EnableDynamicDataSource
//@EnableYifuFeignClients
@EnableDiscoveryClient
//@EnableDiscoveryClient
@SpringBootApplication
@EnableYifuResourceServer
public class YifuCodeGenApplication {
......
# 加解密根密码
jasypt:
encryptor:
password: pig #根密码
## spring security 配置
security:
oauth2:
......@@ -5,14 +9,26 @@ security:
client-id: ENC(27v1agvAug87ANOVnbKdsw==)
client-secret: ENC(VbnkopxrwgbFVKp+UxJ2pg==)
scope: server
resource:
loadBalanced: true
token-info-uri: http://yifu-auth/oauth/check_token
ignore: # 通用放行URL,服务个性化,请在对应配置文件覆盖
urls:
- /v3/api-docs
- /actuator/**
# 数据源配置
spring:
config:
activate:
on-profile: dev
redis:
host: 127.0.0.1
password: '@yf_2017'
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: uf_zsk
password: yf_zsk
url: jdbc:mysql://192.168.1.65:22306/yifu_codegen?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
web:
resources:
......@@ -23,3 +39,24 @@ ignore:
urls:
- /v2/api-docs
- /actuator/**
springdoc:
api-docs:
#是否开启文档功能
enabled: true
#swagger后端请求地址
path: /api-docs
swagger-ui:
#自定义swagger前端请求路径,输入http:127.0.0.1:8080/test会自动重定向到swagger页面
path: /api/codegen
#包扫描路径
packages-to-scan: com.yifu.cloud.plus.v1.yifu.codegen.controller
#这里定义了两个分组,可定义多个,也可以不定义
group-configs:
#分组名
#- group: admin
#按路径匹配
# pathsToMatch: /admin/**
#分组名
- group: codegen
#按包路径匹配
packagesToScan: com.yifu.cloud.plus.v1.yifu.codegen.controller
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment