初始化

This commit is contained in:
bunny 2023-12-12 23:48:23 +08:00
commit 22e8e3ace5
74 changed files with 2099 additions and 0 deletions

38
.gitignore vendored Normal file
View File

@ -0,0 +1,38 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

15
.idea/dataSources.xml Normal file
View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="db_spzx@60.204.230.80" uuid="40831a68-66d1-4772-9353-7a8f6b941ef5">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://60.204.230.80:3306/db_spzx</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

24
.idea/encodings.xml Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/spzx-common/common-service/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/common-util/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/common-util/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/common-util/src/main/resources-filtered" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/spzx-service/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/spzx-service/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/spzx-service/src/main/resources-filtered" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-common/src/main/resources-filtered" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-manager/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-manager/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-manager/src/main/resources-filtered" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-model/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-model/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/spzx-model/src/main/resources-filtered" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources-filtered" charset="UTF-8" />
</component>
</project>

18
.idea/misc.xml Normal file
View File

@ -0,0 +1,18 @@
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
<option name="ignoredFiles">
<set>
<option value="$PROJECT_DIR$/spzx-common/spzx-service/pom.xml" />
</set>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="corretto-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

124
.idea/uiDesigner.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

66
pom.xml Normal file
View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cn.bunny</groupId>
<artifactId>spzx-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>spzx-common</module>
<module>spzx-model</module>
<module>spzx-manager</module>
</modules>
<!-- 指定父工程 -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
</parent>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mysql.verison>8.0.30</mysql.verison>
<fastjson.version>2.0.21</fastjson.version>
<lombok.version>1.18.20</lombok.version>
<mybatis.version>3.0.1</mybatis.version>
</properties>
<!-- 管理依赖,版本锁定 -->
<dependencyManagement>
<dependencies>
<!-- mybatis和spring boot整合的起步依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.version}</version>
</dependency>
<!-- mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!--fastjson-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- lombok依赖 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>spzx-common</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>common-service</artifactId>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- common-util模块 -->
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>common-util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- spzx-model模块 -->
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>spzx-model</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- spring boot web开发所需要的起步依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,7 @@
package cn.bunny;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -0,0 +1,25 @@
package cn.bunny.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() {// 创建API分组
return GroupedOpenApi.builder()
.group("admin-api")
.pathsToMatch("/admin/**")
.build();
}
@Bean
public OpenAPI customerOpenApi() {
return new OpenAPI().info(new Info().title("接口文档").version("1.0").contact(new Contact()
.name("bunny")));
}}

View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>spzx-common</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>common-util</artifactId>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- fastjson依赖 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>spzx-model</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.minio</groupId>
<artifactId>minio</artifactId>
<version>8.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided </scope>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,7 @@
package cn.bunny;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

32
spzx-common/pom.xml Normal file
View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>spzx-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>spzx-common</artifactId>
<packaging>pom</packaging>
<modules>
<module>common-util</module>
<module>common-service</module>
</modules>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.5.2</version>
</dependency>
</dependencies>
</project>

64
spzx-manager/pom.xml Normal file
View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>spzx-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>spzx-manager</artifactId>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- spring boot web开发所需要的起步依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- redis的起步依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- mybatis的起步依赖 -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<!-- mysql驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!-- common-service依赖 -->
<dependency>
<groupId>cn.bunny</groupId>
<artifactId>common-service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.3</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,13 @@
package cn.bunny;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = "cn.bunny")
public class MangerApplication {
public static void main(String[] args) {
SpringApplication.run(MangerApplication.class, args);
}
}

View File

@ -0,0 +1,30 @@
package cn.bunny.controller;
import cn.bunny.service.SysUserService;
import cn.bunny.spzx.model.dto.system.LoginDto;
import cn.bunny.spzx.model.vo.common.Result;
import cn.bunny.spzx.model.vo.common.ResultCodeEnum;
import cn.bunny.spzx.model.vo.system.LoginVo;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Tag(name = "用户接口")
@RestController
@RequestMapping("/admin/system/index")
public class IndexController {
@Autowired
private SysUserService sysUserService;
// 用户登录
@Operation(summary = "用户登录")
@PostMapping("login")
public Result login(@RequestBody LoginDto loginDto) {
LoginVo loginVo = sysUserService.login(loginDto);
return Result.build(loginVo, ResultCodeEnum.SUCCESS);
}
}

