初始化
This commit is contained in:
parent
e54b6ec6ba
commit
15214180fa
|
|
@ -80,30 +80,64 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<annotationProcessorPaths>
|
|
||||||
<path>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</path>
|
|
||||||
</annotationProcessorPaths>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<skip>true</skip>
|
||||||
<exclude>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-dependencies</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||||
|
<excludeGroupIds>${project.groupId}</excludeGroupIds>
|
||||||
|
<includeScope>runtime</includeScope>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
<mainClass>com.nflg.wms.admin.AdminApplication</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactSet>
|
||||||
|
<includes>
|
||||||
|
<include>${project.groupId}:*</include>
|
||||||
|
</includes>
|
||||||
|
</artifactSet>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package com.nflg.wms.admin.service;
|
package com.nflg.wms.admin.service;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.github.promeg.pinyinhelper.Pinyin;
|
import com.github.promeg.pinyinhelper.Pinyin;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
|
||||||
import com.nflg.wms.common.pojo.qo.*;
|
import com.nflg.wms.common.pojo.qo.*;
|
||||||
import com.nflg.wms.common.pojo.vo.RoleVO;
|
import com.nflg.wms.common.pojo.vo.RoleVO;
|
||||||
import com.nflg.wms.common.pojo.vo.UserVO;
|
import com.nflg.wms.common.pojo.vo.UserVO;
|
||||||
|
|
@ -45,7 +45,7 @@ public class RoleControllerService {
|
||||||
roleService.update(request, UserUtil.getUserName());
|
roleService.update(request, UserUtil.getUserName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public PageData<RoleVO> searchRoles(RoleSearchQO request) {
|
public IPage<RoleVO> searchRoles(RoleSearchQO request) {
|
||||||
return roleService.search(request);
|
return roleService.search(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
server:
|
server:
|
||||||
port: 8002
|
port: 8102
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: nflg-wms-admin
|
name: admin
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
config:
|
config:
|
||||||
|
|
|
||||||
|
|
@ -83,30 +83,64 @@
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<annotationProcessorPaths>
|
|
||||||
<path>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</path>
|
|
||||||
</annotationProcessorPaths>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<skip>true</skip>
|
||||||
<exclude>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
</exclude>
|
|
||||||
</excludes>
|
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-dependencies</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-dependencies</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||||
|
<excludeGroupIds>${project.groupId}</excludeGroupIds>
|
||||||
|
<includeScope>runtime</includeScope>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
<mainClass>com.nflg.wms.auth.AuthApplication</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<artifactSet>
|
||||||
|
<includes>
|
||||||
|
<include>${project.groupId}:*</include>
|
||||||
|
</includes>
|
||||||
|
</artifactSet>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
server:
|
server:
|
||||||
port: 8001
|
port: 8101
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: nflg-wms-user
|
name: auth
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
config:
|
config:
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
<!-- 文件日志配置 -->
|
<!-- 文件日志配置 -->
|
||||||
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>${logDir}/nflg-wms-user.log</file>
|
<file>${logDir}/nflg-wms-auth.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
<!-- 按天滚动日志并按大小拆分 -->
|
<!-- 按天滚动日志并按大小拆分 -->
|
||||||
<fileNamePattern>${logDir}/%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
<fileNamePattern>${logDir}/%d{yyyy-MM-dd}.%i.log</fileNamePattern>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.nflg.wms.common.pojo;
|
package com.nflg.wms.common.pojo;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.nflg.wms.common.constant.STATE;
|
import com.nflg.wms.common.constant.STATE;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -85,4 +86,9 @@ public class ApiResult<T> implements Serializable {
|
||||||
vo.setResult(pageData);
|
vo.setResult(pageData);
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return JSONUtil.toJsonStr(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -29,10 +29,14 @@
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>-->
|
<dependency>
|
||||||
<!-- <groupId>com.alibaba.cloud</groupId>-->
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>-->
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
<!-- </dependency>-->
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
|
@ -59,7 +63,6 @@
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>commons-pool2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
|
@ -70,33 +73,71 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<configuration>
|
<executions>
|
||||||
<annotationProcessorPaths>
|
<execution>
|
||||||
<path>
|
<id>copy-dependencies</id>
|
||||||
<groupId>org.projectlombok</groupId>
|
<phase>package</phase>
|
||||||
<artifactId>lombok</artifactId>
|
<goals>
|
||||||
</path>
|
<goal>copy-dependencies</goal>
|
||||||
</annotationProcessorPaths>
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
||||||
|
<excludeGroupIds>${project.groupId}</excludeGroupIds>
|
||||||
|
<includeScope>runtime</includeScope>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
<mainClass>com.nflg.wms.gateway.GateWayApplication</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<configuration>
|
<executions>
|
||||||
<excludes>
|
<execution>
|
||||||
<exclude>
|
<phase>package</phase>
|
||||||
<groupId>org.projectlombok</groupId>
|
<goals>
|
||||||
<artifactId>lombok</artifactId>
|
<goal>shade</goal>
|
||||||
</exclude>
|
</goals>
|
||||||
</excludes>
|
<configuration>
|
||||||
</configuration>
|
<artifactSet>
|
||||||
|
<includes>
|
||||||
|
<include>${project.groupId}:*</include>
|
||||||
|
</includes>
|
||||||
|
</artifactSet>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.nflg.wms.gateway;
|
package com.nflg.wms.gateway;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
@ -10,7 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@ComponentScan(basePackages = {"com.nflg.wms.gateway","com.nflg.wms.repository"})
|
@ComponentScan(basePackages = {"com.nflg.wms.gateway","com.nflg.wms.repository"})
|
||||||
//@MapperScan("com.nflg.wms.repository.mapper")
|
@EnableDiscoveryClient
|
||||||
public class GateWayApplication {
|
public class GateWayApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,10 @@ import cn.dev33.satoken.reactor.filter.SaReactorFilter;
|
||||||
import cn.dev33.satoken.router.SaRouter;
|
import cn.dev33.satoken.router.SaRouter;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import com.nflg.wms.common.constant.STATE;
|
import com.nflg.wms.common.constant.STATE;
|
||||||
|
import com.nflg.wms.common.exception.NflgException;
|
||||||
import com.nflg.wms.common.pojo.ApiResult;
|
import com.nflg.wms.common.pojo.ApiResult;
|
||||||
import com.nflg.wms.common.util.VUtil;
|
import com.nflg.wms.common.util.VUtil;
|
||||||
import com.nflg.wms.gateway.AuthService;
|
import com.nflg.wms.gateway.service.AuthService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
@ -25,32 +26,33 @@ public class SaTokenConfigure {
|
||||||
public SaReactorFilter getSaReactorFilter(AuthService authService) {
|
public SaReactorFilter getSaReactorFilter(AuthService authService) {
|
||||||
return new SaReactorFilter()
|
return new SaReactorFilter()
|
||||||
// 拦截地址
|
// 拦截地址
|
||||||
.addInclude("/**") /* 拦截全部path */
|
.addInclude("/**")
|
||||||
// 开放地址
|
// 开放地址
|
||||||
// .addExclude("/favicon.ico")
|
// .addExclude("/favicon.ico")
|
||||||
// 鉴权方法:每次访问进入
|
// 鉴权方法:每次访问进入
|
||||||
.setAuth(obj -> {
|
.setAuth(obj -> {
|
||||||
// 登录校验 -- 拦截所有路由
|
// 登录校验 -- 拦截所有路由
|
||||||
SaRouter.match("/**", "/auth/**", r -> {
|
SaRouter.match("/**")
|
||||||
String currentUrl = SaHolder.getRequest().getUrl();
|
.notMatch("/auth/**", "/actuator/**")
|
||||||
log.info("当前鉴权地址:{}", currentUrl);
|
.check(r -> {
|
||||||
if (!StpUtil.isLogin()){
|
String currentUrl = SaHolder.getRequest().getRequestPath();
|
||||||
log.warn("用户未登录");
|
log.info("当前鉴权地址:{}", currentUrl);
|
||||||
return;
|
VUtil.trueThrow(!StpUtil.isLogin()).throwMessage(STATE.LoginError, "请重新登录");
|
||||||
}
|
long userId = StpUtil.getLoginIdAsLong();
|
||||||
long userId = StpUtil.getLoginIdAsLong();
|
log.info("用户ID:{}", userId);
|
||||||
log.info("用户ID:{}", userId);
|
// VUtil.trueThrow(!authService.hasPermission(userId, currentUrl))
|
||||||
VUtil.trueThrow(!authService.hasPermission(userId, currentUrl))
|
// .throwMessage(STATE.PermissionDenied, "没有访问权限");
|
||||||
.throwMessage(STATE.PermissionDenied, "没有访问权限");
|
log.info("鉴权通过");
|
||||||
log.info("鉴权通过");
|
});
|
||||||
});
|
|
||||||
|
|
||||||
// 权限认证 -- 不同模块, 校验不同权限
|
|
||||||
// SaRouter.match("/admin/**", r -> StpUtil.checkPermission("admin"));
|
|
||||||
|
|
||||||
// 更多匹配 ... */
|
|
||||||
})
|
})
|
||||||
// 异常处理方法:每次setAuth函数出现异常时进入
|
// 异常处理方法:每次setAuth函数出现异常时进入
|
||||||
.setError(e -> ApiResult.error(e.getMessage()));
|
.setError(e -> {
|
||||||
|
SaHolder.getResponse().addHeader("Content-Type", "application/json;charset=UTF-8");
|
||||||
|
if (e instanceof NflgException ex) {
|
||||||
|
return ApiResult.error(ex.getState(), ex.getMessage());
|
||||||
|
} else {
|
||||||
|
return ApiResult.error(e.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.nflg.wms.gateway;
|
package com.nflg.wms.gateway.service;
|
||||||
|
|
||||||
import com.nflg.wms.repository.service.IUserService;
|
import com.nflg.wms.repository.service.IUserService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
server:
|
server:
|
||||||
port: 8000
|
port: 8100
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: nflg-wms-gateway
|
name: gateway
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: dev
|
||||||
config:
|
config:
|
||||||
|
|
@ -13,6 +13,22 @@ spring:
|
||||||
server-addr: ${nacos.server-addr:112.74.186.154:8848}
|
server-addr: ${nacos.server-addr:112.74.186.154:8848}
|
||||||
namespace: wms
|
namespace: wms
|
||||||
group: ${spring.profiles.active}
|
group: ${spring.profiles.active}
|
||||||
|
discovery:
|
||||||
|
server-addr: ${nacos.server-addr:112.74.186.154:8848}
|
||||||
|
namespace: wms
|
||||||
|
group: ${spring.profiles.active}
|
||||||
|
gateway:
|
||||||
|
discovery:
|
||||||
|
locator:
|
||||||
|
enabled: true
|
||||||
|
lower-case-service-id: true
|
||||||
|
loadbalancer:
|
||||||
|
enabled: true
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
root: warn
|
root: warn
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
exposure:
|
||||||
|
include: "*"
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package com.nflg.wms.repository.mapper;
|
package com.nflg.wms.repository.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
|
||||||
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
||||||
import com.nflg.wms.common.pojo.vo.RoleVO;
|
import com.nflg.wms.common.pojo.vo.RoleVO;
|
||||||
import com.nflg.wms.repository.entity.Role;
|
import com.nflg.wms.repository.entity.Role;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -17,5 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
*/
|
*/
|
||||||
public interface RoleMapper extends BaseMapper<Role> {
|
public interface RoleMapper extends BaseMapper<Role> {
|
||||||
|
|
||||||
PageData<RoleVO> search(RoleSearchQO request, Page<?> objectPage);
|
IPage<RoleVO> search(RoleSearchQO request, Page<?> objectPage);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.nflg.wms.repository.service;
|
package com.nflg.wms.repository.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
|
||||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||||
import com.nflg.wms.common.pojo.qo.RoleAddQO;
|
import com.nflg.wms.common.pojo.qo.RoleAddQO;
|
||||||
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
||||||
|
|
@ -25,7 +25,7 @@ public interface IRoleService extends IService<Role> {
|
||||||
|
|
||||||
void update(@Valid RoleUpdateQO request, @NotBlank String userName);
|
void update(@Valid RoleUpdateQO request, @NotBlank String userName);
|
||||||
|
|
||||||
PageData<RoleVO> search(@Valid RoleSearchQO request);
|
IPage<RoleVO> search(@Valid RoleSearchQO request);
|
||||||
|
|
||||||
void enable(@Valid EnableQO request, String userName);
|
void enable(@Valid EnableQO request, String userName);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package com.nflg.wms.repository.service.impl;
|
package com.nflg.wms.repository.service.impl;
|
||||||
|
|
||||||
import cn.hutool.extra.cglib.CglibUtil;
|
import cn.hutool.extra.cglib.CglibUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.wms.common.pojo.PageData;
|
|
||||||
import com.nflg.wms.common.pojo.qo.EnableQO;
|
import com.nflg.wms.common.pojo.qo.EnableQO;
|
||||||
import com.nflg.wms.common.pojo.qo.RoleAddQO;
|
import com.nflg.wms.common.pojo.qo.RoleAddQO;
|
||||||
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
import com.nflg.wms.common.pojo.qo.RoleSearchQO;
|
||||||
|
|
@ -64,7 +64,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IR
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageData<RoleVO> search(RoleSearchQO request) {
|
public IPage<RoleVO> search(RoleSearchQO request) {
|
||||||
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
return baseMapper.search(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,8 @@
|
||||||
<mapper namespace="com.nflg.wms.repository.mapper.RoleMapper">
|
<mapper namespace="com.nflg.wms.repository.mapper.RoleMapper">
|
||||||
|
|
||||||
<select id="search" resultType="com.nflg.wms.common.pojo.vo.RoleVO">
|
<select id="search" resultType="com.nflg.wms.common.pojo.vo.RoleVO">
|
||||||
SELECT id,code,name,enable,create_by AS 'createBy',create_time AS 'createTime',update_by AS 'updateBy'
|
SELECT *
|
||||||
,update_time AS 'updateTime'
|
FROM role
|
||||||
FROM admin_role
|
|
||||||
<where>
|
<where>
|
||||||
<if test="request.name != null and request.name != ''">
|
<if test="request.name != null and request.name != ''">
|
||||||
AND name LIKE CONCAT('%',#{request.name},'%')
|
AND name LIKE CONCAT('%',#{request.name},'%')
|
||||||
|
|
|
||||||
20
pom.xml
20
pom.xml
|
|
@ -38,6 +38,7 @@
|
||||||
<postgresql.version>42.7.5</postgresql.version>
|
<postgresql.version>42.7.5</postgresql.version>
|
||||||
<oss.version>3.17.4</oss.version>
|
<oss.version>3.17.4</oss.version>
|
||||||
<minio.version>8.5.17</minio.version>
|
<minio.version>8.5.17</minio.version>
|
||||||
|
<spring-boot-starter-actuator.version>3.4.0</spring-boot-starter-actuator.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
@ -125,6 +126,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
<version>${spring-boot-starter-actuator.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun.oss</groupId>
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
|
@ -168,6 +170,24 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.6.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue