Compare commits
No commits in common. "master" and "dev-sky-serve-v1" have entirely different histories.
master
...
dev-sky-se
15
pom.xml
15
pom.xml
|
@ -9,15 +9,19 @@
|
||||||
<version>2.7.3</version>
|
<version>2.7.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.sky</groupId>
|
<groupId>com.sky</groupId>
|
||||||
<artifactId>sky-take-out</artifactId>
|
<artifactId>dev-sky-serve-v1</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>sky-common</module>
|
<module>sky-common</module>
|
||||||
<module>sky-pojo</module>
|
<module>sky-pojo</module>
|
||||||
<module>sky-server</module>
|
<module>sky-server</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<maven.compiler.source>18</maven.compiler.source>
|
||||||
|
<maven.compiler.target>18</maven.compiler.target>
|
||||||
<mybatis.spring>2.2.0</mybatis.spring>
|
<mybatis.spring>2.2.0</mybatis.spring>
|
||||||
<lombok>1.18.20</lombok>
|
<lombok>1.18.20</lombok>
|
||||||
<fastjson>1.2.76</fastjson>
|
<fastjson>1.2.76</fastjson>
|
||||||
|
@ -25,11 +29,12 @@
|
||||||
<druid>1.2.1</druid>
|
<druid>1.2.1</druid>
|
||||||
<pagehelper>1.3.0</pagehelper>
|
<pagehelper>1.3.0</pagehelper>
|
||||||
<aliyun.sdk.oss>3.10.2</aliyun.sdk.oss>
|
<aliyun.sdk.oss>3.10.2</aliyun.sdk.oss>
|
||||||
<knife4j>3.0.2</knife4j>
|
<knife4j>3.0.3</knife4j>
|
||||||
<aspectj>1.9.4</aspectj>
|
<aspectj>1.9.4</aspectj>
|
||||||
<jjwt>0.9.1</jjwt>
|
<jjwt>0.9.1</jjwt>
|
||||||
<jaxb-api>2.3.1</jaxb-api>
|
<jaxb-api>2.3.1</jaxb-api>
|
||||||
<poi>3.16</poi>
|
<poi>3.16</poi>
|
||||||
|
<minio>8.4.3</minio>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -122,6 +127,12 @@
|
||||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||||
<version>0.4.8</version>
|
<version>0.4.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- minio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
<version>${minio}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,14 +1,22 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>sky-take-out</artifactId>
|
|
||||||
<groupId>com.sky</groupId>
|
<groupId>com.sky</groupId>
|
||||||
|
<artifactId>dev-sky-serve-v1</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>sky-common</artifactId>
|
<artifactId>sky-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
@ -30,6 +38,11 @@
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt</artifactId>
|
<artifactId>jjwt</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- redis -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
<!--支持配置属性类,yml文件中可以提示配置项-->
|
<!--支持配置属性类,yml文件中可以提示配置项-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -49,5 +62,20 @@
|
||||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- minio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.minio</groupId>
|
||||||
|
<artifactId>minio</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- websocket -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.sky.common.config;
|
||||||
|
|
||||||
|
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import springfox.documentation.builders.ApiInfoBuilder;
|
||||||
|
import springfox.documentation.builders.PathSelectors;
|
||||||
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||||
|
import springfox.documentation.service.ApiInfo;
|
||||||
|
import springfox.documentation.service.Contact;
|
||||||
|
import springfox.documentation.spi.DocumentationType;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
@EnableKnife4j
|
||||||
|
public class Knife4jConfiguration {
|
||||||
|
/**
|
||||||
|
* 通过knife4j生成接口文档
|
||||||
|
* 管理端接口
|
||||||
|
*
|
||||||
|
* @return Docket
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Docket docketAdmin() {
|
||||||
|
log.info("A管理端接口");
|
||||||
|
|
||||||
|
// 添加作者
|
||||||
|
Contact contact = new Contact("Bunny", "1319900154@qq.com", "1319900154@qq.com");
|
||||||
|
// API文档
|
||||||
|
ApiInfo apiInfo = new ApiInfoBuilder().title("苍穹外卖项目接口文档").version("2.0").description("苍穹外卖项目接口文档").contact(contact).build();
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2).groupName("A管理端接口")
|
||||||
|
.apiInfo(apiInfo).select().apis(RequestHandlerSelectors.basePackage("com.sky.controller.admin"))
|
||||||
|
.paths(PathSelectors.any()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket docketUser() {
|
||||||
|
log.info("B用户端接口");
|
||||||
|
|
||||||
|
ApiInfo apiInfo = new ApiInfoBuilder().title("苍穹外卖项目接口文档").version("2.0").description("苍穹外卖项目接口文档").build();
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2).groupName("B用户端接口")
|
||||||
|
.apiInfo(apiInfo).select().apis(RequestHandlerSelectors.basePackage("com.sky.controller.user"))
|
||||||
|
.paths(PathSelectors.any()).build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Docket docketNotify() {
|
||||||
|
log.info("Pay支付接口");
|
||||||
|
|
||||||
|
ApiInfo apiInfo = new ApiInfoBuilder().title("苍穹外卖项目接口文档").version("2.0").description("苍穹外卖项目接口文档").build();
|
||||||
|
return new Docket(DocumentationType.SWAGGER_2).groupName("Pay支付接口")
|
||||||
|
.apiInfo(apiInfo).select().apis(RequestHandlerSelectors.basePackage("com.sky.controller.notify"))
|
||||||
|
.paths(PathSelectors.any()).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.config;
|
package com.sky.common.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||||
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
import com.fasterxml.jackson.annotation.PropertyAccessor;
|
||||||
|
@ -19,7 +19,10 @@ import org.springframework.data.redis.cache.RedisCacheManager;
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.serializer.*;
|
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
|
||||||
|
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
|
||||||
|
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||||
|
import org.springframework.data.redis.serializer.StringRedisSerializer;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
@ -32,9 +35,9 @@ public class RedisConfiguration {
|
||||||
* 使用StringRedisSerializer序列化为字符串
|
* 使用StringRedisSerializer序列化为字符串
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public RedisTemplate<String, Object> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) {
|
public RedisTemplate<Object, Object> redisTemplate(LettuceConnectionFactory connectionFactory) {
|
||||||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
|
||||||
redisTemplate.setConnectionFactory(lettuceConnectionFactory);
|
redisTemplate.setConnectionFactory(connectionFactory);
|
||||||
// 设置key序列化为string
|
// 设置key序列化为string
|
||||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||||
// 设置value序列化为JSON,使用GenericJackson2JsonRedisSerializer替换默认序列化
|
// 设置value序列化为JSON,使用GenericJackson2JsonRedisSerializer替换默认序列化
|
||||||
|
@ -51,14 +54,14 @@ public class RedisConfiguration {
|
||||||
@Bean
|
@Bean
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public CacheManager cacheManager(RedisConnectionFactory factory) {
|
public CacheManager cacheManager(RedisConnectionFactory factory) {
|
||||||
RedisSerializer<String> redisSerializer = new StringRedisSerializer();
|
StringRedisSerializer redisSerializer = new StringRedisSerializer();
|
||||||
// json序列化
|
// json序列化
|
||||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = getJackson2JsonRedisSerializer();
|
Jackson2JsonRedisSerializer<Object> serializer = jsonRedisSerializer();
|
||||||
// 配置序列化
|
// 配置序列化
|
||||||
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig();
|
RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig();
|
||||||
RedisCacheConfiguration redisCacheConfiguration = config
|
RedisCacheConfiguration redisCacheConfiguration = config
|
||||||
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer))
|
.serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer))
|
||||||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(jackson2JsonRedisSerializer));
|
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(serializer));
|
||||||
|
|
||||||
RedisCacheManager cacheManager = RedisCacheManager.builder(factory)
|
RedisCacheManager cacheManager = RedisCacheManager.builder(factory)
|
||||||
.cacheDefaults(redisCacheConfiguration).build();
|
.cacheDefaults(redisCacheConfiguration).build();
|
||||||
|
@ -68,26 +71,25 @@ public class RedisConfiguration {
|
||||||
/**
|
/**
|
||||||
* 指定的日期模式
|
* 指定的日期模式
|
||||||
*/
|
*/
|
||||||
private Jackson2JsonRedisSerializer<Object> getJackson2JsonRedisSerializer() {
|
public Jackson2JsonRedisSerializer<Object> jsonRedisSerializer() {
|
||||||
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
|
Jackson2JsonRedisSerializer<Object> serializer = new Jackson2JsonRedisSerializer<>(Object.class);
|
||||||
ObjectMapper om = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
// 设置ObjectMapper访问权限
|
// 设置ObjectMapper访问权限
|
||||||
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
|
||||||
// 记录序列化之后的数据类型,方便反序列化
|
// 记录序列化之后的数据类型,方便反序列化
|
||||||
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance,
|
mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL);
|
||||||
ObjectMapper.DefaultTyping.NON_FINAL);
|
|
||||||
|
|
||||||
// LocalDatetime序列化,默认不兼容jdk8日期序列化
|
// LocalDatetime序列化,默认不兼容jdk8日期序列化
|
||||||
JavaTimeModule timeModule = new JavaTimeModule();
|
JavaTimeModule timeModule = new JavaTimeModule();
|
||||||
timeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
timeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||||
timeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
||||||
timeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
timeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||||
|
|
||||||
|
timeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
timeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
timeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
// 关闭默认的日期格式化方式,默认UTC日期格式 yyyy-MM-dd’T’HH:mm:ss.SSS
|
// 关闭默认的日期格式化方式,默认UTC日期格式 yyyy-MM-dd’T’HH:mm:ss.SSS
|
||||||
om.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||||
om.registerModule(timeModule);
|
mapper.registerModule(timeModule);
|
||||||
|
|
||||||
jackson2JsonRedisSerializer.setObjectMapper(om);
|
serializer.setObjectMapper(mapper);
|
||||||
return jackson2JsonRedisSerializer;
|
return serializer;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.sky.common.config;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class RestTemplateConfiguration {
|
||||||
|
@Bean
|
||||||
|
public RestTemplate restTemplate() {
|
||||||
|
log.info("注入restTemplate");
|
||||||
|
return new RestTemplate();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.sky.common.config;
|
||||||
|
|
||||||
|
import com.sky.common.interceptor.JwtTokenAdminInterceptor;
|
||||||
|
import com.sky.common.interceptor.JwtTokenUserInterceptor;
|
||||||
|
import com.sky.common.json.JacksonObjectMapper;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.converter.HttpMessageConverter;
|
||||||
|
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
|
public class WebMvcConfiguration extends WebMvcConfigurationSupport {
|
||||||
|
@Autowired
|
||||||
|
private JwtTokenAdminInterceptor jwtTokenAdminInterceptor;
|
||||||
|
@Autowired
|
||||||
|
private JwtTokenUserInterceptor jwtTokenUserInterceptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册自定义拦截器
|
||||||
|
*
|
||||||
|
* @param registry InterceptorRegistry
|
||||||
|
*/
|
||||||
|
protected void addInterceptors(InterceptorRegistry registry) {
|
||||||
|
log.info("开始注册自定义拦截器...");
|
||||||
|
|
||||||
|
registry.addInterceptor(jwtTokenAdminInterceptor).addPathPatterns("/admin/**")
|
||||||
|
.excludePathPatterns("/admin/employee/login");
|
||||||
|
registry.addInterceptor(jwtTokenUserInterceptor).addPathPatterns("/user/**")
|
||||||
|
.excludePathPatterns("/user/user/login")
|
||||||
|
.excludePathPatterns("/user/shop/status");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展Spring MVC框架的消息转化器
|
||||||
|
*
|
||||||
|
* @param converters 转换器
|
||||||
|
*/
|
||||||
|
protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||||
|
log.info("扩展消息转换器...");
|
||||||
|
|
||||||
|
// 创建一个消息转换器对象
|
||||||
|
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
|
||||||
|
// 需要为消息转换器设置一个对象转换器,对象转换器可以将Java对象序列化为json数据
|
||||||
|
converter.setObjectMapper(new JacksonObjectMapper());
|
||||||
|
// 将自己的消息转化器加入容器中
|
||||||
|
converters.add(0, converter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置静态资源映射
|
||||||
|
*
|
||||||
|
* @param registry ResourceHandlerRegistry
|
||||||
|
*/
|
||||||
|
protected void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||||
|
log.info("设置静态资源映射");
|
||||||
|
registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
||||||
|
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.sky.config;
|
package com.sky.common.config;
|
||||||
|
|
||||||
|
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;
|
||||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||||
|
@ -8,11 +9,11 @@ import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||||
* WebSocket配置类,用于注册WebSocket的Bean
|
* WebSocket配置类,用于注册WebSocket的Bean
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
@Slf4j
|
||||||
public class WebSocketConfiguration {
|
public class WebSocketConfiguration {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ServerEndpointExporter serverEndpointExporter() {
|
public ServerEndpointExporter serverEndpointExporter() {
|
||||||
|
log.info("WebSocket配置类,用于注册WebSocket的Bean");
|
||||||
return new ServerEndpointExporter();
|
return new ServerEndpointExporter();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,12 +1,9 @@
|
||||||
package com.sky.constant;
|
package com.sky.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公共字段自动填充相关常量
|
* 公共字段自动填充相关常量
|
||||||
*/
|
*/
|
||||||
public class AutoFillConstant {
|
public class AutoFillConstant {
|
||||||
/**
|
|
||||||
* 实体类中的方法名称
|
|
||||||
*/
|
|
||||||
public static final String SET_CREATE_TIME = "setCreateTime";
|
public static final String SET_CREATE_TIME = "setCreateTime";
|
||||||
public static final String SET_UPDATE_TIME = "setUpdateTime";
|
public static final String SET_UPDATE_TIME = "setUpdateTime";
|
||||||
public static final String SET_CREATE_USER = "setCreateUser";
|
public static final String SET_CREATE_USER = "setCreateUser";
|
|
@ -1,11 +1,9 @@
|
||||||
package com.sky.constant;
|
package com.sky.common.constant;
|
||||||
|
|
||||||
public class JwtClaimsConstant {
|
public class JwtClaimsConstant {
|
||||||
|
|
||||||
public static final String EMP_ID = "empId";
|
public static final String EMP_ID = "empId";
|
||||||
public static final String USER_ID = "userId";
|
public static final String USER_ID = "userId";
|
||||||
public static final String PHONE = "phone";
|
public static final String PHONE = "phone";
|
||||||
public static final String USERNAME = "username";
|
public static final String USERNAME = "username";
|
||||||
public static final String NAME = "name";
|
public static final String NAME = "name";
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,12 @@
|
||||||
package com.sky.constant;
|
package com.sky.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息提示常量类
|
* 信息提示常量类
|
||||||
*/
|
*/
|
||||||
public class MessageConstant {
|
public class MessageConstant {
|
||||||
|
|
||||||
public static final String PASSWORD_ERROR = "密码错误";
|
public static final String PASSWORD_ERROR = "密码错误";
|
||||||
|
public static final String OLD_PASSWORD_ERROR = "旧密码不匹配";
|
||||||
|
public static final String OLD_PASSWORD_SAME_NEW_PASSWORD = "旧密码与新密码相同";
|
||||||
public static final String ACCOUNT_NOT_FOUND = "账号不存在";
|
public static final String ACCOUNT_NOT_FOUND = "账号不存在";
|
||||||
public static final String ACCOUNT_LOCKED = "账号被锁定";
|
public static final String ACCOUNT_LOCKED = "账号被锁定";
|
||||||
public static final String UNKNOWN_ERROR = "未知错误";
|
public static final String UNKNOWN_ERROR = "未知错误";
|
||||||
|
@ -22,7 +23,9 @@ public class MessageConstant {
|
||||||
public static final String SETMEAL_ON_SALE = "起售中的套餐不能删除";
|
public static final String SETMEAL_ON_SALE = "起售中的套餐不能删除";
|
||||||
public static final String DISH_BE_RELATED_BY_SETMEAL = "当前菜品关联了套餐,不能删除";
|
public static final String DISH_BE_RELATED_BY_SETMEAL = "当前菜品关联了套餐,不能删除";
|
||||||
public static final String ORDER_STATUS_ERROR = "订单状态错误";
|
public static final String ORDER_STATUS_ERROR = "订单状态错误";
|
||||||
|
public static final String ORDER_STATUS_NOT_OP = "订单已被接单或已制作";
|
||||||
public static final String ORDER_NOT_FOUND = "订单不存在";
|
public static final String ORDER_NOT_FOUND = "订单不存在";
|
||||||
|
public static final String ALREADY_EXISTS = "已存在";
|
||||||
public static final String ALREADY_EXISTS = "已存在了";
|
public static final String NOT_SET_STATUS = "请先设置营业状态";
|
||||||
|
public static final String REQUEST_NOT_EMPTY = "请求不为空";
|
||||||
}
|
}
|
|
@ -1,10 +1,9 @@
|
||||||
package com.sky.constant;
|
package com.sky.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码常量
|
* 密码常量
|
||||||
*/
|
*/
|
||||||
public class PasswordConstant {
|
public class PasswordConstant {
|
||||||
|
// 默认密码
|
||||||
public static final String DEFAULT_PASSWORD = "123456";
|
public static final String DEFAULT_PASSWORD = "123456";
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,11 @@
|
||||||
package com.sky.constant;
|
package com.sky.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态常量,启用或者禁用
|
* 状态常量,启用或者禁用
|
||||||
*/
|
*/
|
||||||
public class StatusConstant {
|
public class StatusConstant {
|
||||||
|
//启用为1
|
||||||
//启用
|
|
||||||
public static final Integer ENABLE = 1;
|
public static final Integer ENABLE = 1;
|
||||||
|
//禁用为0
|
||||||
//禁用
|
|
||||||
public static final Integer DISABLE = 0;
|
public static final Integer DISABLE = 0;
|
||||||
}
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.sky.common.context;
|
||||||
|
|
||||||
|
public class BaseContext {
|
||||||
|
public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户id
|
||||||
|
*
|
||||||
|
* @return 用户id
|
||||||
|
*/
|
||||||
|
public static Long getUserId() {
|
||||||
|
return threadLocal.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置用户id
|
||||||
|
* @param userId 用户id
|
||||||
|
*/
|
||||||
|
public static void setUserId(Long userId) {
|
||||||
|
threadLocal.set(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移出当前id
|
||||||
|
*/
|
||||||
|
public static void removeCurrentId() {
|
||||||
|
threadLocal.remove();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.sky.common.enumeration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库操作类型
|
||||||
|
* 使用AutoFill面向切面,设置枚举量
|
||||||
|
*/
|
||||||
|
public enum OperationType {
|
||||||
|
UPDATE,// 更新操作
|
||||||
|
INSERT// 插入操作
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号被锁定异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class AccountLockedException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public AccountLockedException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccountLockedException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("账号被锁定异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号不存在异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class AccountNotFoundException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public AccountNotFoundException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public AccountNotFoundException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("账号不存在异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址信息异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class AddressBookBusinessException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public AddressBookBusinessException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public AddressBookBusinessException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("账号不存在异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class BaseException extends RuntimeException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public BaseException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public BaseException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("业务异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不允许删除异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class DeletionNotAllowedException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public DeletionNotAllowedException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeletionNotAllowedException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("不允许删除异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录失败
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class LoginFailedException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public LoginFailedException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoginFailedException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("登录失败:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单业务异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class OrderBusinessException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public OrderBusinessException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrderBusinessException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("订单业务异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码修改失败异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class PasswordEditFailedException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public PasswordEditFailedException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PasswordEditFailedException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("密码修改失败异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码错误异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class PasswordErrorException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public PasswordErrorException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public PasswordErrorException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("密码错误异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RestTemplateException异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class RestTemplateException extends BaseException {
|
||||||
|
public RestTemplateException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public RestTemplateException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("RestTemplateException异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 套餐启用失败异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class SetMealEnableFailedException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public SetMealEnableFailedException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public SetMealEnableFailedException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("套餐启用失败异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class ShoppingCartBusinessException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public ShoppingCartBusinessException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ShoppingCartBusinessException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("购物车异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.sky.common.exception;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户未登录异常
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
public class UserNotLoginException extends BaseException {
|
||||||
|
/**
|
||||||
|
* Constructs a new runtime exception with {@code null} as its
|
||||||
|
* detail message. The cause is not initialized, and may subsequently be
|
||||||
|
* initialized by a call to {@link #initCause}.
|
||||||
|
*/
|
||||||
|
public UserNotLoginException() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserNotLoginException(String message) {
|
||||||
|
super(message);
|
||||||
|
log.error("用户未登录异常:{}", message);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.sky.common.handler;
|
||||||
|
|
||||||
|
import com.sky.common.constant.MessageConstant;
|
||||||
|
import com.sky.common.exception.BaseException;
|
||||||
|
import com.sky.common.result.Result;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
import java.sql.SQLIntegrityConstraintViolationException;
|
||||||
|
|
||||||
|
@RestControllerAdvice
|
||||||
|
@Slf4j
|
||||||
|
public class GlobalExceptionHandler {
|
||||||
|
// 捕获业务异常
|
||||||
|
@ExceptionHandler
|
||||||
|
public Result<String> exceptionHandler(BaseException exception) {
|
||||||
|
log.error("异常信息:{}", exception.getMessage());
|
||||||
|
return Result.error(exception.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理SQL异常
|
||||||
|
public Result<String> exceptionHandler(SQLIntegrityConstraintViolationException exception) {
|
||||||
|
log.error("处理SQL异常:{}", exception.getMessage());
|
||||||
|
|
||||||
|
String message = exception.getMessage();
|
||||||
|
if (message.contains("Duplicate entry")) {
|
||||||
|
// 截取用户名
|
||||||
|
String username = message.split(" ")[2];
|
||||||
|
// 错误信息
|
||||||
|
String errorMessage = username + MessageConstant.ALREADY_EXISTS;
|
||||||
|
return Result.error(errorMessage);
|
||||||
|
} else {
|
||||||
|
return Result.error(MessageConstant.UNKNOWN_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.sky.common.interceptor;
|
||||||
|
|
||||||
|
import com.sky.common.constant.JwtClaimsConstant;
|
||||||
|
import com.sky.common.context.BaseContext;
|
||||||
|
import com.sky.common.properties.JwtProperties;
|
||||||
|
import com.sky.common.utils.JwtUtil;
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理端用户判断
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class JwtTokenAdminInterceptor implements HandlerInterceptor {
|
||||||
|
private final JwtProperties jwtProperties;
|
||||||
|
|
||||||
|
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, @NotNull Object handler) {
|
||||||
|
// 判断当前兰街道的是Controller的方法还是其它资源
|
||||||
|
if (!(handler instanceof HandlerMethod)) {
|
||||||
|
// 拦截到的不是动态方法,直接放行
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 1. 从请求头中获取令牌
|
||||||
|
String token = request.getHeader(jwtProperties.getAdminTokenName());
|
||||||
|
|
||||||
|
// 2. 拦截令牌
|
||||||
|
log.info("jwt校验:{}", token);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Claims claims = JwtUtil.parseJWT(jwtProperties.getAdminSecretKey(), token);
|
||||||
|
Long empId = Long.valueOf(claims.get(JwtClaimsConstant.EMP_ID).toString());
|
||||||
|
log.info("当前员工ID:{}", empId);
|
||||||
|
// 3. 通过放行
|
||||||
|
BaseContext.setUserId(empId);
|
||||||
|
return true;
|
||||||
|
} catch (Exception exception) {
|
||||||
|
response.setStatus(401);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.sky.common.interceptor;
|
||||||
|
|
||||||
|
import com.sky.common.constant.JwtClaimsConstant;
|
||||||
|
import com.sky.common.context.BaseContext;
|
||||||
|
import com.sky.common.properties.JwtProperties;
|
||||||
|
import com.sky.common.utils.JwtUtil;
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
import lombok.NonNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户端登录判断
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Slf4j
|
||||||
|
public class JwtTokenUserInterceptor implements HandlerInterceptor {
|
||||||
|
private final JwtProperties jwtProperties;
|
||||||
|
|
||||||
|
public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) throws Exception {
|
||||||
|
// 判断当前拦截到的是Controller方法还是其它资源
|
||||||
|
if (!(handler instanceof HandlerMethod)) {
|
||||||
|
// 当前拦截到的不是动态方法,直接放行
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 1. 从请求头中获取令牌
|
||||||
|
String token = request.getHeader(jwtProperties.getUserTokenName());
|
||||||
|
// 2. 校验令牌
|
||||||
|
log.info("jwt校验:{}", token);
|
||||||
|
try {
|
||||||
|
Claims claims = JwtUtil.parseJWT(jwtProperties.getUserSecretKey(), token);
|
||||||
|
Long userId = Long.valueOf(claims.get(JwtClaimsConstant.USER_ID).toString());
|
||||||
|
BaseContext.setUserId(userId);
|
||||||
|
// 放行
|
||||||
|
return true;
|
||||||
|
} catch (Exception exception) {
|
||||||
|
response.setStatus(401);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.sky.json;
|
package com.sky.common.json;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||||
|
@ -18,34 +17,31 @@ import java.time.format.DateTimeFormatter;
|
||||||
import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
|
import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象映射器:基于jackson将Java对象转为json,或者将json转为Java对象
|
* 对象映射器,基于Jackson将Java对象转为JSON,或者将JSON转为Java对象
|
||||||
* 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象]
|
* 将JSON转为Java对象过程--JSON反序列化Java对象
|
||||||
* 从Java对象生成JSON的过程称为 [序列化Java对象到JSON]
|
* 将Java对象转为JSON--序列化Java对象到JSON
|
||||||
*/
|
*/
|
||||||
public class JacksonObjectMapper extends ObjectMapper {
|
public class JacksonObjectMapper extends ObjectMapper {
|
||||||
|
|
||||||
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
|
public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
|
||||||
//public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
// public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||||
public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm";
|
public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm";
|
||||||
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
|
public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
|
||||||
|
|
||||||
public JacksonObjectMapper() {
|
public JacksonObjectMapper() {
|
||||||
super();
|
super();
|
||||||
//收到未知属性时不报异常
|
// 收到未知属性时不报异常
|
||||||
this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
|
this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||||
|
// 反序列化时,属性不存在的兼容处理
|
||||||
|
this.getDeserializationConfig().withoutFeatures(FAIL_ON_UNKNOWN_PROPERTIES);
|
||||||
|
|
||||||
//反序列化时,属性不存在的兼容处理
|
SimpleModule simpleModule = new SimpleModule();
|
||||||
this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
|
simpleModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
|
||||||
|
|
||||||
SimpleModule simpleModule = new SimpleModule()
|
|
||||||
.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
|
|
||||||
.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
|
.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
|
||||||
.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)))
|
.addDeserializer(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)))
|
||||||
.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
|
.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)))
|
||||||
.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
|
.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)))
|
||||||
.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
|
.addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
|
||||||
|
// 注册功能模块 例如,可以添加自定义序列化器和反序列化器
|
||||||
//注册功能模块 例如,可以添加自定义序列化器和反序列化器
|
|
||||||
this.registerModule(simpleModule);
|
this.registerModule(simpleModule);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.properties;
|
package com.sky.common.properties;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
@ -8,7 +8,6 @@ import org.springframework.stereotype.Component;
|
||||||
@ConfigurationProperties(prefix = "sky.jwt")
|
@ConfigurationProperties(prefix = "sky.jwt")
|
||||||
@Data
|
@Data
|
||||||
public class JwtProperties {
|
public class JwtProperties {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理端员工生成jwt令牌相关配置
|
* 管理端员工生成jwt令牌相关配置
|
||||||
*/
|
*/
|
||||||
|
@ -22,5 +21,4 @@ public class JwtProperties {
|
||||||
private String userSecretKey;
|
private String userSecretKey;
|
||||||
private long userTtl;
|
private long userTtl;
|
||||||
private String userTokenName;
|
private String userTokenName;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
package com.sky.config;
|
package com.sky.common.properties;
|
||||||
|
|
||||||
|
import io.minio.MinioClient;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.stereotype.Component;
|
||||||
import io.minio.MinioClient;
|
|
||||||
|
|
||||||
@Data
|
@Component
|
||||||
@Configuration
|
|
||||||
@ConfigurationProperties(prefix = "sky.minio")
|
@ConfigurationProperties(prefix = "sky.minio")
|
||||||
public class MinioConfig {
|
@Data
|
||||||
|
public class MinioProperties {
|
||||||
private String endpointUrl;
|
private String endpointUrl;
|
||||||
private String accessKey;
|
private String accessKey;
|
||||||
private String secretKey;
|
private String secretKey;
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.sky.common.properties;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@ConfigurationProperties(prefix = "sky.wechat")
|
||||||
|
@Data
|
||||||
|
public class WeChatProperties {
|
||||||
|
private String appid; // 小程序的appid
|
||||||
|
private String secret; // 小程序的秘钥
|
||||||
|
private String mchid; // 商户号
|
||||||
|
private String mchSerialNo; // 商户API证书的证书序列号
|
||||||
|
private String privateKeyFilePath; // 商户私钥文件
|
||||||
|
private String apiV3Key; // 证书解密的密钥
|
||||||
|
private String weChatPayCertFilePath; // 平台证书
|
||||||
|
private String notifyUrl; // 支付成功的回调地址
|
||||||
|
private String refundNotifyUrl; // 退款成功的回调地址
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.result;
|
package com.sky.common.result;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -13,10 +13,7 @@ import java.util.List;
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class PageResult implements Serializable {
|
public class PageResult<T> implements Serializable {
|
||||||
|
private long total; // 总记录数
|
||||||
private long total; //总记录数
|
private List<T> records; // 当前页数据集合
|
||||||
|
|
||||||
private List records; //当前页数据集合
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.sky.common.result;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 后端统一返回结果
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Result<T> implements Serializable {
|
||||||
|
private Integer code; // 编码:1成功,0和其它数字为失败
|
||||||
|
private String message; // 错误信息
|
||||||
|
private T data; // 数据
|
||||||
|
|
||||||
|
// 成功
|
||||||
|
public static <T> Result<T> success() {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.code = 1;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 有数据返回
|
||||||
|
public static <T> Result<T> success(T object) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.data = object;
|
||||||
|
result.code = 1;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 错误返回
|
||||||
|
public static <T> Result<T> error(String message) {
|
||||||
|
Result<T> result = new Result<>();
|
||||||
|
result.message = message;
|
||||||
|
result.code = 0;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.utils;
|
package com.sky.common.utils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import org.apache.http.NameValuePair;
|
import org.apache.http.NameValuePair;
|
||||||
|
@ -25,43 +25,40 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public class HttpClientUtil {
|
public class HttpClientUtil {
|
||||||
|
|
||||||
static final int TIMEOUT_MSEC = 5 * 1000;
|
static final int TIMEOUT_MSEC = 5 * 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送GET方式请求
|
* 发送GET方式请求
|
||||||
* @param url
|
|
||||||
* @param paramMap
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public static String doGet(String url,Map<String,String> paramMap){
|
public static String doGet(String url, Map<String, String> paramMap) {
|
||||||
// 创建Httpclient对象
|
// 创建Httpclient对象
|
||||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
|
||||||
String result = "";
|
String result = "";
|
||||||
CloseableHttpResponse response = null;
|
CloseableHttpResponse response = null;
|
||||||
|
|
||||||
try{
|
try {
|
||||||
URIBuilder builder = new URIBuilder(url);
|
URIBuilder builder = new URIBuilder(url);
|
||||||
if(paramMap != null){
|
if (paramMap != null) {
|
||||||
for (String key : paramMap.keySet()) {
|
for (String key : paramMap.keySet()) {
|
||||||
builder.addParameter(key,paramMap.get(key));
|
builder.addParameter(key, paramMap.get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
URI uri = builder.build();
|
URI uri = builder.build();
|
||||||
|
|
||||||
//创建GET请求
|
// 创建GET请求
|
||||||
HttpGet httpGet = new HttpGet(uri);
|
HttpGet httpGet = new HttpGet(uri);
|
||||||
|
|
||||||
//发送请求
|
// 发送请求
|
||||||
response = httpClient.execute(httpGet);
|
response = httpClient.execute(httpGet);
|
||||||
|
|
||||||
//判断响应状态
|
// 判断响应状态
|
||||||
if(response.getStatusLine().getStatusCode() == 200){
|
if (response.getStatusLine().getStatusCode() == 200) {
|
||||||
result = EntityUtils.toString(response.getEntity(),"UTF-8");
|
result = EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
response.close();
|
response.close();
|
||||||
httpClient.close();
|
httpClient.close();
|
||||||
|
@ -75,10 +72,6 @@ public class HttpClientUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送POST方式请求
|
* 发送POST方式请求
|
||||||
* @param url
|
|
||||||
* @param paramMap
|
|
||||||
* @return
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
*/
|
||||||
public static String doPost(String url, Map<String, String> paramMap) throws IOException {
|
public static String doPost(String url, Map<String, String> paramMap) throws IOException {
|
||||||
// 创建Httpclient对象
|
// 创建Httpclient对象
|
||||||
|
@ -122,10 +115,6 @@ public class HttpClientUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送POST方式请求
|
* 发送POST方式请求
|
||||||
* @param url
|
|
||||||
* @param paramMap
|
|
||||||
* @return
|
|
||||||
* @throws IOException
|
|
||||||
*/
|
*/
|
||||||
public static String doPost4Json(String url, Map<String, String> paramMap) throws IOException {
|
public static String doPost4Json(String url, Map<String, String> paramMap) throws IOException {
|
||||||
// 创建Httpclient对象
|
// 创建Httpclient对象
|
||||||
|
@ -138,15 +127,15 @@ public class HttpClientUtil {
|
||||||
HttpPost httpPost = new HttpPost(url);
|
HttpPost httpPost = new HttpPost(url);
|
||||||
|
|
||||||
if (paramMap != null) {
|
if (paramMap != null) {
|
||||||
//构造json格式数据
|
// 构造json格式数据
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
for (Map.Entry<String, String> param : paramMap.entrySet()) {
|
for (Map.Entry<String, String> param : paramMap.entrySet()) {
|
||||||
jsonObject.put(param.getKey(),param.getValue());
|
jsonObject.put(param.getKey(), param.getValue());
|
||||||
}
|
}
|
||||||
StringEntity entity = new StringEntity(jsonObject.toString(),"utf-8");
|
StringEntity entity = new StringEntity(jsonObject.toString(), "utf-8");
|
||||||
//设置请求编码
|
// 设置请求编码
|
||||||
entity.setContentEncoding("utf-8");
|
entity.setContentEncoding("utf-8");
|
||||||
//设置数据类型
|
// 设置数据类型
|
||||||
entity.setContentType("application/json");
|
entity.setContentType("application/json");
|
||||||
httpPost.setEntity(entity);
|
httpPost.setEntity(entity);
|
||||||
}
|
}
|
||||||
|
@ -169,11 +158,11 @@ public class HttpClientUtil {
|
||||||
|
|
||||||
return resultString;
|
return resultString;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RequestConfig builderRequestConfig() {
|
private static RequestConfig builderRequestConfig() {
|
||||||
return RequestConfig.custom()
|
return RequestConfig.custom()
|
||||||
.setConnectTimeout(TIMEOUT_MSEC)
|
.setConnectTimeout(TIMEOUT_MSEC)
|
||||||
.setConnectionRequestTimeout(TIMEOUT_MSEC)
|
.setConnectionRequestTimeout(TIMEOUT_MSEC)
|
||||||
.setSocketTimeout(TIMEOUT_MSEC).build();
|
.setSocketTimeout(TIMEOUT_MSEC).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,58 +1,52 @@
|
||||||
package com.sky.utils;
|
package com.sky.common.utils;
|
||||||
|
|
||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
import io.jsonwebtoken.JwtBuilder;
|
import io.jsonwebtoken.JwtBuilder;
|
||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
import io.jsonwebtoken.SignatureAlgorithm;
|
import io.jsonwebtoken.SignatureAlgorithm;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class JwtUtil {
|
public class JwtUtil {
|
||||||
/**
|
/**
|
||||||
* 生成jwt
|
* 生成JWT
|
||||||
* 使用Hs256算法, 私匙使用固定秘钥
|
* 使用Hs256算法, 私匙使用固定秘钥
|
||||||
*
|
|
||||||
* @param secretKey jwt秘钥
|
* @param secretKey jwt秘钥
|
||||||
* @param ttlMillis jwt过期时间(毫秒)
|
* @param ttlMillis jwt过期时间(毫秒)
|
||||||
* @param claims 设置的信息
|
* @param claims 设置的信息
|
||||||
* @return
|
* @return 加密后JWT
|
||||||
*/
|
*/
|
||||||
public static String createJWT(String secretKey, long ttlMillis, Map<String, Object> claims) {
|
public static String createJWT(String secretKey, long ttlMillis, Map<String, Object> claims) {
|
||||||
// 指定签名的时候使用的签名算法,也就是header那部分
|
// 指定签名的时候使用的签名算法,也就是header那部分
|
||||||
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
|
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
|
||||||
|
|
||||||
// 生成JWT的时间
|
// 生成JWT的时间
|
||||||
long expMillis = System.currentTimeMillis() + ttlMillis;
|
long expMillis = System.currentTimeMillis() + ttlMillis;
|
||||||
Date exp = new Date(expMillis);
|
Date date = new Date(expMillis);
|
||||||
|
|
||||||
// 设置jwt的body
|
|
||||||
JwtBuilder builder = Jwts.builder()
|
JwtBuilder builder = Jwts.builder()
|
||||||
// 如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
|
// 如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
|
||||||
.setClaims(claims)
|
.setClaims(claims)
|
||||||
// 设置签名使用的签名算法和签名使用的秘钥
|
// 设置签名使用的签名算法和签名使用的秘钥
|
||||||
.signWith(signatureAlgorithm, secretKey.getBytes(StandardCharsets.UTF_8))
|
.signWith(signatureAlgorithm, secretKey.getBytes(StandardCharsets.UTF_8))
|
||||||
// 设置过期时间
|
// 设置过期时间
|
||||||
.setExpiration(exp);
|
.setExpiration(date);
|
||||||
|
|
||||||
return builder.compact();
|
return builder.compact();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Token解密
|
* Token解密
|
||||||
*
|
* @param secretKey jwt秘钥
|
||||||
* @param secretKey jwt秘钥 此秘钥一定要保留好在服务端, 不能暴露出去, 否则sign就可以被伪造, 如果对接多个客户端建议改造成多个
|
* @param token token
|
||||||
* @param token 加密后的token
|
* @return 解密后数据
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public static Claims parseJWT(String secretKey, String token) {
|
public static Claims parseJWT(String secretKey, String token) {
|
||||||
// 得到DefaultJwtParser
|
// 得到DefaultJwtParser
|
||||||
Claims claims = Jwts.parser()
|
return Jwts.parser()
|
||||||
// 设置签名的秘钥
|
// 设置签名的秘钥
|
||||||
.setSigningKey(secretKey.getBytes(StandardCharsets.UTF_8))
|
.setSigningKey(secretKey.getBytes(StandardCharsets.UTF_8))
|
||||||
// 设置需要解析的jwt
|
// 设置需要解析的jwt
|
||||||
.parseClaimsJws(token).getBody();
|
.parseClaimsJwt(token).getBody();
|
||||||
return claims;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.sky.common.utils;
|
||||||
|
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
|
||||||
|
public final class MD5 {
|
||||||
|
|
||||||
|
public static String encrypt(String strSrc) {
|
||||||
|
try {
|
||||||
|
char[] hexChars = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||||
|
'9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
|
byte[] bytes = strSrc.getBytes();
|
||||||
|
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||||
|
md.update(bytes);
|
||||||
|
bytes = md.digest();
|
||||||
|
int j = bytes.length;
|
||||||
|
char[] chars = new char[j * 2];
|
||||||
|
int k = 0;
|
||||||
|
for (byte b : bytes) {
|
||||||
|
chars[k++] = hexChars[b >>> 4 & 0xf];
|
||||||
|
chars[k++] = hexChars[b & 0xf];
|
||||||
|
}
|
||||||
|
return new String(chars);
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new RuntimeException("MD5加密出错!!+" + e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println(MD5.encrypt("111111"));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,30 +1,20 @@
|
||||||
package com.sky.utils;
|
package com.sky.common.utils;
|
||||||
|
|
||||||
import com.sky.config.MinioConfig;
|
|
||||||
|
import com.sky.common.properties.MinioProperties;
|
||||||
import io.minio.*;
|
import io.minio.*;
|
||||||
import io.minio.errors.*;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.security.InvalidKeyException;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MinioUtils {
|
public class MinioUtils {
|
||||||
@Resource
|
private final MinioClient minioClient;
|
||||||
private MinioClient minioClient;
|
private final MinioProperties minioProperties;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MinioConfig config;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断桶是否存在
|
* 判断桶是否存在
|
||||||
|
@ -72,7 +62,7 @@ public class MinioUtils {
|
||||||
.object(fileName)
|
.object(fileName)
|
||||||
.stream(inputStream, size, -1)
|
.stream(inputStream, size, -1)
|
||||||
.build());
|
.build());
|
||||||
return config.getEndpointUrl() + "/" + bucketName + "/" + fileName;
|
return minioProperties.getEndpointUrl() + "/" + bucketName + "/" + fileName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
|
@ -95,7 +85,7 @@ public class MinioUtils {
|
||||||
.stream(inputStream, size, -1)
|
.stream(inputStream, size, -1)
|
||||||
.contentType(contentType)
|
.contentType(contentType)
|
||||||
.build());
|
.build());
|
||||||
return config.getEndpointUrl() + "/" + bucketName + "/" + fileName;
|
return minioProperties.getEndpointUrl() + "/" + bucketName + "/" + fileName;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
|
@ -119,4 +109,4 @@ public class MinioUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.sky.common.utils;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RedisUtil {
|
||||||
|
private static final RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
|
||||||
|
|
||||||
|
public static void cleanCache(String key) {
|
||||||
|
Set<Object> keys = redisTemplate.keys(key);
|
||||||
|
if (keys != null) {
|
||||||
|
redisTemplate.delete(keys);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.sky.common.utils;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
|
import org.springframework.http.*;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RestTemplateUtil<T> implements Serializable {
|
||||||
|
private final RestTemplate restTemplate;
|
||||||
|
|
||||||
|
public ResponseEntity<?> requestGet(String url, T t) {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<T> entity = new HttpEntity<T>(t, headers);
|
||||||
|
|
||||||
|
ResponseEntity<?> response = restTemplate.exchange(url, HttpMethod.GET, entity, new ParameterizedTypeReference<T>() {
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.getStatusCode().is2xxSuccessful() ? response : null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
package com.sky.utils;
|
package com.sky.common.utils;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.sky.properties.WeChatProperties;
|
import com.sky.common.context.BaseContext;
|
||||||
|
import com.sky.common.properties.WeChatProperties;
|
||||||
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
|
||||||
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang.RandomStringUtils;
|
import org.apache.commons.lang.RandomStringUtils;
|
||||||
import org.apache.http.HttpHeaders;
|
import org.apache.http.HttpHeaders;
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
@ -14,50 +15,44 @@ import org.apache.http.entity.ContentType;
|
||||||
import org.apache.http.entity.StringEntity;
|
import org.apache.http.entity.StringEntity;
|
||||||
import org.apache.http.impl.client.CloseableHttpClient;
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.security.PrivateKey;
|
import java.security.PrivateKey;
|
||||||
import java.security.Signature;
|
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Collections;
|
||||||
import java.util.Base64;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信支付工具类
|
* 微信支付工具类
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class WeChatPayUtil {
|
public class WeChatPayUtil {
|
||||||
|
// 微信支付下单接口地址
|
||||||
//微信支付下单接口地址
|
|
||||||
public static final String JSAPI = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi";
|
public static final String JSAPI = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi";
|
||||||
|
// 申请退款接口地址
|
||||||
//申请退款接口地址
|
|
||||||
public static final String REFUNDS = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds";
|
public static final String REFUNDS = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds";
|
||||||
|
private final WeChatProperties weChatProperties;
|
||||||
@Autowired
|
|
||||||
private WeChatProperties weChatProperties;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取调用微信接口的客户端工具对象
|
* 获取调用微信接口的客户端工具对象
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private CloseableHttpClient getClient() {
|
private CloseableHttpClient getClient() {
|
||||||
PrivateKey merchantPrivateKey = null;
|
PrivateKey merchantPrivateKey = null;
|
||||||
try {
|
try {
|
||||||
//merchantPrivateKey商户API私钥,如何加载商户API私钥请看常见问题
|
// merchantPrivateKey商户API私钥,如何加载商户API私钥请看常见问题
|
||||||
merchantPrivateKey = PemUtil.loadPrivateKey(new FileInputStream(new File(weChatProperties.getPrivateKeyFilePath())));
|
merchantPrivateKey = PemUtil.loadPrivateKey(new FileInputStream(new File(weChatProperties.getPrivateKeyFilePath())));
|
||||||
//加载平台证书文件
|
// 加载平台证书文件
|
||||||
X509Certificate x509Certificate = PemUtil.loadCertificate(new FileInputStream(new File(weChatProperties.getWeChatPayCertFilePath())));
|
X509Certificate x509Certificate = PemUtil.loadCertificate(new FileInputStream(new File(weChatProperties.getWeChatPayCertFilePath())));
|
||||||
//wechatPayCertificates微信支付平台证书列表。你也可以使用后面章节提到的“定时更新平台证书功能”,而不需要关心平台证书的来龙去脉
|
// wechatPayCertificates微信支付平台证书列表。你也可以使用后面章节提到的“定时更新平台证书功能”,而不需要关心平台证书的来龙去脉
|
||||||
List<X509Certificate> wechatPayCertificates = Arrays.asList(x509Certificate);
|
List<X509Certificate> wechatPayCertificates = Collections.singletonList(x509Certificate);
|
||||||
|
|
||||||
WechatPayHttpClientBuilder builder = WechatPayHttpClientBuilder.create()
|
WechatPayHttpClientBuilder builder = WechatPayHttpClientBuilder.create()
|
||||||
.withMerchant(weChatProperties.getMchid(), weChatProperties.getMchSerialNo(), merchantPrivateKey)
|
.withMerchant(weChatProperties.getMchid(), weChatProperties.getMchSerialNo(), merchantPrivateKey)
|
||||||
|
@ -90,8 +85,7 @@ public class WeChatPayUtil {
|
||||||
|
|
||||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||||
try {
|
try {
|
||||||
String bodyAsString = EntityUtils.toString(response.getEntity());
|
return EntityUtils.toString(response.getEntity());
|
||||||
return bodyAsString;
|
|
||||||
} finally {
|
} finally {
|
||||||
httpClient.close();
|
httpClient.close();
|
||||||
response.close();
|
response.close();
|
||||||
|
@ -114,8 +108,7 @@ public class WeChatPayUtil {
|
||||||
|
|
||||||
CloseableHttpResponse response = httpClient.execute(httpGet);
|
CloseableHttpResponse response = httpClient.execute(httpGet);
|
||||||
try {
|
try {
|
||||||
String bodyAsString = EntityUtils.toString(response.getEntity());
|
return EntityUtils.toString(response.getEntity());
|
||||||
return bodyAsString;
|
|
||||||
} finally {
|
} finally {
|
||||||
httpClient.close();
|
httpClient.close();
|
||||||
response.close();
|
response.close();
|
||||||
|
@ -129,7 +122,6 @@ public class WeChatPayUtil {
|
||||||
* @param total 总金额
|
* @param total 总金额
|
||||||
* @param description 商品描述
|
* @param description 商品描述
|
||||||
* @param openid 微信用户的openid
|
* @param openid 微信用户的openid
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
private String jsapi(String orderNum, BigDecimal total, String description, String openid) throws Exception {
|
private String jsapi(String orderNum, BigDecimal total, String description, String openid) throws Exception {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
@ -140,7 +132,7 @@ public class WeChatPayUtil {
|
||||||
jsonObject.put("notify_url", weChatProperties.getNotifyUrl());
|
jsonObject.put("notify_url", weChatProperties.getNotifyUrl());
|
||||||
|
|
||||||
JSONObject amount = new JSONObject();
|
JSONObject amount = new JSONObject();
|
||||||
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
|
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).intValue());
|
||||||
amount.put("currency", "CNY");
|
amount.put("currency", "CNY");
|
||||||
|
|
||||||
jsonObject.put("amount", amount);
|
jsonObject.put("amount", amount);
|
||||||
|
@ -164,54 +156,52 @@ public class WeChatPayUtil {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JSONObject pay(String orderNum, BigDecimal total, String description, String openid) throws Exception {
|
public JSONObject pay(String orderNum, BigDecimal total, String description, String openid) throws Exception {
|
||||||
//统一下单,生成预支付交易单
|
// 统一下单,生成预支付交易单
|
||||||
String bodyAsString = jsapi(orderNum, total, description, openid);
|
// String bodyAsString = jsapi(orderNum, total, description, openid);
|
||||||
//解析返回结果
|
// 解析返回结果
|
||||||
JSONObject jsonObject = JSON.parseObject(bodyAsString);
|
// JSONObject jsonObject = JSON.parseObject(bodyAsString);
|
||||||
System.out.println(jsonObject);
|
|
||||||
|
|
||||||
String prepayId = jsonObject.getString("prepay_id");
|
// String prepayId = jsonObject.getString("prepay_id");
|
||||||
if (prepayId != null) {
|
String prepayId = "bunny-" + UUID.randomUUID();
|
||||||
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
|
String timeStamp = String.valueOf(System.currentTimeMillis() / 1000);
|
||||||
String nonceStr = RandomStringUtils.randomNumeric(32);
|
String nonceStr = RandomStringUtils.randomNumeric(32);
|
||||||
ArrayList<Object> list = new ArrayList<>();
|
ArrayList<Object> list = new ArrayList<>();
|
||||||
list.add(weChatProperties.getAppid());
|
list.add(weChatProperties.getAppid());
|
||||||
list.add(timeStamp);
|
list.add(timeStamp);
|
||||||
list.add(nonceStr);
|
list.add(nonceStr);
|
||||||
list.add("prepay_id=" + prepayId);
|
list.add("prepay_id=" + prepayId);
|
||||||
//二次签名,调起支付需要重新签名
|
// 二次签名,调起支付需要重新签名
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
// StringBuilder stringBuilder = new StringBuilder();
|
||||||
for (Object o : list) {
|
// for (Object o : list) {
|
||||||
stringBuilder.append(o).append("\n");
|
// stringBuilder.append(o).append("\n");
|
||||||
}
|
// }
|
||||||
String signMessage = stringBuilder.toString();
|
// String signMessage = stringBuilder.toString();
|
||||||
byte[] message = signMessage.getBytes();
|
// byte[] message = signMessage.getBytes();
|
||||||
|
|
||||||
Signature signature = Signature.getInstance("SHA256withRSA");
|
// Signature signature = Signature.getInstance("SHA256withRSA");
|
||||||
signature.initSign(PemUtil.loadPrivateKey(new FileInputStream(new File(weChatProperties.getPrivateKeyFilePath()))));
|
// signature.initSign(PemUtil.loadPrivateKey(Files.newInputStream(new File(weChatProperties.getPrivateKeyFilePath()).toPath())));
|
||||||
signature.update(message);
|
// signature.update(message);
|
||||||
String packageSign = Base64.getEncoder().encodeToString(signature.sign());
|
// String packageSign = Base64.getEncoder().encodeToString(signature.sign());
|
||||||
|
|
||||||
//构造数据给微信小程序,用于调起微信支付
|
// 构造数据给微信小程序,用于调起微信支付
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("timeStamp", timeStamp);
|
jo.put("timeStamp", timeStamp);
|
||||||
jo.put("nonceStr", nonceStr);
|
jo.put("nonceStr", nonceStr);
|
||||||
jo.put("package", "prepay_id=" + prepayId);
|
jo.put("package", "prepay_id=" + prepayId);
|
||||||
jo.put("signType", "RSA");
|
jo.put("signType", "RSA");
|
||||||
jo.put("paySign", packageSign);
|
jo.put("paySign", BaseContext.getUserId() + "-" + prepayId);
|
||||||
|
|
||||||
return jo;
|
return jo;
|
||||||
}
|
// return jsonObject;
|
||||||
return jsonObject;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请退款
|
* 申请退款
|
||||||
*
|
*
|
||||||
* @param outTradeNo 商户订单号
|
* @param outTradeNo 商户订单号
|
||||||
* @param outRefundNo 商户退款单号
|
* @param outRefundNo 商户退款单号
|
||||||
* @param refund 退款金额
|
* @param refund 退款金额
|
||||||
* @param total 原订单金额
|
* @param total 原订单金额
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String refund(String outTradeNo, String outRefundNo, BigDecimal refund, BigDecimal total) throws Exception {
|
public String refund(String outTradeNo, String outRefundNo, BigDecimal refund, BigDecimal total) throws Exception {
|
||||||
|
@ -220,8 +210,8 @@ public class WeChatPayUtil {
|
||||||
jsonObject.put("out_refund_no", outRefundNo);
|
jsonObject.put("out_refund_no", outRefundNo);
|
||||||
|
|
||||||
JSONObject amount = new JSONObject();
|
JSONObject amount = new JSONObject();
|
||||||
amount.put("refund", refund.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
|
amount.put("refund", refund.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).intValue());
|
||||||
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue());
|
amount.put("total", total.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP).intValue());
|
||||||
amount.put("currency", "CNY");
|
amount.put("currency", "CNY");
|
||||||
|
|
||||||
jsonObject.put("amount", amount);
|
jsonObject.put("amount", amount);
|
||||||
|
@ -229,7 +219,7 @@ public class WeChatPayUtil {
|
||||||
|
|
||||||
String body = jsonObject.toJSONString();
|
String body = jsonObject.toJSONString();
|
||||||
|
|
||||||
//调用申请退款接口
|
// 调用申请退款接口
|
||||||
return post(REFUNDS, body);
|
return post(REFUNDS, body);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,19 +0,0 @@
|
||||||
package com.sky.context;
|
|
||||||
|
|
||||||
public class BaseContext {
|
|
||||||
|
|
||||||
public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
|
|
||||||
|
|
||||||
public static void setCurrentId(Long id) {
|
|
||||||
threadLocal.set(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Long getCurrentId() {
|
|
||||||
return threadLocal.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeCurrentId() {
|
|
||||||
threadLocal.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.sky.enumeration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据库操作类型
|
|
||||||
*/
|
|
||||||
public enum OperationType {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新操作
|
|
||||||
*/
|
|
||||||
UPDATE,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 插入操作
|
|
||||||
*/
|
|
||||||
INSERT
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账号被锁定异常
|
|
||||||
*/
|
|
||||||
public class AccountLockedException extends BaseException {
|
|
||||||
|
|
||||||
public AccountLockedException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccountLockedException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账号不存在异常
|
|
||||||
*/
|
|
||||||
public class AccountNotFoundException extends BaseException {
|
|
||||||
|
|
||||||
public AccountNotFoundException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccountNotFoundException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
public class AddressBookBusinessException extends BaseException {
|
|
||||||
|
|
||||||
public AddressBookBusinessException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 业务异常
|
|
||||||
*/
|
|
||||||
public class BaseException extends RuntimeException {
|
|
||||||
|
|
||||||
public BaseException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public BaseException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
public class DeletionNotAllowedException extends BaseException {
|
|
||||||
|
|
||||||
public DeletionNotAllowedException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 登录失败
|
|
||||||
*/
|
|
||||||
public class LoginFailedException extends BaseException{
|
|
||||||
public LoginFailedException(String msg){
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
public class OrderBusinessException extends BaseException {
|
|
||||||
|
|
||||||
public OrderBusinessException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 密码修改失败异常
|
|
||||||
*/
|
|
||||||
public class PasswordEditFailedException extends BaseException{
|
|
||||||
|
|
||||||
public PasswordEditFailedException(String msg){
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 密码错误异常
|
|
||||||
*/
|
|
||||||
public class PasswordErrorException extends BaseException {
|
|
||||||
|
|
||||||
public PasswordErrorException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public PasswordErrorException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 套餐启用失败异常
|
|
||||||
*/
|
|
||||||
public class SetmealEnableFailedException extends BaseException {
|
|
||||||
|
|
||||||
public SetmealEnableFailedException(){}
|
|
||||||
|
|
||||||
public SetmealEnableFailedException(String msg){
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
public class ShoppingCartBusinessException extends BaseException {
|
|
||||||
|
|
||||||
public ShoppingCartBusinessException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
package com.sky.exception;
|
|
||||||
|
|
||||||
public class UserNotLoginException extends BaseException {
|
|
||||||
|
|
||||||
public UserNotLoginException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UserNotLoginException(String msg) {
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.sky.properties;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@ConfigurationProperties(prefix = "sky.alioss")
|
|
||||||
@Data
|
|
||||||
public class AliOssProperties {
|
|
||||||
|
|
||||||
private String endpoint;
|
|
||||||
private String accessKeyId;
|
|
||||||
private String accessKeySecret;
|
|
||||||
private String bucketName;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.sky.properties;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@ConfigurationProperties(prefix = "sky.wechat")
|
|
||||||
@Data
|
|
||||||
public class WeChatProperties {
|
|
||||||
|
|
||||||
private String appid; //小程序的appid
|
|
||||||
private String secret; //小程序的秘钥
|
|
||||||
private String mchid; //商户号
|
|
||||||
private String mchSerialNo; //商户API证书的证书序列号
|
|
||||||
private String privateKeyFilePath; //商户私钥文件
|
|
||||||
private String apiV3Key; //证书解密的密钥
|
|
||||||
private String weChatPayCertFilePath; //平台证书
|
|
||||||
private String notifyUrl; //支付成功的回调地址
|
|
||||||
private String refundNotifyUrl; //退款成功的回调地址
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.sky.result;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 后端统一返回结果
|
|
||||||
* @param <T>
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class Result<T> implements Serializable {
|
|
||||||
|
|
||||||
private Integer code; //编码:1成功,0和其它数字为失败
|
|
||||||
private String msg; //错误信息
|
|
||||||
private T data; //数据
|
|
||||||
|
|
||||||
public static <T> Result<T> success() {
|
|
||||||
Result<T> result = new Result<T>();
|
|
||||||
result.code = 1;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> Result<T> success(T object) {
|
|
||||||
Result<T> result = new Result<T>();
|
|
||||||
result.data = object;
|
|
||||||
result.code = 1;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <T> Result<T> error(String msg) {
|
|
||||||
Result result = new Result();
|
|
||||||
result.msg = msg;
|
|
||||||
result.code = 0;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,68 +0,0 @@
|
||||||
package com.sky.utils;
|
|
||||||
|
|
||||||
import com.aliyun.oss.ClientException;
|
|
||||||
import com.aliyun.oss.OSS;
|
|
||||||
import com.aliyun.oss.OSSClientBuilder;
|
|
||||||
import com.aliyun.oss.OSSException;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@Slf4j
|
|
||||||
public class AliOssUtil {
|
|
||||||
|
|
||||||
private String endpoint;
|
|
||||||
private String accessKeyId;
|
|
||||||
private String accessKeySecret;
|
|
||||||
private String bucketName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 文件上传
|
|
||||||
*
|
|
||||||
* @param bytes
|
|
||||||
* @param objectName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public String upload(byte[] bytes, String objectName) {
|
|
||||||
|
|
||||||
// 创建OSSClient实例。
|
|
||||||
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 创建PutObject请求。
|
|
||||||
ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(bytes));
|
|
||||||
} catch (OSSException oe) {
|
|
||||||
System.out.println("Caught an OSSException, which means your request made it to OSS, "
|
|
||||||
+ "but was rejected with an error response for some reason.");
|
|
||||||
System.out.println("Error Message:" + oe.getErrorMessage());
|
|
||||||
System.out.println("Error Code:" + oe.getErrorCode());
|
|
||||||
System.out.println("Request ID:" + oe.getRequestId());
|
|
||||||
System.out.println("Host ID:" + oe.getHostId());
|
|
||||||
} catch (ClientException ce) {
|
|
||||||
System.out.println("Caught an ClientException, which means the client encountered "
|
|
||||||
+ "a serious internal problem while trying to communicate with OSS, "
|
|
||||||
+ "such as not being able to access the network.");
|
|
||||||
System.out.println("Error Message:" + ce.getMessage());
|
|
||||||
} finally {
|
|
||||||
if (ossClient != null) {
|
|
||||||
ossClient.shutdown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//文件访问路径规则 https://BucketName.Endpoint/ObjectName
|
|
||||||
StringBuilder stringBuilder = new StringBuilder("https://");
|
|
||||||
stringBuilder
|
|
||||||
.append(bucketName)
|
|
||||||
.append(".")
|
|
||||||
.append(endpoint)
|
|
||||||
.append("/")
|
|
||||||
.append(objectName);
|
|
||||||
|
|
||||||
log.info("文件上传到:{}", stringBuilder.toString());
|
|
||||||
|
|
||||||
return stringBuilder.toString();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +1,22 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>sky-take-out</artifactId>
|
|
||||||
<groupId>com.sky</groupId>
|
<groupId>com.sky</groupId>
|
||||||
|
<artifactId>dev-sky-serve-v1</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<artifactId>sky-pojo</artifactId>
|
<artifactId>sky-pojo</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
@ -17,11 +25,11 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.14.0-rc2</version>
|
<version>2.16.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
|
@ -1,22 +0,0 @@
|
||||||
package com.sky.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class CategoryDTO implements Serializable {
|
|
||||||
|
|
||||||
//主键
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
//类型 1 菜品分类 2 套餐分类
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
//分类名称
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
//排序
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.sky.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class CategoryPageQueryDTO implements Serializable {
|
|
||||||
private int page;// 页码
|
|
||||||
private int pageSize;// 每页记录数
|
|
||||||
private String name;// 分类名称
|
|
||||||
private Integer type;//分类类型 1菜品分类 2套餐分类
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.sky.dto;
|
|
||||||
|
|
||||||
import com.sky.entity.Employee;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class EmployeePageQueryDTO implements Serializable {
|
|
||||||
|
|
||||||
//员工姓名
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
//页码
|
|
||||||
private int page;
|
|
||||||
|
|
||||||
//每页显示记录数
|
|
||||||
private int pageSize;
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.sky.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class OrdersConfirmDTO implements Serializable {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
//订单状态 1待付款 2待接单 3 已接单 4 派送中 5 已完成 6 已取消 7 退款
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CategoryDTO implements Serializable {
|
||||||
|
// 主键
|
||||||
|
private Long id;
|
||||||
|
// 类型 1 菜品分类 2 套餐分类
|
||||||
|
private Integer type;
|
||||||
|
// 分类名称
|
||||||
|
private String name;
|
||||||
|
// 排序
|
||||||
|
private Integer sort;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CategoryPageQueryDTO implements Serializable {
|
||||||
|
// 页码
|
||||||
|
private int page;
|
||||||
|
// 每页记录数
|
||||||
|
private int pageSize;
|
||||||
|
// 分类名称
|
||||||
|
private String name;
|
||||||
|
// 分类类型 1菜品分类 2套餐分类
|
||||||
|
private Integer type;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -13,9 +13,6 @@ import java.time.LocalDateTime;
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DataOverViewQueryDTO implements Serializable {
|
public class DataOverViewQueryDTO implements Serializable {
|
||||||
|
|
||||||
private LocalDateTime begin;
|
private LocalDateTime begin;
|
||||||
|
|
||||||
private LocalDateTime end;
|
private LocalDateTime end;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,29 +1,32 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import com.sky.entity.DishFlavor;
|
import com.sky.pojo.entity.DishFlavor;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class DishDTO implements Serializable {
|
public class DishDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
//菜品名称
|
// 菜品名称
|
||||||
private String name;
|
private String name;
|
||||||
//菜品分类id
|
// 菜品分类id
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
//菜品价格
|
// 菜品价格
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
//图片
|
// 图片
|
||||||
private String image;
|
private String image;
|
||||||
//描述信息
|
// 描述信息
|
||||||
private String description;
|
private String description;
|
||||||
//0 停售 1 起售
|
// 0 停售 1 起售
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//口味
|
// 口味
|
||||||
private List<DishFlavor> flavors = new ArrayList<>();
|
private List<DishFlavor> flavors = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,22 +1,20 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class DishPageQueryDTO implements Serializable {
|
public class DishPageQueryDTO implements Serializable {
|
||||||
|
|
||||||
private int page;
|
private int page;
|
||||||
|
|
||||||
private int pageSize;
|
private int pageSize;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
// 分类id
|
||||||
//分类id
|
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
// 状态 0表示禁用 1表示启用
|
||||||
//状态 0表示禁用 1表示启用
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,22 +1,19 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class EmployeeDTO implements Serializable {
|
public class EmployeeDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
||||||
private String idNumber;
|
private String idNumber;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,12 +1,16 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@ApiModel(description = "员工登录时传递的数据模型")
|
@ApiModel(description = "员工登录时传递的数据模型")
|
||||||
public class EmployeeLoginDTO implements Serializable {
|
public class EmployeeLoginDTO implements Serializable {
|
||||||
|
|
||||||
|
@ -15,5 +19,4 @@ public class EmployeeLoginDTO implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("密码")
|
@ApiModelProperty("密码")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EmployeePageQueryDTO implements Serializable {
|
||||||
|
// 员工姓名
|
||||||
|
private String name;
|
||||||
|
// 页码
|
||||||
|
private int page;
|
||||||
|
// 每页显示记录数
|
||||||
|
private int pageSize;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,14 +1,16 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersCancelDTO implements Serializable {
|
public class OrdersCancelDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
//订单取消原因
|
// 订单取消原因
|
||||||
private String cancelReason;
|
private String cancelReason;
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OrdersConfirmDTO implements Serializable {
|
||||||
|
private Long id;
|
||||||
|
// 订单状态 1待付款 2待接单 3 已接单 4 派送中 5 已完成 6 已取消 7 退款
|
||||||
|
private Integer status;
|
||||||
|
}
|
|
@ -1,56 +1,45 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import com.sky.entity.OrderDetail;
|
import com.sky.pojo.entity.OrderDetail;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersDTO implements Serializable {
|
public class OrdersDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
// 订单号
|
||||||
//订单号
|
|
||||||
private String number;
|
private String number;
|
||||||
|
// 订单状态 1待付款,2待派送,3已派送,4已完成,5已取消
|
||||||
//订单状态 1待付款,2待派送,3已派送,4已完成,5已取消
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
// 下单用户id
|
||||||
//下单用户id
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
// 地址id
|
||||||
//地址id
|
|
||||||
private Long addressBookId;
|
private Long addressBookId;
|
||||||
|
// 下单时间
|
||||||
//下单时间
|
|
||||||
private LocalDateTime orderTime;
|
private LocalDateTime orderTime;
|
||||||
|
// 结账时间
|
||||||
//结账时间
|
|
||||||
private LocalDateTime checkoutTime;
|
private LocalDateTime checkoutTime;
|
||||||
|
// 支付方式 1微信,2支付宝
|
||||||
//支付方式 1微信,2支付宝
|
|
||||||
private Integer payMethod;
|
private Integer payMethod;
|
||||||
|
// 实收金额
|
||||||
//实收金额
|
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
|
// 备注
|
||||||
//备注
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
// 用户名
|
||||||
//用户名
|
|
||||||
private String userName;
|
private String userName;
|
||||||
|
// 手机号
|
||||||
//手机号
|
|
||||||
private String phone;
|
private String phone;
|
||||||
|
// 地址
|
||||||
//地址
|
|
||||||
private String address;
|
private String address;
|
||||||
|
// 收货人
|
||||||
//收货人
|
|
||||||
private String consignee;
|
private String consignee;
|
||||||
|
|
||||||
private List<OrderDetail> orderDetails;
|
private List<OrderDetail> orderDetails;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,30 +1,25 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersPageQueryDTO implements Serializable {
|
public class OrdersPageQueryDTO implements Serializable {
|
||||||
|
|
||||||
private int page;
|
private int page;
|
||||||
|
|
||||||
private int pageSize;
|
private int pageSize;
|
||||||
|
|
||||||
private String number;
|
private String number;
|
||||||
|
private String phone;
|
||||||
private String phone;
|
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime beginTime;
|
private LocalDateTime beginTime;
|
||||||
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,17 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersPaymentDTO implements Serializable {
|
public class OrdersPaymentDTO implements Serializable {
|
||||||
//订单号
|
// 订单号
|
||||||
private String orderNumber;
|
private String orderNumber;
|
||||||
|
// 付款方式
|
||||||
//付款方式
|
|
||||||
private Integer payMethod;
|
private Integer payMethod;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,15 +1,16 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersRejectionDTO implements Serializable {
|
public class OrdersRejectionDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
// 订单拒绝原因
|
||||||
//订单拒绝原因
|
|
||||||
private String rejectionReason;
|
private String rejectionReason;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,31 +1,35 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class OrdersSubmitDTO implements Serializable {
|
public class OrdersSubmitDTO implements Serializable {
|
||||||
//地址簿id
|
// 地址簿id
|
||||||
private Long addressBookId;
|
private Long addressBookId;
|
||||||
//付款方式
|
// 付款方式
|
||||||
private int payMethod;
|
private int payMethod;
|
||||||
//备注
|
// 备注
|
||||||
private String remark;
|
private String remark;
|
||||||
//预计送达时间
|
// 预计送达时间
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime estimatedDeliveryTime;
|
private LocalDateTime estimatedDeliveryTime;
|
||||||
//配送状态 1立即送出 0选择具体时间
|
// 配送状态 1立即送出 0选择具体时间
|
||||||
private Integer deliveryStatus;
|
private Integer deliveryStatus;
|
||||||
//餐具数量
|
// 餐具数量
|
||||||
private Integer tablewareNumber;
|
private Integer tablewareNumber;
|
||||||
//餐具数量状态 1按餐量提供 0选择具体数量
|
// 餐具数量状态 1按餐量提供 0选择具体数量
|
||||||
private Integer tablewareStatus;
|
private Integer tablewareStatus;
|
||||||
//打包费
|
// 打包费
|
||||||
private Integer packAmount;
|
private Integer packAmount;
|
||||||
//总金额
|
// 总金额
|
||||||
private BigDecimal amount;
|
private BigDecimal amount;
|
||||||
}
|
}
|
|
@ -1,19 +1,19 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class PasswordEditDTO implements Serializable {
|
public class PasswordEditDTO implements Serializable {
|
||||||
|
// 员工id
|
||||||
//员工id
|
|
||||||
private Long empId;
|
private Long empId;
|
||||||
|
// 旧密码
|
||||||
//旧密码
|
|
||||||
private String oldPassword;
|
private String oldPassword;
|
||||||
|
// 新密码
|
||||||
//新密码
|
|
||||||
private String newPassword;
|
private String newPassword;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,9 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
import com.sky.entity.SetmealDish;
|
import com.sky.pojo.entity.SetmealDish;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -9,8 +11,9 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class SetmealDTO implements Serializable {
|
public class SetmealDTO implements Serializable {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
// 分类id
|
// 分类id
|
||||||
private Long categoryId;
|
private Long categoryId;
|
||||||
|
@ -26,5 +29,4 @@ public class SetmealDTO implements Serializable {
|
||||||
private String image;
|
private String image;
|
||||||
// 套餐菜品关系
|
// 套餐菜品关系
|
||||||
private List<SetmealDish> setmealDishes = new ArrayList<>();
|
private List<SetmealDish> setmealDishes = new ArrayList<>();
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,22 +1,20 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class SetmealPageQueryDTO implements Serializable {
|
public class SetmealPageQueryDTO implements Serializable {
|
||||||
|
|
||||||
private int page;
|
private int page;
|
||||||
|
|
||||||
private int pageSize;
|
private int pageSize;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
// 分类id
|
||||||
//分类id
|
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
// 状态 0表示禁用 1表示启用
|
||||||
//状态 0表示禁用 1表示启用
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,13 +1,16 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class ShoppingCartDTO implements Serializable {
|
public class ShoppingCartDTO implements Serializable {
|
||||||
|
|
||||||
private Long dishId;
|
private Long dishId;
|
||||||
private Long setmealId;
|
private Long setmealId;
|
||||||
private String dishFlavor;
|
private String dishFlavor;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,6 +1,8 @@
|
||||||
package com.sky.dto;
|
package com.sky.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@ -8,8 +10,8 @@ import java.io.Serializable;
|
||||||
* C端用户登录
|
* C端用户登录
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class UserLoginDTO implements Serializable {
|
public class UserLoginDTO implements Serializable {
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BaiduMap {
|
||||||
|
private String address;
|
||||||
|
private String output;
|
||||||
|
private String ak;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,7 +1,9 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.*;
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
@ -30,7 +32,7 @@ public class Employee implements Serializable {
|
||||||
|
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy年MM月dd日 HH:mm:ss")
|
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
//@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ -39,4 +41,6 @@ public class Employee implements Serializable {
|
||||||
private Long createUser;
|
private Long createUser;
|
||||||
|
|
||||||
private Long updateUser;
|
private Long updateUser;
|
||||||
|
private String shopAddress;
|
||||||
|
private String employeeAddress;
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.entity;
|
package com.sky.pojo.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.sky.vo;
|
package com.sky.pojo.vo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue