diff --git a/.idea/GitCommitMessageStorage.xml b/.idea/GitCommitMessageStorage.xml new file mode 100644 index 0000000..3b56900 --- /dev/null +++ b/.idea/GitCommitMessageStorage.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index d33bd31..e67f790 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -2,6 +2,7 @@ + @@ -13,4 +14,12 @@ + + + \ No newline at end of file diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..cd6416c --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,32 @@ + + + + + redis + true + true + jdbc.RedisDriver + jdbc:redis://106.15.251.123:6379/2 + + + + + + + $ProjectFileDir$ + + + mysql.8 + true + true + com.mysql.cj.jdbc.Driver + jdbc:mysql://106.15.251.123:3305/db_spzx?serverTimezone=GMT + + + + + + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..0ebb202 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..4cccdb3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,14 @@ + + + + \ No newline at end of file diff --git a/.idea/prettier.xml b/.idea/prettier.xml new file mode 100644 index 0000000..b0ab31a --- /dev/null +++ b/.idea/prettier.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 12ff7b5..3800150 100644 --- a/pom.xml +++ b/pom.xml @@ -1,25 +1,71 @@ - - 4.0.0 + + + + org.springframework.boot + spring-boot-starter-parent + 3.0.5 + + 4.0.0 - com.atguigu - spzx-parent - 1.0-SNAPSHOT - pom + com.atguigu + spzx-parent + 1.0-SNAPSHOT + pom - spzx-parent - http://maven.apache.org - - spzx-common - spzx-model - spzx-manager - + spzx-parent + https://maven.apache.org + + spzx-common + spzx-model + spzx-manager + - - UTF-8 - + + 17 + 17 + UTF-8 + 8.0.32 + 2.0.21 + 1.18.20 + 3.0.1 + 2.1.0 + - + + + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + ${mybatis.version} + + + + mysql + mysql-connector-java + ${mysql.version} + - + + + com.alibaba + fastjson + ${fastjson.version} + + + + org.projectlombok + lombok + ${lombok.version} + + + + com.github.pagehelper + pagehelper-spring-boot-starter + ${pagehelper.version} + + + diff --git a/spzx-common/common-service/pom.xml b/spzx-common/common-service/pom.xml index 1dd6b65..9d8c274 100644 --- a/spzx-common/common-service/pom.xml +++ b/spzx-common/common-service/pom.xml @@ -1,4 +1,4 @@ - 4.0.0 @@ -11,13 +11,34 @@ jar common-service - http://maven.apache.org + https://maven.apache.org UTF-8 - + + + com.atguigu + spzx-model + 1.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-data-redis + + + com.atguigu + common-util + 1.0-SNAPSHOT + compile + diff --git a/spzx-common/common-service/src/main/java/com/atguigu/App.java b/spzx-common/common-service/src/main/java/com/atguigu/App.java deleted file mode 100644 index 74498e7..0000000 --- a/spzx-common/common-service/src/main/java/com/atguigu/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.atguigu; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/spzx-common/common-service/src/main/java/com/atguigu/config/Knife4jConfig.java b/spzx-common/common-service/src/main/java/com/atguigu/config/Knife4jConfig.java new file mode 100644 index 0000000..9ce03bc --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/config/Knife4jConfig.java @@ -0,0 +1,25 @@ +package com.atguigu.config; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import org.springdoc.core.models.GroupedOpenApi; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class Knife4jConfig { + @Bean + public GroupedOpenApi adminApi() { + return GroupedOpenApi.builder() // 分组名称 + .group("admin请求接口").pathsToMatch("/admin/**") // 接口请求路径规则 + .build(); + } + + @Bean + public OpenAPI customOpenAPI() { + return new OpenAPI().info(new Info().title("尚品甑选API接口文档") + .version("1.0").description("尚品甑选API接口文档") + .contact(new Contact().name("bunny"))); // 设定作者 + } +} \ No newline at end of file diff --git a/spzx-common/common-service/src/main/java/com/atguigu/config/RedisConfiguration.java b/spzx-common/common-service/src/main/java/com/atguigu/config/RedisConfiguration.java new file mode 100644 index 0000000..155eee0 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/config/RedisConfiguration.java @@ -0,0 +1,90 @@ +package com.atguigu.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.cache.RedisCacheManager; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; +import org.springframework.data.redis.serializer.StringRedisSerializer; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; + +@Configuration +@Slf4j +public class RedisConfiguration { + /** + * 使用StringRedisSerializer序列化为字符串 + */ + @Bean + public RedisTemplate redisTemplate(LettuceConnectionFactory factory) { + RedisTemplate redisTemplate = new RedisTemplate<>(); + redisTemplate.setConnectionFactory(factory); + // 设置key序列化为String + redisTemplate.setKeySerializer(new StringRedisSerializer()); + redisTemplate.setHashKeySerializer(new StringRedisSerializer()); + // 设置value序列化为JSON,使用GenericJackson2JsonRedisSerializer替换默认的序列化 + redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer()); + redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer()); + return redisTemplate; + } + + /** + * 解决cache(@Cacheable)把数据缓存到redis中的value是乱码问题 + */ + @Bean + @SuppressWarnings("all") + public CacheManager cacheManager(RedisConnectionFactory factory) { + StringRedisSerializer redisSerializer = new StringRedisSerializer(); + // json序列化 + Jackson2JsonRedisSerializer serializer = jsonRedisSerializer(); + // 配置序列化 + RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig(); + RedisCacheConfiguration redisCacheConfiguration = config + .serializeKeysWith(RedisSerializationContext.SerializationPair.fromSerializer(redisSerializer)) + .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(serializer)); + + return RedisCacheManager.builder(factory).cacheDefaults(redisCacheConfiguration).build(); + } + + /** + * 指定的日期模式 + */ + public Jackson2JsonRedisSerializer jsonRedisSerializer() { + // LocalDatetime序列化,默认不兼容jdk8日期序列化 + JavaTimeModule javaTimeModule = new JavaTimeModule(); + javaTimeModule.addDeserializer(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + javaTimeModule.addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + javaTimeModule.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + javaTimeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + + ObjectMapper mapper = new ObjectMapper(); + // 设置Object访问权限 + mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 记录序列化之后的数据类型,方便反序列化 + mapper.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); + // 关闭默认的日期格式化方式,默认UTC日期格式 yyyy-MM-dd’T’HH:mm:ss.SSS + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.registerModule(javaTimeModule); + + return new Jackson2JsonRedisSerializer<>(mapper, Object.class); + } +} \ No newline at end of file diff --git a/spzx-common/common-service/src/main/java/com/atguigu/config/ResourceConfiguration.java b/spzx-common/common-service/src/main/java/com/atguigu/config/ResourceConfiguration.java new file mode 100644 index 0000000..af41f00 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/config/ResourceConfiguration.java @@ -0,0 +1,15 @@ +package com.atguigu.config; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; + +@Configuration +@Slf4j +public class ResourceConfiguration extends WebMvcConfiguration { + protected void addResourceHandlers(ResourceHandlerRegistry registry) { + log.info("ResourceConfiguration===>设置静态资源映射..."); + registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/"); + registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); + } +} diff --git a/spzx-common/common-service/src/main/java/com/atguigu/config/WebMvcConfiguration.java b/spzx-common/common-service/src/main/java/com/atguigu/config/WebMvcConfiguration.java new file mode 100644 index 0000000..0998452 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/config/WebMvcConfiguration.java @@ -0,0 +1,69 @@ +package com.atguigu.config; + +import com.atguigu.constant.LocalDateTimeConstant; +import com.atguigu.interceptor.LoginAuthInterceptor; +import com.atguigu.json.JacksonObjectMapper; +import com.atguigu.properties.InterceptorsProperties; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; + +import java.text.SimpleDateFormat; +import java.util.List; + +@Component +@Slf4j +public class WebMvcConfiguration extends WebMvcConfigurationSupport { + @Autowired + private LoginAuthInterceptor loginAuthInterceptor; + @Autowired + private InterceptorsProperties interceptorsProperties; + + /** + * * 解决跨域 + * + * @param registry 跨域注册表 + */ + protected void addCorsMappings(CorsRegistry registry) { + log.info("WebMvcConfiguration===>开始跨域注册表..."); + registry.addMapping("/**")// 添加路径规则 + .allowCredentials(true)// 是否允许在跨域的情况下传递Cookie + .allowedOriginPatterns("*")// 允许请求来源的域规则 + .allowedMethods("*").allowedHeaders("*");// 允许所有的请求头 + } + + /** + * 注册自定义拦截器 + * + * @param registry InterceptorRegistry + */ + protected void addInterceptors(InterceptorRegistry registry) { + log.info("WebMvcConfiguration===>开始注册自定义拦截器..."); + // 需要拦截的 + registry.addInterceptor(loginAuthInterceptor).addPathPatterns("/**") + .excludePathPatterns(interceptorsProperties.getNoAuthUrls()); + } + + /** + * 扩展Spring MVC框架的消息转化器 + * + * @param converters 转换器 + */ + public void extendMessageConverters(List> converters) { + log.info("WebMvcConfiguration===>扩展消息转换器..."); + // 创建一个消息转换器对象 + MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); + // 需要为消息转换器设置一个对象转换器,对象转换器可以将Java对象序列化为json数据 + converter.setObjectMapper(new JacksonObjectMapper()); + // 添加条件判断,只应用于特定的请求路径 + converter.getObjectMapper().setDateFormat(new SimpleDateFormat(LocalDateTimeConstant.DEFAULT_DATE_TIME_SECOND_FORMAT)); + + // 将自己的消息转化器加入容器中 + converters.add(converter); + } +} \ No newline at end of file diff --git a/spzx-common/common-service/src/main/java/com/atguigu/exception/BunnyException.java b/spzx-common/common-service/src/main/java/com/atguigu/exception/BunnyException.java new file mode 100644 index 0000000..62732c9 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/exception/BunnyException.java @@ -0,0 +1,33 @@ +package com.atguigu.exception; + +import com.atguigu.spzx.model.vo.result.ResultCodeEnum; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; + +@NoArgsConstructor +@Getter +@ToString +@Slf4j +public class BunnyException extends RuntimeException { + Integer code;// 状态码 + String message;// 描述信息 + + public BunnyException(Integer code, String message) { + super(message); + this.code = code; + this.message = message; + } + + public BunnyException(String message) { + super(message); + this.message = message; + } + + public BunnyException(ResultCodeEnum codeEnum) { + super(codeEnum.getMessage()); + this.code = codeEnum.getCode(); + this.message = codeEnum.getMessage(); + } +} diff --git a/spzx-common/common-service/src/main/java/com/atguigu/handler/GlobalExceptionHandler.java b/spzx-common/common-service/src/main/java/com/atguigu/handler/GlobalExceptionHandler.java new file mode 100644 index 0000000..202e696 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/handler/GlobalExceptionHandler.java @@ -0,0 +1,75 @@ +package com.atguigu.handler; + + +import com.atguigu.constant.MessageConstant; +import com.atguigu.exception.BunnyException; +import com.atguigu.spzx.model.vo.result.Result; +import com.atguigu.spzx.model.vo.result.ResultCodeEnum; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestControllerAdvice; + +import java.nio.file.AccessDeniedException; +import java.sql.SQLIntegrityConstraintViolationException; + +@RestControllerAdvice +@Slf4j +public class GlobalExceptionHandler { + // 自定义异常信息 + @ExceptionHandler(BunnyException.class) + @ResponseBody + public Result exceptionHandler(BunnyException exception) { + log.error("GlobalExceptionHandler===>自定义异常信息:{}", exception.getMessage()); + return Result.error(exception.getCode(), exception.getMessage()); + } + + // 运行时异常信息 + @ExceptionHandler(RuntimeException.class) + @ResponseBody + public Result exceptionHandler(RuntimeException exception) { + log.error("GlobalExceptionHandler===>运行时异常信息:{}", exception.getMessage()); + return Result.error(500, "出错了啦"); + } + + // 捕获系统异常 + @ExceptionHandler(Exception.class) + @ResponseBody + public Result error(Exception exception) { + log.error("GlobalExceptionHandler===>系统异常信息:{}", exception.getMessage()); + return Result.error(exception.getMessage()); + } + + // 特定异常处理 + @ExceptionHandler(ArithmeticException.class) + @ResponseBody + public Result error(ArithmeticException exception) { + log.error("GlobalExceptionHandler===>特定异常信息:{}", exception.getMessage()); + return Result.error(null, exception.getMessage()); + } + + // spring security异常 + @ExceptionHandler(AccessDeniedException.class) + @ResponseBody + public Result error(AccessDeniedException exception) throws AccessDeniedException { + log.error("GlobalExceptionHandler===>spring security异常:{}", exception.getMessage()); + return Result.error(ResultCodeEnum.PERMISSION); + } + + // 处理SQL异常 + @ExceptionHandler(SQLIntegrityConstraintViolationException.class) + @ResponseBody + public Result exceptionHandler(SQLIntegrityConstraintViolationException exception) { + log.error("GlobalExceptionHandler===>处理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(exception.getMessage()); + } else { + return Result.error(MessageConstant.UNKNOWN_ERROR); + } + } +} diff --git a/spzx-common/common-service/src/main/java/com/atguigu/interceptor/LoginAuthInterceptor.java b/spzx-common/common-service/src/main/java/com/atguigu/interceptor/LoginAuthInterceptor.java new file mode 100644 index 0000000..73af3e9 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/interceptor/LoginAuthInterceptor.java @@ -0,0 +1,66 @@ +package com.atguigu.interceptor; + +import com.alibaba.fastjson.JSON; +import com.atguigu.context.BaseContext; +import com.atguigu.spzx.model.entity.system.SysUser; +import com.atguigu.utils.InterceptorUtil; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.lang.NonNull; +import org.springframework.lang.Nullable; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; + +import java.util.concurrent.TimeUnit; + +@Configuration +@Slf4j +public class LoginAuthInterceptor implements HandlerInterceptor { + @Autowired + RedisTemplate redisTemplate; + + @Override + public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) throws Exception { + String method = request.getMethod(); + String token = request.getHeader("token"); + + // 判断当前拦截到的是Controller方法还是其它资源 + if ("OPTIONS".equals(method) || !(handler instanceof HandlerMethod)) return true; + + // 当前token为空 + if (StringUtils.isEmpty(token)) { + InterceptorUtil.unLoginInterceptor(response); + return false; + } + + // 获取用户信息不存在 + String userinfoString = (String) redisTemplate.opsForValue().get(token); + if (StringUtils.isEmpty(userinfoString)) { + InterceptorUtil.unLoginInterceptor(response); + return false; + } + + // 将用户信息放到ThreadLocal中 + SysUser sysUser = JSON.parseObject(userinfoString, SysUser.class); + BaseContext.setSysUser(sysUser); + + // 更新Redis过期时间 + redisTemplate.expire(token, 7, TimeUnit.DAYS); + + // 放行 + return true; + } + + /** + * 请求完成后删除ThreadLocal + */ + @Override + public void afterCompletion(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler, @Nullable Exception ex) throws Exception { + BaseContext.removeSysUser(); + } +} diff --git a/spzx-common/common-service/src/main/java/com/atguigu/utils/InterceptorUtil.java b/spzx-common/common-service/src/main/java/com/atguigu/utils/InterceptorUtil.java new file mode 100644 index 0000000..558b0ac --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/utils/InterceptorUtil.java @@ -0,0 +1,41 @@ +package com.atguigu.utils; + +import com.alibaba.fastjson.JSON; +import com.atguigu.constant.MessageConstant; +import com.atguigu.spzx.model.vo.result.Result; +import jakarta.servlet.http.HttpServletResponse; +import lombok.extern.slf4j.Slf4j; + +import java.io.IOException; + +@Slf4j +public class InterceptorUtil { + /** + * 用户未登录返回响应 + * + * @param response 返回体 + */ + public static void unLoginInterceptor(HttpServletResponse response) throws IOException { + log.warn("InterceptorUtil===>用户未登录"); + customLoginInterceptor(response, MessageConstant.USER_NOT_LOGIN, ""); + } + + /** + * 构建用户登录失败 + * + * @param response HttpServletResponse + * @param message 消息 + * @param data 内容 + */ + public static void customLoginInterceptor(HttpServletResponse response, String message, String data) throws IOException { + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + response.setContentType("application/json"); + response.setCharacterEncoding("UTF-8"); + Result result = new Result<>(); + result.setCode(HttpServletResponse.SC_UNAUTHORIZED); + result.setData(data); + result.setMessage(message); + // 将消息写入响应体 + response.getWriter().write(JSON.toJSONString(result)); + } +} \ No newline at end of file diff --git a/spzx-common/common-service/src/main/java/com/atguigu/utils/StringEmptyUtil.java b/spzx-common/common-service/src/main/java/com/atguigu/utils/StringEmptyUtil.java new file mode 100644 index 0000000..c74c8e4 --- /dev/null +++ b/spzx-common/common-service/src/main/java/com/atguigu/utils/StringEmptyUtil.java @@ -0,0 +1,19 @@ +package com.atguigu.utils; + +import com.atguigu.exception.BunnyException; +import org.springframework.stereotype.Component; + +@Component +public class StringEmptyUtil { + /** + * 判断内容是否为空 + * + * @param val 值 + * @param errorMessage 如果为空的错误信息 + */ + public void isEmpty(Object val, String errorMessage) { + if (val == null || val.toString().isEmpty()) { + throw new BunnyException(null, errorMessage); + } + } +} diff --git a/spzx-common/common-service/target/classes/com/atguigu/config/Knife4jConfig.class b/spzx-common/common-service/target/classes/com/atguigu/config/Knife4jConfig.class new file mode 100644 index 0000000..fc40dd2 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/config/Knife4jConfig.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/config/RedisConfiguration.class b/spzx-common/common-service/target/classes/com/atguigu/config/RedisConfiguration.class new file mode 100644 index 0000000..7b1ee25 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/config/RedisConfiguration.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/config/ResourceConfiguration.class b/spzx-common/common-service/target/classes/com/atguigu/config/ResourceConfiguration.class new file mode 100644 index 0000000..4f4fcc7 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/config/ResourceConfiguration.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/config/WebMvcConfiguration.class b/spzx-common/common-service/target/classes/com/atguigu/config/WebMvcConfiguration.class new file mode 100644 index 0000000..8b293ef Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/config/WebMvcConfiguration.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/exception/BunnyException.class b/spzx-common/common-service/target/classes/com/atguigu/exception/BunnyException.class new file mode 100644 index 0000000..4aa49a6 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/exception/BunnyException.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/handler/GlobalExceptionHandler.class b/spzx-common/common-service/target/classes/com/atguigu/handler/GlobalExceptionHandler.class new file mode 100644 index 0000000..77fa4b2 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/handler/GlobalExceptionHandler.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/interceptor/LoginAuthInterceptor.class b/spzx-common/common-service/target/classes/com/atguigu/interceptor/LoginAuthInterceptor.class new file mode 100644 index 0000000..09fccf0 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/interceptor/LoginAuthInterceptor.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/utils/InterceptorUtil.class b/spzx-common/common-service/target/classes/com/atguigu/utils/InterceptorUtil.class new file mode 100644 index 0000000..17b5ef0 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/utils/InterceptorUtil.class differ diff --git a/spzx-common/common-service/target/classes/com/atguigu/utils/StringEmptyUtil.class b/spzx-common/common-service/target/classes/com/atguigu/utils/StringEmptyUtil.class new file mode 100644 index 0000000..a8bb506 Binary files /dev/null and b/spzx-common/common-service/target/classes/com/atguigu/utils/StringEmptyUtil.class differ diff --git a/spzx-common/common-util/pom.xml b/spzx-common/common-util/pom.xml index 6591198..a379e71 100644 --- a/spzx-common/common-util/pom.xml +++ b/spzx-common/common-util/pom.xml @@ -1,4 +1,4 @@ - 4.0.0 @@ -11,13 +11,34 @@ jar common-util - http://maven.apache.org + https://maven.apache.org UTF-8 - + + + com.atguigu + spzx-model + 1.0-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-web + + + + com.alibaba + fastjson + + + + io.minio + minio + 8.5.9 + diff --git a/spzx-common/common-util/src/main/java/com/atguigu/App.java b/spzx-common/common-util/src/main/java/com/atguigu/App.java deleted file mode 100644 index 74498e7..0000000 --- a/spzx-common/common-util/src/main/java/com/atguigu/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.atguigu; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/constant/ExceptionConstant.java b/spzx-common/common-util/src/main/java/com/atguigu/constant/ExceptionConstant.java new file mode 100644 index 0000000..2dcd39e --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/constant/ExceptionConstant.java @@ -0,0 +1,16 @@ +package com.atguigu.constant; + + +import lombok.Data; + +@Data +public class ExceptionConstant { + public static final String USER_NOT_FOUND = "用户不存在"; + public static final String USERNAME_IS_EMPTY = "用户名不能为空"; + public static final String PASSWORD_ERROR = "密码错误"; + public static final String PASSWORD_IS_EMPTY = "密码不能为空"; + public static final String CAPTCHA_IS_EMPTY = "提交验证码不能为空"; + public static final String KEY_IS_EMPTY = "验证码key不能为空"; + public static final String VERIFICATION_CODE_DOES_NOT_MATCH = "验证码不匹配"; + public static final String VERIFICATION_CODE_IS_EMPTY = "验证码失效或不存在"; +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/constant/LocalDateTimeConstant.java b/spzx-common/common-util/src/main/java/com/atguigu/constant/LocalDateTimeConstant.java new file mode 100644 index 0000000..ba175b9 --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/constant/LocalDateTimeConstant.java @@ -0,0 +1,8 @@ +package com.atguigu.constant; + +public class LocalDateTimeConstant { + public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd"; + public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm"; + public static final String DEFAULT_DATE_TIME_SECOND_FORMAT = "yyyy-MM-dd HH:mm:ss"; + public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss"; +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/constant/MessageConstant.java b/spzx-common/common-util/src/main/java/com/atguigu/constant/MessageConstant.java new file mode 100644 index 0000000..123526d --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/constant/MessageConstant.java @@ -0,0 +1,20 @@ +package com.atguigu.constant; + +/** + * 信息提示常量类 + */ +public class MessageConstant { + 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_LOCKED = "账号被锁定"; + public static final String UNKNOWN_ERROR = "未知错误"; + public static final String USER_NOT_LOGIN = "用户未登录"; + public static final String USER_TOKEN_OUT_OF_DATE = "用户登录过期"; + public static final String LOGIN_FAILED = "登录失败"; + public static final String UPLOAD_FAILED = "文件上传失败"; + public static final String PASSWORD_EDIT_FAILED = "密码修改失败"; + public static final String ALREADY_EXISTS = "已存在"; + public static final String REQUEST_NOT_EMPTY = "请求不为空"; +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/constant/PasswordConstant.java b/spzx-common/common-util/src/main/java/com/atguigu/constant/PasswordConstant.java new file mode 100644 index 0000000..6c4166b --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/constant/PasswordConstant.java @@ -0,0 +1,15 @@ +package com.atguigu.constant; + +/** + * 密码常量 + */ +public class PasswordConstant { + // 默认密码 + public static final String DEFAULT_PASSWORD = "123456"; + // JWT密码 + public static final String DEFAULT_JWT_PASSWORD = "123456"; + // 默认头像 + public static final String AVTAR = "https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg"; + // 设置token过期时间 + public static final long TOKEN_EXPIRATION = 365L * 24 * 60 * 60 * 1000; +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/constant/StatusConstant.java b/spzx-common/common-util/src/main/java/com/atguigu/constant/StatusConstant.java new file mode 100644 index 0000000..eb33661 --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/constant/StatusConstant.java @@ -0,0 +1,11 @@ +package com.atguigu.constant; + +/** + * 状态常量,启用或者禁用 + */ +public class StatusConstant { + // 启用为1 + public static final Integer ENABLE = 1; + // 禁用为0 + public static final Integer DISABLE = 0; +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/context/BaseContext.java b/spzx-common/common-util/src/main/java/com/atguigu/context/BaseContext.java new file mode 100644 index 0000000..3885860 --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/context/BaseContext.java @@ -0,0 +1,73 @@ +package com.atguigu.context; + +import com.atguigu.spzx.model.entity.system.SysUser; +import com.atguigu.spzx.model.entity.user.UserInfo; + +public class BaseContext { + public static ThreadLocal threadLocal = new ThreadLocal<>(); + public static ThreadLocal sysUserThreadLocal = new ThreadLocal<>(); + public static ThreadLocal userInfoThreadLocal = new ThreadLocal<>(); + + /** + * 获取当前用户id + */ + public static Long getUserId() { + return threadLocal.get(); + } + + /** + * 设置用户id + */ + public static void setUserId(Long userId) { + threadLocal.set(userId); + } + + /** + * 获取当前 系统用户实体类 + */ + public static SysUser getSysUser() { + return sysUserThreadLocal.get(); + } + + /** + * 设置当前 系统用户实体类 + */ + public static void setSysUser(SysUser sysUser) { + sysUserThreadLocal.set(sysUser); + } + + /** + * 获取当前 用户实体类 + */ + public static UserInfo getUserInfo() { + return userInfoThreadLocal.get(); + } + + /** + * 设置当前 用户实体类 + */ + public static void setUserInfo(UserInfo userInfo) { + userInfoThreadLocal.set(userInfo); + } + + /** + * 移出当前id + */ + public static void remove() { + threadLocal.remove(); + } + + /** + * 移出当前 系统用户实体类 + */ + public static void removeSysUser() { + sysUserThreadLocal.remove(); + } + + /** + * 移出当前 用户实体类 + */ + public static void removeUserInfo() { + userInfoThreadLocal.remove(); + } +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/json/JacksonObjectMapper.java b/spzx-common/common-util/src/main/java/com/atguigu/json/JacksonObjectMapper.java new file mode 100644 index 0000000..b1abf54 --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/json/JacksonObjectMapper.java @@ -0,0 +1,46 @@ +package com.atguigu.json; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; + +import static com.atguigu.constant.LocalDateTimeConstant.*; +import static com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES; + +/** + * 对象映射器:基于jackson将Java对象转为json,或者将json转为Java对象 + * 将JSON解析为Java对象的过程称为 [从JSON反序列化Java对象] + * 从Java对象生成JSON的过程称为 [序列化Java对象到JSON] + */ +public class JacksonObjectMapper extends ObjectMapper { + public JacksonObjectMapper() { + super(); + // 收到未知属性时不报异常 + this.configure(FAIL_ON_UNKNOWN_PROPERTIES, false); + + // 反序列化时,属性不存在的兼容处理 + this.getDeserializationConfig().withoutFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + + 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(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT))) + .addSerializer(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT))) + .addSerializer(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT))) + .addSerializer(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT))); + + // 注册功能模块 例如,可以添加自定义序列化器和反序列化器 + this.registerModule(simpleModule); + } +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/lib/MD5.java b/spzx-common/common-util/src/main/java/com/atguigu/lib/MD5.java new file mode 100644 index 0000000..4241dee --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/lib/MD5.java @@ -0,0 +1,32 @@ +package com.atguigu.lib; + +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")); + } +} diff --git a/spzx-common/common-util/src/main/java/com/atguigu/properties/InterceptorsProperties.java b/spzx-common/common-util/src/main/java/com/atguigu/properties/InterceptorsProperties.java new file mode 100644 index 0000000..08e3d82 --- /dev/null +++ b/spzx-common/common-util/src/main/java/com/atguigu/properties/InterceptorsProperties.java @@ -0,0 +1,14 @@ +package com.atguigu.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +import java.util.List; + +@Configuration +@ConfigurationProperties(prefix = "bunny.spzx") +@Data +public class InterceptorsProperties { + private List noAuthUrls; +} diff --git a/spzx-common/common-util/target/classes/com/atguigu/constant/ExceptionConstant.class b/spzx-common/common-util/target/classes/com/atguigu/constant/ExceptionConstant.class new file mode 100644 index 0000000..2b0ed22 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/constant/ExceptionConstant.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/constant/LocalDateTimeConstant.class b/spzx-common/common-util/target/classes/com/atguigu/constant/LocalDateTimeConstant.class new file mode 100644 index 0000000..c33655f Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/constant/LocalDateTimeConstant.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/constant/MessageConstant.class b/spzx-common/common-util/target/classes/com/atguigu/constant/MessageConstant.class new file mode 100644 index 0000000..bd8cd10 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/constant/MessageConstant.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/constant/PasswordConstant.class b/spzx-common/common-util/target/classes/com/atguigu/constant/PasswordConstant.class new file mode 100644 index 0000000..075bc8b Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/constant/PasswordConstant.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/constant/StatusConstant.class b/spzx-common/common-util/target/classes/com/atguigu/constant/StatusConstant.class new file mode 100644 index 0000000..730e26e Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/constant/StatusConstant.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/context/BaseContext.class b/spzx-common/common-util/target/classes/com/atguigu/context/BaseContext.class new file mode 100644 index 0000000..b6e8f61 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/context/BaseContext.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/json/JacksonObjectMapper.class b/spzx-common/common-util/target/classes/com/atguigu/json/JacksonObjectMapper.class new file mode 100644 index 0000000..5f5fd50 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/json/JacksonObjectMapper.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/lib/MD5.class b/spzx-common/common-util/target/classes/com/atguigu/lib/MD5.class new file mode 100644 index 0000000..ac439c5 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/lib/MD5.class differ diff --git a/spzx-common/common-util/target/classes/com/atguigu/properties/InterceptorsProperties.class b/spzx-common/common-util/target/classes/com/atguigu/properties/InterceptorsProperties.class new file mode 100644 index 0000000..bc8a0e8 Binary files /dev/null and b/spzx-common/common-util/target/classes/com/atguigu/properties/InterceptorsProperties.class differ diff --git a/spzx-common/pom.xml b/spzx-common/pom.xml index e18be98..3f05c1c 100644 --- a/spzx-common/pom.xml +++ b/spzx-common/pom.xml @@ -11,7 +11,7 @@ pom spzx-common - http://maven.apache.org + https://maven.apache.org common-util common-service @@ -22,6 +22,11 @@ - + + + cn.hutool + hutool-all + 5.8.25 + diff --git a/spzx-manager/Dockerfile b/spzx-manager/Dockerfile new file mode 100644 index 0000000..421b7e4 --- /dev/null +++ b/spzx-manager/Dockerfile @@ -0,0 +1,20 @@ +FROM openjdk:18 + +#系统编码 +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 + +# 设置时区,构建镜像时执行的命令 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo "Asia/Shanghai" > /etc/timezone + +# 设定工作目录 +WORKDIR /home/bunny + +# 复制jar包 +COPY target/sky-server-1.0-SNAPSHOT.jar /home/bunny/app.jar + +#启动容器时的进程 +ENTRYPOINT ["java","-jar","/home/bunny/app.jar"] + +#暴露 8080 端口 +EXPOSE 8080 \ No newline at end of file diff --git a/spzx-manager/pom.xml b/spzx-manager/pom.xml index db9871f..3035841 100644 --- a/spzx-manager/pom.xml +++ b/spzx-manager/pom.xml @@ -1,23 +1,64 @@ - - 4.0.0 - - com.atguigu - spzx-parent - 1.0-SNAPSHOT - + 4.0.0 + + com.atguigu + spzx-parent + 1.0-SNAPSHOT + - spzx-manager - jar + spzx-manager + jar - spzx-manager - http://maven.apache.org + spzx-manager + https://maven.apache.org - - UTF-8 - + + UTF-8 + - - - + + + + com.atguigu + common-service + 1.0-SNAPSHOT + + + com.atguigu + common-util + 1.0-SNAPSHOT + compile + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + + + + mysql + mysql-connector-java + + + + com.github.pagehelper + pagehelper-spring-boot-starter + + diff --git a/spzx-manager/src/main/java/com/atguigu/App.java b/spzx-manager/src/main/java/com/atguigu/App.java deleted file mode 100644 index 74498e7..0000000 --- a/spzx-manager/src/main/java/com/atguigu/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.atguigu; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/MangerApplication.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/MangerApplication.java new file mode 100644 index 0000000..74257de --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/MangerApplication.java @@ -0,0 +1,17 @@ +package com.atguigu.spzx.manger; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@EnableCaching +@EnableScheduling +@ComponentScan("com.atguigu") +public class MangerApplication { + public static void main(String[] args) { + SpringApplication.run(MangerApplication.class, args); + } +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/controller/IndexController.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/controller/IndexController.java new file mode 100644 index 0000000..6183201 --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/controller/IndexController.java @@ -0,0 +1,52 @@ +package com.atguigu.spzx.manger.controller; + +import com.atguigu.context.BaseContext; +import com.atguigu.spzx.manger.service.SysUserService; +import com.atguigu.spzx.manger.service.ValidateCodeService; +import com.atguigu.spzx.model.dto.system.LoginDto; +import com.atguigu.spzx.model.entity.system.SysUser; +import com.atguigu.spzx.model.vo.result.Result; +import com.atguigu.spzx.model.vo.system.LoginVo; +import com.atguigu.spzx.model.vo.system.ValidateCodeVo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@Tag(name = "用户接口") +@RestController +@RequestMapping("/admin/system/index") +public class IndexController { + @Autowired + private SysUserService sysUserService; + @Autowired + private ValidateCodeService validateCodeService; + + @Operation(summary = "生成验证码", description = "生成验证码信息") + @GetMapping("generateValidateCode") + public Result generateValidateCode() { + ValidateCodeVo vo = validateCodeService.generateValidateCode(); + return Result.success(vo); + } + + @Operation(summary = "登录请求", description = "登录请求实现") + @PostMapping("login") + public Result login(@RequestBody LoginDto loginDto) { + LoginVo vo = sysUserService.login(loginDto); + return Result.success(vo); + } + + @Operation(summary = "获取登录用户信息", description = "获取当前登录用户信息") + @GetMapping("getUserInfo") + public Result getUserInfo() { + SysUser sysUser = BaseContext.getSysUser(); + return Result.success(sysUser); + } + + @Operation(summary = "用户退出", description = "用户退出接口") + @GetMapping(value = "/logout") + public Result logout(@RequestHeader(value = "token") String token) { + sysUserService.logout(token); + return Result.success(); + } +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/mapper/SysUserMapper.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/mapper/SysUserMapper.java new file mode 100644 index 0000000..878bd40 --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/mapper/SysUserMapper.java @@ -0,0 +1,15 @@ +package com.atguigu.spzx.manger.mapper; + +import com.atguigu.spzx.model.entity.system.SysUser; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface SysUserMapper { + /** + * * 根据username查询用户信息 + * + * @param username 用户名 + * @return 用户信息 + */ + SysUser selectByUsername(String username); +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/SysUserService.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/SysUserService.java new file mode 100644 index 0000000..1df55dc --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/SysUserService.java @@ -0,0 +1,21 @@ +package com.atguigu.spzx.manger.service; + +import com.atguigu.spzx.model.dto.system.LoginDto; +import com.atguigu.spzx.model.vo.system.LoginVo; + +public interface SysUserService { + /** + * * 登录请求实现 + * + * @param loginDto 登录请求参数 + * @return 登录后结果 + */ + LoginVo login(LoginDto loginDto); + + /** + * * 用户退出接口 + * + * @param token token值 + */ + void logout(String token); +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/ValidateCodeService.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/ValidateCodeService.java new file mode 100644 index 0000000..d40b649 --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/ValidateCodeService.java @@ -0,0 +1,12 @@ +package com.atguigu.spzx.manger.service; + +import com.atguigu.spzx.model.vo.system.ValidateCodeVo; + +public interface ValidateCodeService { + /** + * 生成验证码信息 + * + * @return 验证码响应结果实体类 + */ + ValidateCodeVo generateValidateCode(); +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.java new file mode 100644 index 0000000..bcecf18 --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.java @@ -0,0 +1,83 @@ +package com.atguigu.spzx.manger.service.impl; + +import com.alibaba.fastjson.JSON; +import com.atguigu.constant.ExceptionConstant; +import com.atguigu.exception.BunnyException; +import com.atguigu.lib.MD5; +import com.atguigu.spzx.manger.mapper.SysUserMapper; +import com.atguigu.spzx.manger.service.SysUserService; +import com.atguigu.spzx.model.dto.system.LoginDto; +import com.atguigu.spzx.model.entity.system.SysUser; +import com.atguigu.spzx.model.vo.system.LoginVo; +import com.atguigu.utils.StringEmptyUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.Objects; +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +@Service +public class SysUserServiceImpl implements SysUserService { + @Autowired + StringEmptyUtil stringEmptyUtil; + @Autowired + private SysUserMapper sysUserMapper; + @Autowired + private RedisTemplate redisTemplate; + + /** + * * 登录请求实现 + * + * @param loginDto 登录请求参数 + * @return 登录后结果 + */ + @Override + public LoginVo login(LoginDto loginDto) { + String password = loginDto.getPassword(); + String userName = loginDto.getUserName(); + String captcha = loginDto.getCaptcha(); + String key = loginDto.getCodeKey(); + // 得到Redis中验证码 + String code = (String) redisTemplate.opsForValue().get(key); + stringEmptyUtil.isEmpty(userName, ExceptionConstant.USERNAME_IS_EMPTY); + stringEmptyUtil.isEmpty(password, ExceptionConstant.PASSWORD_IS_EMPTY); + stringEmptyUtil.isEmpty(captcha, ExceptionConstant.CAPTCHA_IS_EMPTY); + stringEmptyUtil.isEmpty(key, ExceptionConstant.KEY_IS_EMPTY); + stringEmptyUtil.isEmpty(code, ExceptionConstant.VERIFICATION_CODE_IS_EMPTY); + + // 验证码不匹配 + assert code != null; + if ((!Objects.equals(code.toLowerCase(), captcha.toLowerCase()))) { + throw new BunnyException(ExceptionConstant.VERIFICATION_CODE_DOES_NOT_MATCH); + } + // 比较完成后删除验证码 + redisTemplate.delete(key); + // 根据username查询用户信息 + SysUser sysUser = sysUserMapper.selectByUsername(userName); + if (sysUser == null) { + throw new BunnyException(ExceptionConstant.USER_NOT_FOUND); + } + String encryptedPassword = MD5.encrypt(password); + // 比较密码 + if (!encryptedPassword.equals(sysUser.getPassword())) { + throw new BunnyException(ExceptionConstant.PASSWORD_ERROR); + } + // 登录成功 + String token = UUID.randomUUID().toString().replaceAll("-", ""); + redisTemplate.opsForValue().set(token, JSON.toJSONString(sysUser), 7, TimeUnit.DAYS); + // 返回loginVo对象 + return LoginVo.builder().token(token).build(); + } + + /** + * * 用户退出接口 + * + * @param token token值 + */ + @Override + public void logout(String token) { + redisTemplate.delete(token); + } +} diff --git a/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.java b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.java new file mode 100644 index 0000000..627740f --- /dev/null +++ b/spzx-manager/src/main/java/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.java @@ -0,0 +1,36 @@ +package com.atguigu.spzx.manger.service.impl; + +import cn.hutool.captcha.CaptchaUtil; +import cn.hutool.captcha.CircleCaptcha; +import com.atguigu.spzx.manger.service.ValidateCodeService; +import com.atguigu.spzx.model.vo.system.ValidateCodeVo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.UUID; +import java.util.concurrent.TimeUnit; + +@Service +public class ValidateCodeServiceImpl implements ValidateCodeService { + @Autowired + private RedisTemplate redisTemplate; + + /** + * 生成验证码信息 + * + * @return 验证码响应结果实体类 + */ + @Override + public ValidateCodeVo generateValidateCode() { + // 1. 通过工具生成验证码 + CircleCaptcha captcha = CaptchaUtil.createCircleCaptcha(150, 48, 4, 2); + String code = captcha.getCode(); + String base64Image = "data:image/png;base64," + captcha.getImageBase64(); + // 2. 验证码存储到Redis中,Redis的key为UUID,值为验证码的值 + String key = UUID.randomUUID().toString(); + // 3. 返回ValidateCodeVo + redisTemplate.opsForValue().set(key, code, 10, TimeUnit.MINUTES); + return ValidateCodeVo.builder().codeKey(key).codeValue(base64Image).build(); + } +} diff --git a/spzx-manager/src/main/resources/application-dev.yml b/spzx-manager/src/main/resources/application-dev.yml new file mode 100644 index 0000000..b494140 --- /dev/null +++ b/spzx-manager/src/main/resources/application-dev.yml @@ -0,0 +1,22 @@ +bunny: + datasource: + host: 106.15.251.123 + port: 3305 + sqlData: db_spzx + username: root + password: "02120212" + + redis: + host: 106.15.251.123 + port: 6379 + database: 2 + + + spzx: + noAuthUrls: + - /admin/system/index/login + - /admin/system/index/generateValidateCode + - /v3/** +# jackson: +# date-format: yyyy-MM-dd HH:mm:ss +# time-zone: GMT+8 \ No newline at end of file diff --git a/spzx-manager/src/main/resources/application.yml b/spzx-manager/src/main/resources/application.yml new file mode 100644 index 0000000..6ee6c3b --- /dev/null +++ b/spzx-manager/src/main/resources/application.yml @@ -0,0 +1,40 @@ +server: + port: 8501 +spring: + application: + name: service-spzx + profiles: + active: dev + main: + allow-bean-definition-overriding: true + + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true + username: ${bunny.datasource.username} + password: "${bunny.datasource.password}" + data: + redis: + host: ${bunny.redis.host} + port: ${bunny.redis.port} + database: ${bunny.redis.database} + +logging: + level: + com.atguigu.mapper: debug + com.atguigu.controller: info + com.atguigu.service: info + pattern: + dateformat: HH:mm:ss:SSS + file: + path: " logs/${spring.application.name}" + +mybatis: + type-aliases-package: com.atguigu.spzx.model + mapper-locations: classpath:mapper/*.xml + # config-location: classpath:mybatis-config.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + map-underscore-to-camel-case: true + auto-mapping-behavior: full \ No newline at end of file diff --git a/spzx-manager/src/main/resources/banner.txt b/spzx-manager/src/main/resources/banner.txt new file mode 100644 index 0000000..cc77fc2 --- /dev/null +++ b/spzx-manager/src/main/resources/banner.txt @@ -0,0 +1,16 @@ +-----------------▄██-█▄--------- +-----------------███▄██▄-------- +-----------------███████-------- +-----------------▀███████------- +-------------------██████▄▄----- +-------------------█████████▄--- +-------------------██████▄████-- +-------▄███████████████████████- +-----▄███████████████████████▀-- +---▄██████████████████████------ +---███████████████████████------ +---███████████████████████------ +-▄▄██████████████████████▀------ +-█████████████████▀█████-------- +-▀██████████████▀▀-▀█████▄------ +-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------ \ No newline at end of file diff --git a/spzx-manager/src/main/resources/logback-spring.xml b/spzx-manager/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..eb59d34 --- /dev/null +++ b/spzx-manager/src/main/resources/logback-spring.xml @@ -0,0 +1,56 @@ + + + + logback + + + + + + + + + + + + + + + + + + + + + + + INFO + + + ${CONSOLE_LOG_PATTERN} + ${ENCODING} + + + + + + ${log.path}//log.log + true + + %date{yyyy-MM-dd HH:mm:ss} %msg%n + ${ENCODING} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spzx-manager/src/main/resources/mapper/SysUserMapper.xml b/spzx-manager/src/main/resources/mapper/SysUserMapper.xml new file mode 100644 index 0000000..ee789fe --- /dev/null +++ b/spzx-manager/src/main/resources/mapper/SysUserMapper.xml @@ -0,0 +1,15 @@ + + + + + + id,username userName ,password,name,phone,avatar,description,status,create_time,update_time,is_deleted + + + + diff --git a/spzx-manager/src/main/resources/mybatis-config.xml b/spzx-manager/src/main/resources/mybatis-config.xml new file mode 100644 index 0000000..89898c2 --- /dev/null +++ b/spzx-manager/src/main/resources/mybatis-config.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/spzx-manager/target/classes/application-dev.yml b/spzx-manager/target/classes/application-dev.yml new file mode 100644 index 0000000..b494140 --- /dev/null +++ b/spzx-manager/target/classes/application-dev.yml @@ -0,0 +1,22 @@ +bunny: + datasource: + host: 106.15.251.123 + port: 3305 + sqlData: db_spzx + username: root + password: "02120212" + + redis: + host: 106.15.251.123 + port: 6379 + database: 2 + + + spzx: + noAuthUrls: + - /admin/system/index/login + - /admin/system/index/generateValidateCode + - /v3/** +# jackson: +# date-format: yyyy-MM-dd HH:mm:ss +# time-zone: GMT+8 \ No newline at end of file diff --git a/spzx-manager/target/classes/application.yml b/spzx-manager/target/classes/application.yml new file mode 100644 index 0000000..6ee6c3b --- /dev/null +++ b/spzx-manager/target/classes/application.yml @@ -0,0 +1,40 @@ +server: + port: 8501 +spring: + application: + name: service-spzx + profiles: + active: dev + main: + allow-bean-definition-overriding: true + + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true + username: ${bunny.datasource.username} + password: "${bunny.datasource.password}" + data: + redis: + host: ${bunny.redis.host} + port: ${bunny.redis.port} + database: ${bunny.redis.database} + +logging: + level: + com.atguigu.mapper: debug + com.atguigu.controller: info + com.atguigu.service: info + pattern: + dateformat: HH:mm:ss:SSS + file: + path: " logs/${spring.application.name}" + +mybatis: + type-aliases-package: com.atguigu.spzx.model + mapper-locations: classpath:mapper/*.xml + # config-location: classpath:mybatis-config.xml + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + map-underscore-to-camel-case: true + auto-mapping-behavior: full \ No newline at end of file diff --git a/spzx-manager/target/classes/banner.txt b/spzx-manager/target/classes/banner.txt new file mode 100644 index 0000000..cc77fc2 --- /dev/null +++ b/spzx-manager/target/classes/banner.txt @@ -0,0 +1,16 @@ +-----------------▄██-█▄--------- +-----------------███▄██▄-------- +-----------------███████-------- +-----------------▀███████------- +-------------------██████▄▄----- +-------------------█████████▄--- +-------------------██████▄████-- +-------▄███████████████████████- +-----▄███████████████████████▀-- +---▄██████████████████████------ +---███████████████████████------ +---███████████████████████------ +-▄▄██████████████████████▀------ +-█████████████████▀█████-------- +-▀██████████████▀▀-▀█████▄------ +-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------ \ No newline at end of file diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/MangerApplication.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/MangerApplication.class new file mode 100644 index 0000000..9ecda2a Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/MangerApplication.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/controller/IndexController.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/controller/IndexController.class new file mode 100644 index 0000000..f4806d7 Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/controller/IndexController.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/mapper/SysUserMapper.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/mapper/SysUserMapper.class new file mode 100644 index 0000000..bd10120 Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/mapper/SysUserMapper.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/service/SysUserService.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/SysUserService.class new file mode 100644 index 0000000..61ffa08 Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/SysUserService.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/service/ValidateCodeService.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/ValidateCodeService.class new file mode 100644 index 0000000..ad846fb Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/ValidateCodeService.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.class new file mode 100644 index 0000000..dcccba8 Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/SysUserServiceImpl.class differ diff --git a/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.class b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.class new file mode 100644 index 0000000..06ef4fa Binary files /dev/null and b/spzx-manager/target/classes/com/atguigu/spzx/manger/service/impl/ValidateCodeServiceImpl.class differ diff --git a/spzx-manager/target/classes/logback-spring.xml b/spzx-manager/target/classes/logback-spring.xml new file mode 100644 index 0000000..eb59d34 --- /dev/null +++ b/spzx-manager/target/classes/logback-spring.xml @@ -0,0 +1,56 @@ + + + + logback + + + + + + + + + + + + + + + + + + + + + + + INFO + + + ${CONSOLE_LOG_PATTERN} + ${ENCODING} + + + + + + ${log.path}//log.log + true + + %date{yyyy-MM-dd HH:mm:ss} %msg%n + ${ENCODING} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spzx-manager/target/classes/mapper/SysUserMapper.xml b/spzx-manager/target/classes/mapper/SysUserMapper.xml new file mode 100644 index 0000000..ee789fe --- /dev/null +++ b/spzx-manager/target/classes/mapper/SysUserMapper.xml @@ -0,0 +1,15 @@ + + + + + + id,username userName ,password,name,phone,avatar,description,status,create_time,update_time,is_deleted + + + + diff --git a/spzx-manager/target/classes/mybatis-config.xml b/spzx-manager/target/classes/mybatis-config.xml new file mode 100644 index 0000000..89898c2 --- /dev/null +++ b/spzx-manager/target/classes/mybatis-config.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/spzx-model/pom.xml b/spzx-model/pom.xml index 2a8b3fa..fef7b0b 100644 --- a/spzx-model/pom.xml +++ b/spzx-model/pom.xml @@ -1,4 +1,4 @@ - 4.0.0 @@ -11,13 +11,34 @@ jar spzx-model - http://maven.apache.org + https://maven.apache.org UTF-8 - + + + org.projectlombok + lombok + + + + com.github.xiaoymin + knife4j-openapi3-jakarta-spring-boot-starter + 4.1.0 + + + + com.alibaba + fastjson + + + + com.alibaba + easyexcel + 3.1.0 + diff --git a/spzx-model/src/main/java/com/atguigu/App.java b/spzx-model/src/main/java/com/atguigu/App.java deleted file mode 100644 index 74498e7..0000000 --- a/spzx-model/src/main/java/com/atguigu/App.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.atguigu; - -/** - * Hello world! - * - */ -public class App -{ - public static void main( String[] args ) - { - System.out.println( "Hello World!" ); - } -} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/OrderInfoDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/OrderInfoDto.java new file mode 100644 index 0000000..ba0d625 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/OrderInfoDto.java @@ -0,0 +1,23 @@ +package com.atguigu.spzx.model.dto.h5; + +import com.atguigu.spzx.model.entity.order.OrderItem; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +public class OrderInfoDto { + + //送货地址id + private Long userAddressId; + + //运费 + private BigDecimal feightFee; + + //备注 + private String remark; + + //订单明细 + private List orderItemList; +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/ProductSkuDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/ProductSkuDto.java new file mode 100644 index 0000000..b5c4042 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/ProductSkuDto.java @@ -0,0 +1,28 @@ +package com.atguigu.spzx.model.dto.h5; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "商品列表搜索条件实体类") +public class ProductSkuDto { + + @Schema(description = "关键字") + private String keyword; + + @Schema(description = "品牌id") + private Long brandId; + + @Schema(description = "一级分类id") + private Long category1Id; + + @Schema(description = "二级分类id") + private Long category2Id; + + @Schema(description = "三级分类id") + private Long category3Id; + + @Schema(description = "排序(综合排序:1 价格升序:2 价格降序:3)") + private Integer order = 1; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserLoginDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserLoginDto.java new file mode 100644 index 0000000..9d30adb --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserLoginDto.java @@ -0,0 +1,15 @@ +package com.atguigu.spzx.model.dto.h5; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "用户登录请求参数") +public class UserLoginDto { + + @Schema(description = "用户名") + private String username ; + + @Schema(description = "密码") + private String password ; +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserRegisterDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserRegisterDto.java new file mode 100644 index 0000000..30bb250 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/h5/UserRegisterDto.java @@ -0,0 +1,22 @@ +package com.atguigu.spzx.model.dto.h5; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description="注册对象") +public class UserRegisterDto { + + @Schema(description = "用户名") + private String username; + + @Schema(description = "密码") + private String password; + + @Schema(description = "昵称") + private String nickName; + + @Schema(description = "手机验证码") + private String code ; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.java new file mode 100644 index 0000000..f0adeac --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.java @@ -0,0 +1,16 @@ +package com.atguigu.spzx.model.dto.order; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "搜索条件实体类") +public class OrderStatisticsDto { + + @Schema(description = "开始时间") + private String createTimeBegin; + + @Schema(description = "结束时间") + private String createTimeEnd; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/CategoryBrandDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/CategoryBrandDto.java new file mode 100644 index 0000000..b72fa88 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/CategoryBrandDto.java @@ -0,0 +1,16 @@ +package com.atguigu.spzx.model.dto.product; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "搜索条件实体类") +public class CategoryBrandDto { + + @Schema(description = "品牌id") + private Long brandId; + + @Schema(description = "分类id") + private Long categoryId; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/ProductDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/ProductDto.java new file mode 100644 index 0000000..8131c83 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/ProductDto.java @@ -0,0 +1,23 @@ +package com.atguigu.spzx.model.dto.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "商品搜索条件实体类") +public class ProductDto extends BaseEntity { + + @Schema(description = "品牌id") + private Long brandId; + + @Schema(description = "一级分类id") + private Long category1Id; + + @Schema(description = "二级分类id") + private Long category2Id; + + @Schema(description = "三级分类id") + private Long category3Id; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/SkuSaleDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/SkuSaleDto.java new file mode 100644 index 0000000..4869a26 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/product/SkuSaleDto.java @@ -0,0 +1,12 @@ +package com.atguigu.spzx.model.dto.product; + +import lombok.Data; + +@Data +public class SkuSaleDto { + + private Long skuId; + private Integer num; + +} + diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginMenuDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginMenuDto.java new file mode 100644 index 0000000..3abb4e8 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginMenuDto.java @@ -0,0 +1,19 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +@Schema(description = "请求参数实体类") +public class AssginMenuDto { + + @Schema(description = "角色id") + private Long roleId; // 角色id + + @Schema(description = "选中的菜单id的集合") + private List> menuIdList; // 选中的菜单id的集合; Map的键表示菜单的id,值表示是否为半开; 0否,1是 + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginRoleDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginRoleDto.java new file mode 100644 index 0000000..39ddaf3 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/AssginRoleDto.java @@ -0,0 +1,18 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "请求参数实体类") +public class AssginRoleDto { + + @Schema(description = "用户id") + private Long userId; + + @Schema(description = "角色id的List集合") + private List roleIdList; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/LoginDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/LoginDto.java new file mode 100644 index 0000000..e3ee746 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/LoginDto.java @@ -0,0 +1,26 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "用户登录请求参数") +public class LoginDto { + @Schema(description = "用户名") + private String userName; + + @Schema(description = "密码") + private String password; + + @Schema(description = "提交验证码") + private String captcha; + + @Schema(description = "验证码key") + private String codeKey; +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysOperLogDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysOperLogDto.java new file mode 100644 index 0000000..7f7cf72 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysOperLogDto.java @@ -0,0 +1,22 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "请求参数实体类") +public class SysOperLogDto { + + @Schema(description = "模块名称") + private String title; + + @Schema(description = "操作用户名") + private String operName; + + @Schema(description = "开始时间") + private String createTimeBegin; + + @Schema(description = "结束时间") + private String createTimeEnd; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysRoleDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysRoleDto.java new file mode 100644 index 0000000..b9ac148 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysRoleDto.java @@ -0,0 +1,13 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "请求参数实体类") +public class SysRoleDto { + + @Schema(description = "角色名称") + private String roleName ; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysUserDto.java b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysUserDto.java new file mode 100644 index 0000000..8360072 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/dto/system/SysUserDto.java @@ -0,0 +1,21 @@ +package com.atguigu.spzx.model.dto.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Schema(description = "请求参数实体类") +public class SysUserDto { + + @Schema(description = "搜索关键字") + private String keyword ; + + @Schema(description = "开始时间") + private String createTimeBegin ; + + @Schema(description = "结束时间") + private String createTimeEnd; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/BaseEntity.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/BaseEntity.java new file mode 100644 index 0000000..74d2286 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/BaseEntity.java @@ -0,0 +1,25 @@ +package com.atguigu.spzx.model.entity.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +public class BaseEntity implements Serializable { + + @Schema(description = "唯一标识") + private Long id; + + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建时间") + private Date createTime; + + // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Schema(description = "修改时间") + private Date updateTime; + + @Schema(description = "是否删除") + private Integer isDeleted; +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/ProductUnit.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/ProductUnit.java new file mode 100644 index 0000000..8969914 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/ProductUnit.java @@ -0,0 +1,13 @@ +package com.atguigu.spzx.model.entity.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "产品单元实体类") +public class ProductUnit extends BaseEntity { + + @Schema(description = "名称") + private String name; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/Region.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/Region.java new file mode 100644 index 0000000..8acb87f --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/base/Region.java @@ -0,0 +1,22 @@ +package com.atguigu.spzx.model.entity.base; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "区域实体类") +public class Region extends BaseEntity { + + @Schema(description = "区域编码") + private String code; + + @Schema(description = "父区域编码") + private Long parentCode; + + @Schema(description = "父区名称") + private String name; + + @Schema(description = "地区级别:1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县") + private Integer level; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/h5/CartInfo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/h5/CartInfo.java new file mode 100644 index 0000000..5cd74a4 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/h5/CartInfo.java @@ -0,0 +1,36 @@ +package com.atguigu.spzx.model.entity.h5; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@Schema(description = "购物车实体类") +public class CartInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "用户id") + private Long userId; + + @Schema(description = "skuid") + private Long skuId; + + @Schema(description = "放入购物车时价格") + private BigDecimal cartPrice; + + @Schema(description = "数量") + private Integer skuNum; + + @Schema(description = "图片文件") + private String imgUrl; + + @Schema(description = "sku名称 (冗余)") + private String skuName; + + @Schema(description = "isChecked") + private Integer isChecked; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderInfo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderInfo.java new file mode 100644 index 0000000..0580c82 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderInfo.java @@ -0,0 +1,89 @@ +package com.atguigu.spzx.model.entity.order; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +@Schema(description = "OrderInfo") +public class OrderInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "会员_id") + private Long userId; + + @Schema(description = "昵称") + private String nickName; + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "使用的优惠券") + private Long couponId; + + @Schema(description = "订单总额") + private BigDecimal totalAmount; + + @Schema(description = "优惠券") + private BigDecimal couponAmount; + + @Schema(description = "原价金额") + private BigDecimal originalTotalAmount; + + @Schema(description = "运费") + private BigDecimal feightFee; + + @Schema(description = "支付方式【1->微信】") + private Integer payType; + + @Schema(description = "订单状态【0->待付款;1->待发货;2->已发货;3->待用户收货,已完成;-1->已取消】") + private Integer orderStatus; + + @Schema(description = "收货人姓名") + private String receiverName; + + @Schema(description = "收货人电话") + private String receiverPhone; + + @Schema(description = "收货人地址标签") + private String receiverTagName; + + @Schema(description = "省份/直辖市") + private String receiverProvince; + + @Schema(description = "城市") + private String receiverCity; + + @Schema(description = "区") + private String receiverDistrict; + + @Schema(description = "详细地址") + private String receiverAddress; + + @Schema(description = "支付时间") + private Date paymentTime; + + @Schema(description = "发货时间") + private Date deliveryTime; + + @Schema(description = "确认收货时间") + private Date receiveTime; + + @Schema(description = "订单备注") + private String remark; + + @Schema(description = "取消订单时间") + private Date cancelTime; + + @Schema(description = "取消订单原因") + private String cancelReason; + + @Schema(description = "订单项列表") + private List orderItemList; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderItem.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderItem.java new file mode 100644 index 0000000..855093c --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderItem.java @@ -0,0 +1,33 @@ +package com.atguigu.spzx.model.entity.order; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; + +@Data +@Schema(description = "订单项实体类") +public class OrderItem extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "订单id") + private Long orderId; + + @Schema(description = "商品sku编号") + private Long skuId; + + @Schema(description = "商品sku名字") + private String skuName; + + @Schema(description = "商品sku图片") + private String thumbImg; + + @Schema(description = "商品sku价格") + private BigDecimal skuPrice; + + @Schema(description = "商品购买的数量") + private Integer skuNum; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderLog.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderLog.java new file mode 100644 index 0000000..aab4f1f --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderLog.java @@ -0,0 +1,25 @@ +package com.atguigu.spzx.model.entity.order; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "订单日志实体对象") +public class OrderLog extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "订单id") + private Long orderId; + + @Schema(description = "操作人:用户;系统;后台管理员") + private String operateUser; + + @Schema(description = "订单状态") + private Integer processStatus; + + @Schema(description = "备注") + private String note; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderStatistics.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderStatistics.java new file mode 100644 index 0000000..d12ae43 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/order/OrderStatistics.java @@ -0,0 +1,16 @@ +package com.atguigu.spzx.model.entity.order; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class OrderStatistics extends BaseEntity { + + private Date orderDate; + private BigDecimal totalAmount; + private Integer totalNum; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/pay/PaymentInfo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/pay/PaymentInfo.java new file mode 100644 index 0000000..9f34e49 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/pay/PaymentInfo.java @@ -0,0 +1,43 @@ +package com.atguigu.spzx.model.entity.pay; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@Schema(description = "支付信息实体类") +public class PaymentInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "用户id") + private Long userId; + + @Schema(description = "订单号") + private String orderNo; + + @Schema(description = "付款方式:1-微信 2-支付宝") + private Integer payType; + + @Schema(description = "交易编号(微信或支付)") + private String outTradeNo; + + @Schema(description = "支付金额") + private BigDecimal amount; + + @Schema(description = "交易内容") + private String content; + + @Schema(description = "支付状态:0-未支付 1-已支付") + private Integer paymentStatus; + + @Schema(description = "回调时间") + private Date callbackTime; + + @Schema(description = "回调信息") + private String callbackContent; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Brand.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Brand.java new file mode 100644 index 0000000..04b3cf4 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Brand.java @@ -0,0 +1,17 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "品牌实体类") +public class Brand extends BaseEntity { + + @Schema(description = "品牌名称") + private String name; + + @Schema(description = "品牌logo") + private String logo; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Category.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Category.java new file mode 100644 index 0000000..a9d1fa0 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Category.java @@ -0,0 +1,34 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "分类实体类") +public class Category extends BaseEntity { + + @Schema(description = "分类名称") + private String name; + + @Schema(description = "分类图片url") + private String imageUrl; + + @Schema(description = "父节点id") + private Long parentId; + + @Schema(description = "分类状态: 是否显示[0-不显示,1显示]") + private Integer status; + + @Schema(description = "排序字段") + private Integer orderNum; + + @Schema(description = "是否存在子节点") + private Boolean hasChildren; + + @Schema(description = "子节点List集合") + private List children; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/CategoryBrand.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/CategoryBrand.java new file mode 100644 index 0000000..2df3d02 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/CategoryBrand.java @@ -0,0 +1,26 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "分类品牌实体类") +public class CategoryBrand extends BaseEntity { + + @Schema(description = "品牌id") + private Long brandId; + + @Schema(description = "分类id") + private Long categoryId; + + @Schema(description = "分类名称" , required = false) + private String categoryName; + + @Schema(description = "品牌名称" , required = false) + private String brandName; + + @Schema(description = "品牌logo" , required = false) + private String logo; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Product.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Product.java new file mode 100644 index 0000000..5e1e0d9 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/Product.java @@ -0,0 +1,65 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "商品实体类") +public class Product extends BaseEntity { + + @Schema(description = "商品名称") + private String name; // 商品名称 + + @Schema(description = "品牌id") + private Long brandId; // 品牌ID + + @Schema(description = "一级分类id") + private Long category1Id; // 一级分类id + + @Schema(description = "二级分类id") + private Long category2Id; // 二级分类id + + @Schema(description = "三级分类id") + private Long category3Id; // 三级分类id + + @Schema(description = "计量单位") + private String unitName; // 计量单位 + + @Schema(description = "轮播图url") + private String sliderUrls; // 轮播图 + + @Schema(description = "商品规格值json串") + private String specValue; // 商品规格值json串 + + @Schema(description = "线上状态:0-初始值,1-上架,-1-自主下架") + private Integer status; // 线上状态:0-初始值,1-上架,-1-自主下架 + + @Schema(description = "审核状态") + private Integer auditStatus; // 审核状态 + + @Schema(description = "审核信息") + private String auditMessage; // 审核信息 + + // 扩展的属性,用来封装响应的数据 + @Schema(description = "品牌名称") + private String brandName; // 品牌 + + @Schema(description = "一级分类名称") + private String category1Name; // 一级分类 + + @Schema(description = "二级分类名称") + private String category2Name; // 二级分类 + + @Schema(description = "三级分类名称") + private String category3Name; // 三级分类 + + @Schema(description = "sku列表集合") + private List productSkuList; // sku列表集合 + + @Schema(description = "图片详情列表") + private String detailsImageUrls; // 图片详情列表 + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductDetails.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductDetails.java new file mode 100644 index 0000000..457e7f0 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductDetails.java @@ -0,0 +1,12 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import lombok.Data; + +@Data +public class ProductDetails extends BaseEntity { + + private Long productId; + private String imageUrls; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSku.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSku.java new file mode 100644 index 0000000..6515b92 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSku.java @@ -0,0 +1,53 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@Schema(description = "ProductSku") +public class ProductSku extends BaseEntity { + + @Schema(description = "商品编号") + private String skuCode; + + @Schema(description = "skuName") + private String skuName; + + @Schema(description = "商品ID") + private Long productId; + + @Schema(description = "缩略图路径") + private String thumbImg; + + @Schema(description = "售价") + private BigDecimal salePrice; + + @Schema(description = "市场价") + private BigDecimal marketPrice; + + @Schema(description = "成本价") + private BigDecimal costPrice; + + @Schema(description = "库存数") + private Integer stockNum; + + @Schema(description = "销量") + private Integer saleNum; + + @Schema(description = "sku规格信息json") + private String skuSpec; + + @Schema(description = "重量") + private String weight; + + @Schema(description = "体积") + private String volume; + + @Schema(description = "线上状态:0-初始值,1-上架,-1-自主下架") + private Integer status; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSpec.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSpec.java new file mode 100644 index 0000000..0128ebd --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/product/ProductSpec.java @@ -0,0 +1,17 @@ +package com.atguigu.spzx.model.entity.product; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "商品规格实体类") +public class ProductSpec extends BaseEntity { + + @Schema(description = "规格名称") + private String specName; // 规格名称 + + @Schema(description = "规格值") + private String specValue; // 规格值 + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysMenu.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysMenu.java new file mode 100644 index 0000000..c02303c --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysMenu.java @@ -0,0 +1,32 @@ +package com.atguigu.spzx.model.entity.system; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Schema(description = "系统菜单实体类") +@Data +public class SysMenu extends BaseEntity { + + @Schema(description = "父节点id") + private Long parentId; + + @Schema(description = "节点标题") + private String title; + + @Schema(description = "组件名称") + private String component; + + @Schema(description = "排序值") + private Integer sortValue; + + @Schema(description = "状态(0:禁止,1:正常)") + private Integer status; + + // 下级列表 + @Schema(description = "子节点") + private List children; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysOperLog.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysOperLog.java new file mode 100644 index 0000000..064ae31 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysOperLog.java @@ -0,0 +1,48 @@ +package com.atguigu.spzx.model.entity.system; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "SysOperLog") +public class SysOperLog extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "模块标题") + private String title; + + @Schema(description = "方法名称") + private String method; + + @Schema(description = "请求方式") + private String requestMethod; + + private Integer businessType ; // 业务类型(0其它 1新增 2修改 3删除) + + @Schema(description = "操作类别(0其它 1后台用户 2手机端用户)") + private String operatorType; + + @Schema(description = "操作人员") + private String operName; + + @Schema(description = "请求URL") + private String operUrl; + + @Schema(description = "主机地址") + private String operIp; + + @Schema(description = "请求参数") + private String operParam; + + @Schema(description = "返回参数") + private String jsonResult; + + @Schema(description = "操作状态(0正常 1异常)") + private Integer status; + + @Schema(description = "错误消息") + private String errorMsg; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRole.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRole.java new file mode 100644 index 0000000..a1c523f --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRole.java @@ -0,0 +1,22 @@ +package com.atguigu.spzx.model.entity.system; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "角色实体类") +public class SysRole extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "角色名称") + private String roleName; + + @Schema(description = "角色编码") + private String roleCode; + + @Schema(description = "描述") + private String description; + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRoleUser.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRoleUser.java new file mode 100644 index 0000000..b324b6d --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysRoleUser.java @@ -0,0 +1,12 @@ +package com.atguigu.spzx.model.entity.system; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import lombok.Data; + +@Data +public class SysRoleUser extends BaseEntity { + + private Long roleId; // 角色id + private Long userId; // 用户id + +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysUser.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysUser.java new file mode 100644 index 0000000..997fe4f --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/system/SysUser.java @@ -0,0 +1,34 @@ +package com.atguigu.spzx.model.entity.system; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; + +@EqualsAndHashCode(callSuper = true) +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "系统用户实体类") +public class SysUser extends BaseEntity { + @Schema(description = "用户名") + private String userName; + + @Schema(description = "密码") + private String password; + + @Schema(description = "昵称") + private String name; + + @Schema(description = "手机号码") + private String phone; + + @Schema(description = "图像") + private String avatar; + + @Schema(description = "描述") + private String description; + + @Schema(description = "状态(1:正常 0:停用)") + private Integer status; +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserAddress.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserAddress.java new file mode 100644 index 0000000..763b449 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserAddress.java @@ -0,0 +1,43 @@ +package com.atguigu.spzx.model.entity.user; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "用户地址实体类") +public class UserAddress extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "用户ID") + private Long userId; + + @Schema(description = "name") + private String name; + + @Schema(description = "电话") + private String phone; + + @Schema(description = "标签名称") + private String tagName; + + @Schema(description = "provinceCode") + private String provinceCode; + + @Schema(description = "cityCode") + private String cityCode; + + @Schema(description = "districtCode") + private String districtCode; + + @Schema(description = "详细地址") + private String address; + + @Schema(description = "完整地址") + private String fullAddress; + + @Schema(description = "是否默认地址(0:否 1:是)") + private Integer isDefault; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserInfo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserInfo.java new file mode 100644 index 0000000..d35bdbb --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/entity/user/UserInfo.java @@ -0,0 +1,51 @@ +package com.atguigu.spzx.model.entity.user; + +import com.atguigu.spzx.model.entity.base.BaseEntity; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Data +@Schema(description = "用户实体类") +public class UserInfo extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @Schema(description = "用户名") + private String username; + + @Schema(description = "密码") + private String password; + + @Schema(description = "昵称") + private String nickName; + + @Schema(description = "头像") + private String avatar; + + @Schema(description = "性别") + private Integer sex; + + @Schema(description = "电话号码") + private String phone; + + @Schema(description = "备注") + private String memo; + + @Schema(description = "微信open id") + private String openId; + + @Schema(description = "微信开放平台unionID") + private String unionId; + + @Schema(description = "最后一次登录ip") + private String lastLoginIp; + + @Schema(description = "最后一次登录时间") + private Date lastLoginTime; + + @Schema(description = "状态:1为正常,0为禁止") + private Integer status; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/IndexVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/IndexVo.java new file mode 100644 index 0000000..4df17e5 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/IndexVo.java @@ -0,0 +1,15 @@ +package com.atguigu.spzx.model.vo.h5; + +import com.atguigu.spzx.model.entity.product.Category; +import com.atguigu.spzx.model.entity.product.ProductSku; +import lombok.Data; + +import java.util.List; + +@Data +public class IndexVo { + + private List categoryList ; // 一级分类的类别数据 + private List productSkuList ; // 畅销商品列表数据 + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/ProductItemVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/ProductItemVo.java new file mode 100644 index 0000000..bba64d5 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/ProductItemVo.java @@ -0,0 +1,34 @@ +package com.atguigu.spzx.model.vo.h5; + +import com.alibaba.fastjson.JSONArray; +import com.atguigu.spzx.model.entity.product.Product; +import com.atguigu.spzx.model.entity.product.ProductSku; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; +import java.util.Map; + +@Data +@Schema(description = "商品详情对象") +public class ProductItemVo { + + @Schema(description = "商品sku信息") + private ProductSku productSku; + + @Schema(description = "商品信息") + private Product product; + + @Schema(description = "商品轮播图列表") + private List sliderUrlList; + + @Schema(description = "商品详情图片列表") + private List detailsImageUrlList; + + @Schema(description = "商品规格信息") + private JSONArray specValueList; + + @Schema(description = "商品规格对应商品skuId信息") + private Map skuSpecValueMap; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/TradeVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/TradeVo.java new file mode 100644 index 0000000..f2cc0cc --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/TradeVo.java @@ -0,0 +1,20 @@ +package com.atguigu.spzx.model.vo.h5; + +import com.atguigu.spzx.model.entity.order.OrderItem; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +@Data +@Schema(description = "结算实体类") +public class TradeVo { + + @Schema(description = "结算总金额") + private BigDecimal totalAmount; + + @Schema(description = "结算商品列表") + private List orderItemList; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/UserInfoVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/UserInfoVo.java new file mode 100644 index 0000000..f624427 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/h5/UserInfoVo.java @@ -0,0 +1,16 @@ +package com.atguigu.spzx.model.vo.h5; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +@Schema(description = "用户类") +public class UserInfoVo { + + @Schema(description = "昵称") + private String nickName; + + @Schema(description = "头像") + private String avatar; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.java new file mode 100644 index 0000000..c18a68c --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.java @@ -0,0 +1,19 @@ +package com.atguigu.spzx.model.vo.order; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +@Schema(description = "统计结果实体类") +public class OrderStatisticsVo { + + @Schema(description = "日期数据集合") + private List dateList ; + + @Schema(description = "总金额数据集合") + private List amountList ; +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/product/CategoryExcelVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/product/CategoryExcelVo.java new file mode 100644 index 0000000..45062a5 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/product/CategoryExcelVo.java @@ -0,0 +1,31 @@ +package com.atguigu.spzx.model.vo.product; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CategoryExcelVo { + + @ExcelProperty(value = "id" ,index = 0) + private Long id; + + @ExcelProperty(value = "名称" ,index = 1) + private String name; + + @ExcelProperty(value = "图片url" ,index = 2) + private String imageUrl ; + + @ExcelProperty(value = "上级id" ,index = 3) + private Long parentId; + + @ExcelProperty(value = "状态" ,index = 4) + private Integer status; + + @ExcelProperty(value = "排序" ,index = 5) + private Integer orderNum; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/Result.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/Result.java new file mode 100644 index 0000000..74fd12f --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/Result.java @@ -0,0 +1,174 @@ +package com.atguigu.spzx.model.vo.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class Result { + // 烦你吗 + private Integer code; + // 返回消息 + private String message; + // 返回数据 + private T data; + + /** + * * 自定义返回体 + * + * @param data 返回体 + * @return Result + */ + protected static Result build(T data) { + Result result = new Result<>(); + if (data != null) { + result.setData(data); + } + return result; + } + + /** + * * 自定义返回体,使用ResultCodeEnum构建 + * + * @param body 返回体 + * @param codeEnum 返回状态码 + * @return Result + */ + public static Result build(T body, ResultCodeEnum codeEnum) { + Result result = build(body); + result.setCode(codeEnum.getCode()); + result.setMessage(codeEnum.getMessage()); + return result; + } + + /** + * * 自定义返回体 + * + * @param body 返回体 + * @param code 返回状态码 + * @param message 返回消息 + * @return Result + */ + public static Result build(T body, Integer code, String message) { + Result result = build(body); + result.setCode(code); + result.setMessage(message); + return result; + } + + /** + * * 操作成功 + * + * @return Result + */ + public static Result success() { + return Result.success(null, ResultCodeEnum.SUCCESS); + } + + /** + * * 操作成功 + * + * @param data baseCategory1List + */ + public static Result success(T data) { + return build(data, ResultCodeEnum.SUCCESS); + } + + /** + * * 操作成功-状态码 + * + * @param codeEnum 状态码 + */ + public static Result success(ResultCodeEnum codeEnum) { + return success(null, codeEnum); + } + + /** + * * 操作成功-自定义返回数据和状态码 + * + * @param data 返回体 + * @param codeEnum 状态码 + */ + public static Result success(T data, ResultCodeEnum codeEnum) { + return build(data, codeEnum); + } + + /** + * * 操作失败-自定义返回数据和状态码 + * + * @param data 返回体 + * @param message 错误信息 + */ + public static Result success(T data, String message) { + return build(data, 200, message); + } + + /** + * * 操作失败-自定义返回数据和状态码 + * + * @param data 返回体 + * @param code 状态码 + * @param message 错误信息 + */ + public static Result success(T data, Integer code, String message) { + return build(data, code, message); + } + + /** + * * 操作失败 + */ + public static Result error() { + return Result.build(null); + } + + /** + * * 操作失败-自定义返回数据 + * + * @param data 返回体 + */ + public static Result error(T data) { + return build(data, ResultCodeEnum.FAIL); + } + + /** + * * 操作失败-状态码 + * + * @param codeEnum 状态码 + */ + public static Result error(ResultCodeEnum codeEnum) { + return build(null, codeEnum); + } + + /** + * * 操作失败-自定义返回数据和状态码 + * + * @param data 返回体 + * @param codeEnum 状态码 + */ + public static Result error(T data, ResultCodeEnum codeEnum) { + return build(data, codeEnum); + } + + /** + * * 操作失败-自定义返回数据和状态码 + * + * @param data 返回体 + * @param code 状态码 + * @param message 错误信息 + */ + public static Result error(T data, Integer code, String message) { + return build(data, code, message); + } + + /** + * * 操作失败-自定义返回数据和状态码 + * + * @param data 返回体 + * @param message 错误信息 + */ + public static Result error(T data, String message) { + return build(null, 500, message); + } +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/ResultCodeEnum.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/ResultCodeEnum.java new file mode 100644 index 0000000..3defdb3 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/result/ResultCodeEnum.java @@ -0,0 +1,27 @@ +package com.atguigu.spzx.model.vo.result; + +import lombok.Getter; + +/** + * 统一返回结果状态信息类 + */ +@Getter +public enum ResultCodeEnum { + SUCCESS(200, "成功"), + FAIL(500, "失败"), + USE_NOT_EXIST(500, "失败"), + SERVICE_ERROR(2012, "服务异常"), + DATA_ERROR(204, "数据异常"), + LOGIN_AUTH(208, "需要先登陆"), + LOGIN_MOBLE_ERROR(208, "登录验证失败"), + ACCOUNT_DEACTIVATION(208, "账户停用"), + PERMISSION(209, "没有权限"); + + private final Integer code; + private final String message; + + ResultCodeEnum(Integer code, String message) { + this.code = code; + this.message = message; + } +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/LoginVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/LoginVo.java new file mode 100644 index 0000000..9ed1eee --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/LoginVo.java @@ -0,0 +1,20 @@ +package com.atguigu.spzx.model.vo.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "登录成功响应结果实体类") +public class LoginVo { + @Schema(description = "令牌") + private String token; + + @Schema(description = "刷新令牌,可以为空") + private String refresh_token; +} diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/SysMenuVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/SysMenuVo.java new file mode 100644 index 0000000..4b02095 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/SysMenuVo.java @@ -0,0 +1,21 @@ +package com.atguigu.spzx.model.vo.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Data +@Schema(description = "系统菜单响应结果实体类") +public class SysMenuVo { + + @Schema(description = "系统菜单标题") + private String title; + + @Schema(description = "系统菜单名称") + private String name; + + @Schema(description = "系统菜单子菜单列表") + private List children; + +} \ No newline at end of file diff --git a/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/ValidateCodeVo.java b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/ValidateCodeVo.java new file mode 100644 index 0000000..82b8ff5 --- /dev/null +++ b/spzx-model/src/main/java/com/atguigu/spzx/model/vo/system/ValidateCodeVo.java @@ -0,0 +1,20 @@ +package com.atguigu.spzx.model.vo.system; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +@Schema(description = "验证码响应结果实体类") +public class ValidateCodeVo { + @Schema(description = "验证码key") + private String codeKey; // 验证码的key + + @Schema(description = "验证码value") + private String codeValue; // 图片验证码对应的字符串数据 +} \ No newline at end of file diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/OrderInfoDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/OrderInfoDto.class new file mode 100644 index 0000000..6393a2e Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/OrderInfoDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/ProductSkuDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/ProductSkuDto.class new file mode 100644 index 0000000..e9d89cc Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/ProductSkuDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserLoginDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserLoginDto.class new file mode 100644 index 0000000..2dde95a Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserLoginDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserRegisterDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserRegisterDto.class new file mode 100644 index 0000000..e48a6c6 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/h5/UserRegisterDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.class new file mode 100644 index 0000000..29bb4c5 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/order/OrderStatisticsDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/CategoryBrandDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/CategoryBrandDto.class new file mode 100644 index 0000000..895af0c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/CategoryBrandDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/ProductDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/ProductDto.class new file mode 100644 index 0000000..21a9e50 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/ProductDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/SkuSaleDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/SkuSaleDto.class new file mode 100644 index 0000000..a261a8c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/product/SkuSaleDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginMenuDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginMenuDto.class new file mode 100644 index 0000000..6e61f52 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginMenuDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginRoleDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginRoleDto.class new file mode 100644 index 0000000..cfd4542 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/AssginRoleDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto$LoginDtoBuilder.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto$LoginDtoBuilder.class new file mode 100644 index 0000000..e8455ef Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto$LoginDtoBuilder.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto.class new file mode 100644 index 0000000..028de69 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/LoginDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysOperLogDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysOperLogDto.class new file mode 100644 index 0000000..b8119d8 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysOperLogDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysRoleDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysRoleDto.class new file mode 100644 index 0000000..08142e1 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysRoleDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysUserDto.class b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysUserDto.class new file mode 100644 index 0000000..534d9ce Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/dto/system/SysUserDto.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/BaseEntity.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/BaseEntity.class new file mode 100644 index 0000000..23bdb8c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/BaseEntity.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/ProductUnit.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/ProductUnit.class new file mode 100644 index 0000000..5d35f92 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/ProductUnit.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/Region.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/Region.class new file mode 100644 index 0000000..a3d390e Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/base/Region.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/h5/CartInfo.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/h5/CartInfo.class new file mode 100644 index 0000000..df6a0a2 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/h5/CartInfo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderInfo.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderInfo.class new file mode 100644 index 0000000..61c7fdb Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderInfo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderItem.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderItem.class new file mode 100644 index 0000000..b10e8e7 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderItem.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderLog.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderLog.class new file mode 100644 index 0000000..63d98bd Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderLog.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderStatistics.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderStatistics.class new file mode 100644 index 0000000..9541caf Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/order/OrderStatistics.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/pay/PaymentInfo.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/pay/PaymentInfo.class new file mode 100644 index 0000000..751492e Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/pay/PaymentInfo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Brand.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Brand.class new file mode 100644 index 0000000..b9c0ca4 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Brand.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Category.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Category.class new file mode 100644 index 0000000..96a9b49 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Category.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/CategoryBrand.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/CategoryBrand.class new file mode 100644 index 0000000..fc4f672 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/CategoryBrand.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Product.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Product.class new file mode 100644 index 0000000..96f9c6a Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/Product.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductDetails.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductDetails.class new file mode 100644 index 0000000..872c0c2 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductDetails.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSku.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSku.class new file mode 100644 index 0000000..04442a3 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSku.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSpec.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSpec.class new file mode 100644 index 0000000..c1b130a Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/product/ProductSpec.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysMenu.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysMenu.class new file mode 100644 index 0000000..272c4a4 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysMenu.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysOperLog.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysOperLog.class new file mode 100644 index 0000000..2bbcde0 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysOperLog.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRole.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRole.class new file mode 100644 index 0000000..01e3a9f Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRole.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRoleUser.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRoleUser.class new file mode 100644 index 0000000..0e56cb7 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysRoleUser.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser$SysUserBuilder.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser$SysUserBuilder.class new file mode 100644 index 0000000..545c713 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser$SysUserBuilder.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser.class new file mode 100644 index 0000000..fadc96c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/system/SysUser.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserAddress.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserAddress.class new file mode 100644 index 0000000..31637c9 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserAddress.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserInfo.class b/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserInfo.class new file mode 100644 index 0000000..6f8950c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/entity/user/UserInfo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/IndexVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/IndexVo.class new file mode 100644 index 0000000..87ff782 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/IndexVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/ProductItemVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/ProductItemVo.class new file mode 100644 index 0000000..5637528 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/ProductItemVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/TradeVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/TradeVo.class new file mode 100644 index 0000000..e8e7f3f Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/TradeVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/UserInfoVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/UserInfoVo.class new file mode 100644 index 0000000..81236f7 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/h5/UserInfoVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.class new file mode 100644 index 0000000..c4310a6 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/order/OrderStatisticsVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/product/CategoryExcelVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/product/CategoryExcelVo.class new file mode 100644 index 0000000..817d663 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/product/CategoryExcelVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/Result.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/Result.class new file mode 100644 index 0000000..aac185e Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/Result.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/ResultCodeEnum.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/ResultCodeEnum.class new file mode 100644 index 0000000..4f3d34e Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/result/ResultCodeEnum.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo$LoginVoBuilder.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo$LoginVoBuilder.class new file mode 100644 index 0000000..d0af7ca Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo$LoginVoBuilder.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo.class new file mode 100644 index 0000000..965d6d5 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/LoginVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/SysMenuVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/SysMenuVo.class new file mode 100644 index 0000000..54d1f44 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/SysMenuVo.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo$ValidateCodeVoBuilder.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo$ValidateCodeVoBuilder.class new file mode 100644 index 0000000..fcdeed6 Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo$ValidateCodeVoBuilder.class differ diff --git a/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo.class b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo.class new file mode 100644 index 0000000..3f1f02c Binary files /dev/null and b/spzx-model/target/classes/com/atguigu/spzx/model/vo/system/ValidateCodeVo.class differ