View File

@ -0,0 +1,10 @@
package cn.bunny.mapper;
import cn.bunny.spzx.model.entity.system.SysUser;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface SysUserMapper {
SysUser selectUserInfoByUserName(String userName);
}

View File

@ -0,0 +1,9 @@
package cn.bunny.service;
import cn.bunny.spzx.model.dto.system.LoginDto;
import cn.bunny.spzx.model.vo.system.LoginVo;
public interface SysUserService {
// 用户登录
LoginVo login(LoginDto loginDto);
}

View File

@ -0,0 +1,57 @@
package cn.bunny.service.impl;
import cn.bunny.mapper.SysUserMapper;
import cn.bunny.service.SysUserService;
import cn.bunny.spzx.model.dto.system.LoginDto;
import cn.bunny.spzx.model.entity.system.SysUser;
import cn.bunny.spzx.model.vo.system.LoginVo;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
@Service
public class SysUserServiceImpl implements SysUserService {
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Override
public LoginVo login(LoginDto loginDto) {
// 获取用户提交用户名LoginDto获取到
String userName = loginDto.getUserName();
// 根据用户名查询数据表 sys_user
SysUser sysUser = sysUserMapper.selectUserInfoByUserName(userName);
// 如果用户名查询不到对应信息用户不存在返回错误信息
if (sysUser == null) {
throw new RuntimeException("用户名不存在");
}
// 获取输入密码比较输入密码和数据库密码是否一致
String databases_password = sysUser.getPassword();
String input_password = DigestUtils.md5DigestAsHex(loginDto.getPassword().getBytes());
if (!input_password.equals(databases_password)) {
throw new RuntimeException("密码不正确");
}
String token = UUID.randomUUID().toString().replaceAll("-", "");
redisTemplate.opsForValue().set("user:login" + token, JSON.toJSONString(sysUser), 7, TimeUnit.DAYS);
LoginVo loginVo = new LoginVo();
loginVo.setToken(token);
return loginVo;
}
}

View File

@ -0,0 +1,18 @@
server:
port: 8501
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://60.204.230.80:3306/db_spzx?characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: "02120212"
data:
redis:
host: 60.204.230.80
port: 6379
mybatis:
mapper-locations: classpath:/mapper/*/*.xml
config-location: classpath:/mybatis-config.xml

View File

@ -0,0 +1,5 @@
spring:
application:
name: server-manager
profiles:
active: dev

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<contextName>logback</contextName>
<!-- 日志的输出目录 -->
<property name="log.path" value="D://logs//spzx-manager//logs" />
<!--控制台日志格式:彩色日志-->
<!-- magenta:洋红 -->
<!-- boldMagenta:粗红-->
<!-- cyan:青色 -->
<!-- white:白色 -->
<!-- magenta:洋红 -->
<property name="CONSOLE_LOG_PATTERN" value="%yellow(%date{yyyy-MM-dd HH:mm:ss}) %highlight([%-5level]) %green(%logger) %msg%n"/>
<!--文件日志格式-->
<property name="FILE_LOG_PATTERN" value="%date{yyyy-MM-dd HH:mm:ss} [%-5level] %thread %file:%line %logger %msg%n" />
<!--编码-->
<property name="ENCODING" value="UTF-8" />
<!-- 控制台日志 -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!-- 临界值过滤器 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
<charset>${ENCODING}</charset>
</encoder>
</appender>
<!-- 文件日志 -->
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${log.path}//log.log</file>
<append>true</append>
<encoder>
<pattern>%date{yyyy-MM-dd HH:mm:ss} %msg%n</pattern>
<charset>${ENCODING}</charset>
</encoder>
</appender>
<!-- 开发环境 -->
<springProfile name="dev">
<!-- com.atguigu日志记录器业务程序INFO级别 -->
<logger name="com.atguigu" level="INFO" />
<!-- 根日志记录器INFO级别 -->
<root level="INFO">
<appender-ref ref="CONSOLE" />
<appender-ref ref="FILE" />
</root>
</springProfile>
</configuration>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.bunny.mapper.SysUserMapper">
<!-- 用于select查询公用抽取的列 -->
<sql id="columns">
id,username userName ,password,name,phone,avatar,description,status,create_time,update_time,is_deleted
</sql>
<select id="selectUserInfoByUserName" resultType="cn.bunny.spzx.model.entity.system.SysUser">
SELECT
<include refid="columns"/>
FROM sys_user WHERE username=#{username}
</select>
</mapper>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC
"-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<!-- 设置驼峰标识 -->
<setting name="mapUnderscoreToCamelCase" value="true"/>
<!-- 打印SQL语句 -->
<setting name="logImpl" value="STDOUT_LOGGING"/>
</settings>
<plugins>
<!-- 分页插件 -->
<plugin interceptor="com.github.pagehelper.PageInterceptor"/>
</plugins>
</configuration>

45
spzx-model/pom.xml Normal file
View File

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.bunny</groupId>
<artifactId>spzx-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>spzx-model</artifactId>
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- lombok的依赖 -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,7 @@
package cn.bunny;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

View File

@ -0,0 +1,23 @@
package cn.bunny.spzx.model.dto.h5;
import cn.bunny.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<OrderItem> orderItemList;
}

View File

@ -0,0 +1,28 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,15 @@
package cn.bunny.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 ;
}

View File

@ -0,0 +1,22 @@
package cn.bunny.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 ;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,23 @@
package cn.bunny.spzx.model.dto.product;
import cn.bunny.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;
}

View File

@ -0,0 +1,12 @@
package cn.bunny.spzx.model.dto.product;
import lombok.Data;
@Data
public class SkuSaleDto {
private Long skuId;
private Integer num;
}

View File

@ -0,0 +1,19 @@
package cn.bunny.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<Map<String , Number>> menuIdList; // 选中的菜单id的集合; Map的键表示菜单的id值表示是否为半开; 0否1是
}

View File

@ -0,0 +1,18 @@
package cn.bunny.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<Long> roleIdList;
}

View File

@ -0,0 +1,22 @@
package cn.bunny.spzx.model.dto.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@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 ;
}

View File

@ -0,0 +1,22 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,13 @@
package cn.bunny.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 ;
}

View File

@ -0,0 +1,21 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,27 @@
package cn.bunny.spzx.model.entity.base;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
}

View File

@ -0,0 +1,13 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,22 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,36 @@
package cn.bunny.spzx.model.entity.h5;
import cn.bunny.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;
}

View File

@ -0,0 +1,89 @@
package cn.bunny.spzx.model.entity.order;
import cn.bunny.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<OrderItem> orderItemList;
}

View File

@ -0,0 +1,33 @@
package cn.bunny.spzx.model.entity.order;
import cn.bunny.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;
}

View File

@ -0,0 +1,25 @@
package cn.bunny.spzx.model.entity.order;
import cn.bunny.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;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.spzx.model.entity.order;
import cn.bunny.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;
}

View File

@ -0,0 +1,43 @@
package cn.bunny.spzx.model.entity.pay;
import cn.bunny.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;
}

View File

@ -0,0 +1,17 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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;
}

View File

@ -0,0 +1,34 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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<Category> children;
}

View File

@ -0,0 +1,26 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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;
}

View File

@ -0,0 +1,65 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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<ProductSku> productSkuList; // sku列表集合
@Schema(description = "图片详情列表")
private String detailsImageUrls; // 图片详情列表
}

View File

@ -0,0 +1,12 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.spzx.model.entity.base.BaseEntity;
import lombok.Data;
@Data
public class ProductDetails extends BaseEntity {
private Long productId;
private String imageUrls;
}

View File

@ -0,0 +1,53 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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;
}

View File

@ -0,0 +1,17 @@
package cn.bunny.spzx.model.entity.product;
import cn.bunny.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; // 规格值
}

View File

@ -0,0 +1,32 @@
package cn.bunny.spzx.model.entity.system;
import cn.bunny.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<SysMenu> children;
}

View File

@ -0,0 +1,48 @@
package cn.bunny.spzx.model.entity.system;
import cn.bunny.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;
}

View File

@ -0,0 +1,22 @@
package cn.bunny.spzx.model.entity.system;
import cn.bunny.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;
}

View File

@ -0,0 +1,12 @@
package cn.bunny.spzx.model.entity.system;
import cn.bunny.spzx.model.entity.base.BaseEntity;
import lombok.Data;
@Data
public class SysRoleUser extends BaseEntity {
private Long roleId; // 角色id
private Long userId; // 用户id
}

View File

@ -0,0 +1,32 @@
package cn.bunny.spzx.model.entity.system;
import cn.bunny.spzx.model.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@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;
}

View File

@ -0,0 +1,43 @@
package cn.bunny.spzx.model.entity.user;
import cn.bunny.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;
}

View File

@ -0,0 +1,51 @@
package cn.bunny.spzx.model.entity.user;
import cn.bunny.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;
}

View File

@ -0,0 +1,39 @@
package cn.bunny.spzx.model.vo.common;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "响应结果实体类")
public class Result<T> {
//返回码
@Schema(description = "业务状态码")
private Integer code;
//返回消息
@Schema(description = "响应消息")
private String message;
//返回数据
@Schema(description = "业务数据")
private T data;
// 私有化构造
private Result() {}
// 返回数据
public static <T> Result<T> build(T body, Integer code, String message) {
Result<T> result = new Result<>();
result.setData(body);
result.setCode(code);
result.setMessage(message);
return result;
}
// 通过枚举构造Result对象
public static <T> Result build(T body , ResultCodeEnum resultCodeEnum) {
return build(body , resultCodeEnum.getCode() , resultCodeEnum.getMessage()) ;
}
}

View File

@ -0,0 +1,30 @@
package cn.bunny.spzx.model.vo.common;
import lombok.Getter;
@Getter // 提供获取属性值的getter方法
public enum ResultCodeEnum {
SUCCESS(200 , "操作成功") ,
LOGIN_ERROR(201 , "用户名或者密码错误"),
VALIDATECODE_ERROR(202 , "验证码错误") ,
LOGIN_AUTH(208 , "用户未登录"),
USER_NAME_IS_EXISTS(209 , "用户名已经存在"),
SYSTEM_ERROR(9999 , "您的网络有问题请稍后重试"),
NODE_ERROR( 217, "该节点下有子节点,不可以删除"),
DATA_ERROR(204, "数据异常"),
ACCOUNT_STOP( 216, "账号已停用"),
STOCK_LESS( 219, "库存不足"),
;
private Integer code ; // 业务状态码
private String message ; // 响应消息
private ResultCodeEnum(Integer code , String message) {
this.code = code ;
this.message = message ;
}
}

View File

@ -0,0 +1,15 @@
package cn.bunny.spzx.model.vo.h5;
import cn.bunny.spzx.model.entity.product.Category;
import cn.bunny.spzx.model.entity.product.ProductSku;
import lombok.Data;
import java.util.List;
@Data
public class IndexVo {
private List<Category> categoryList ; // 一级分类的类别数据
private List<ProductSku> productSkuList ; // 畅销商品列表数据
}

View File

@ -0,0 +1,34 @@
package cn.bunny.spzx.model.vo.h5;
import com.alibaba.fastjson.JSONArray;
import cn.bunny.spzx.model.entity.product.Product;
import cn.bunny.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<String> sliderUrlList;
@Schema(description = "商品详情图片列表")
private List<String> detailsImageUrlList;
@Schema(description = "商品规格信息")
private JSONArray specValueList;
@Schema(description = "商品规格对应商品skuId信息")
private Map<String,Object> skuSpecValueMap;
}

View File

@ -0,0 +1,20 @@
package cn.bunny.spzx.model.vo.h5;
import cn.bunny.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<OrderItem> orderItemList;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,19 @@
package cn.bunny.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<String> dateList ;
@Schema(description = "总金额数据集合")
private List<BigDecimal> amountList ;
}

View File

@ -0,0 +1,31 @@
package cn.bunny.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;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.spzx.model.vo.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "登录成功响应结果实体类")
public class LoginVo {
@Schema(description = "令牌")
private String token ;
@Schema(description = "刷新令牌,可以为空")
private String refresh_token ;
}

View File

@ -0,0 +1,21 @@
package cn.bunny.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<SysMenuVo> children;
}

View File

@ -0,0 +1,16 @@
package cn.bunny.spzx.model.vo.system;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
@Schema(description = "验证码响应结果实体类")
public class ValidateCodeVo {
@Schema(description = "验证码key")
private String codeKey ; // 验证码的key
@Schema(description = "验证码value")
private String codeValue ; // 图片验证码对应的字符串数据
}