From af09dd3cf3a1534c962d694b84251babd19075e6 Mon Sep 17 00:00:00 2001
From: zxj <1845124851@qq.com>
Date: Fri, 13 Oct 2023 17:41:41 +0800
Subject: [PATCH] init
---
.gitignore | 33 ++++
README.md | 3 +
pom.xml | 98 ++++++++++++
spring-boot-model/pom.xml | 20 +++
.../src/main/java/com/jnssd/model/Menu.java | 28 ++++
.../src/main/java/com/jnssd/model/Role.java | 18 +++
.../src/main/java/com/jnssd/model/User.java | 26 ++++
spring-boot-springdoc/pom.xml | 28 ++++
.../com/jnssd/controller/MenuController.java | 52 +++++++
.../com/jnssd/controller/RoleController.java | 18 +++
.../com/jnssd/controller/UserController.java | 26 ++++
spring-boot-swagger/pom.xml | 38 +++++
.../java/com/jnssd/SwaggerApplication.java | 14 ++
.../java/com/jnssd/config/SwaggerConfig.java | 128 ++++++++++++++++
.../jnssd/config/SwaggerOpenApiConfig.java | 145 ++++++++++++++++++
.../jnssd/controller/CommonController.java | 19 +++
.../com/jnssd/controller/MenuController.java | 83 ++++++++++
.../com/jnssd/controller/RoleController.java | 79 ++++++++++
.../com/jnssd/controller/UserController.java | 78 ++++++++++
.../src/main/resources/application.yml | 10 ++
20 files changed, 944 insertions(+)
create mode 100644 .gitignore
create mode 100644 README.md
create mode 100644 pom.xml
create mode 100644 spring-boot-model/pom.xml
create mode 100644 spring-boot-model/src/main/java/com/jnssd/model/Menu.java
create mode 100644 spring-boot-model/src/main/java/com/jnssd/model/Role.java
create mode 100644 spring-boot-model/src/main/java/com/jnssd/model/User.java
create mode 100644 spring-boot-springdoc/pom.xml
create mode 100644 spring-boot-springdoc/src/main/java/com/jnssd/controller/MenuController.java
create mode 100644 spring-boot-springdoc/src/main/java/com/jnssd/controller/RoleController.java
create mode 100644 spring-boot-springdoc/src/main/java/com/jnssd/controller/UserController.java
create mode 100644 spring-boot-swagger/pom.xml
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/SwaggerApplication.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/config/SwaggerConfig.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/config/SwaggerOpenApiConfig.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/controller/CommonController.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/controller/MenuController.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/controller/RoleController.java
create mode 100644 spring-boot-swagger/src/main/java/com/jnssd/controller/UserController.java
create mode 100644 spring-boot-swagger/src/main/resources/application.yml
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..96637b2
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# spring-boot-openapi
+
+springboot下的openapi功能测试,包含有Swagger和springdoc
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..0762942
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,98 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.7.16
+
+
+ com.jnssd
+ spring-boot-openapi
+ 0.0.1-SNAPSHOT
+ pom
+ spring-boot-openapi
+ spring-boot-openapi
+
+ spring-boot-swagger
+ spring-boot-springdoc
+ spring-boot-model
+
+
+ 1.8
+
+
+ 2.0.32
+ 3.0.0
+ 1.8
+
+
+
+
+
+ com.jnssd
+ spring-boot-model
+ 0.0.1-SNAPSHOT
+
+
+
+ com.alibaba
+ fastjson
+ ${fastjson.version}
+
+
+
+ io.springfox
+ springfox-boot-starter
+ ${swagger.version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${swagger.version}
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
+
+ org.projectlombok
+ lombok
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ org.projectlombok
+ lombok
+
+
+
+
+
+
+
+
diff --git a/spring-boot-model/pom.xml b/spring-boot-model/pom.xml
new file mode 100644
index 0000000..7708d83
--- /dev/null
+++ b/spring-boot-model/pom.xml
@@ -0,0 +1,20 @@
+
+
+ 4.0.0
+
+ com.jnssd
+ spring-boot-openapi
+ 0.0.1-SNAPSHOT
+
+
+ spring-boot-model
+
+
+ 8
+ 8
+ UTF-8
+
+
+
diff --git a/spring-boot-model/src/main/java/com/jnssd/model/Menu.java b/spring-boot-model/src/main/java/com/jnssd/model/Menu.java
new file mode 100644
index 0000000..5375838
--- /dev/null
+++ b/spring-boot-model/src/main/java/com/jnssd/model/Menu.java
@@ -0,0 +1,28 @@
+package com.jnssd.model;
+
+import lombok.Data;
+
+/**
+ *
spring-boot-openapi
+ * 菜单
+ *
+ * @author zxj
+ * @since 2023-10-12 16:33:23
+ */
+@Data
+public class Menu {
+ private Integer id;
+ private String name;
+ private String url;
+ private String icon;
+ private String parentId;
+ private String parentName;
+ private String parentUrl;
+ private String parentIcon;
+ private String description;
+ private String sort;
+ private String type;
+ private String status;
+ private String createTime;
+ private String updateTime;
+}
diff --git a/spring-boot-model/src/main/java/com/jnssd/model/Role.java b/spring-boot-model/src/main/java/com/jnssd/model/Role.java
new file mode 100644
index 0000000..ff1f914
--- /dev/null
+++ b/spring-boot-model/src/main/java/com/jnssd/model/Role.java
@@ -0,0 +1,18 @@
+package com.jnssd.model;
+
+import lombok.Data;
+
+/**
+ * spring-boot-openapi
+ * 角色
+ *
+ * @author zxj
+ * @since 2023-10-12 16:32:38
+ */
+@Data
+public class Role {
+ private Integer id;
+ private String name;
+ private String description;
+ private String createTime;
+}
diff --git a/spring-boot-model/src/main/java/com/jnssd/model/User.java b/spring-boot-model/src/main/java/com/jnssd/model/User.java
new file mode 100644
index 0000000..6361af3
--- /dev/null
+++ b/spring-boot-model/src/main/java/com/jnssd/model/User.java
@@ -0,0 +1,26 @@
+package com.jnssd.model;
+
+import lombok.Data;
+
+/**
+ * spring-boot-openapi
+ * 用户
+ *
+ * @author zxj
+ * @since 2023-10-12 16:30:04
+ */
+@Data
+public class User {
+
+ private Integer id;
+ private String name;
+ private String password;
+ private String email;
+ private String phone;
+ private String address;
+ private String description;
+ private String createTime;
+ private String updateTime;
+ private String status;
+
+}
diff --git a/spring-boot-springdoc/pom.xml b/spring-boot-springdoc/pom.xml
new file mode 100644
index 0000000..2d52493
--- /dev/null
+++ b/spring-boot-springdoc/pom.xml
@@ -0,0 +1,28 @@
+
+
+ 4.0.0
+
+ com.jnssd
+ spring-boot-openapi
+ 0.0.1-SNAPSHOT
+
+
+ spring-boot-springdoc
+
+
+ 8
+ 8
+ UTF-8
+
+
+
+
+
+ com.jnssd
+ spring-boot-model
+
+
+
+
diff --git a/spring-boot-springdoc/src/main/java/com/jnssd/controller/MenuController.java b/spring-boot-springdoc/src/main/java/com/jnssd/controller/MenuController.java
new file mode 100644
index 0000000..0bf7025
--- /dev/null
+++ b/spring-boot-springdoc/src/main/java/com/jnssd/controller/MenuController.java
@@ -0,0 +1,52 @@
+package com.jnssd.controller;
+
+import com.jnssd.model.Menu;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * spring-boot-openapi
+ * 菜单
+ *
+ * @author zxj
+ * @since 2023-10-12 16:33:23
+ */
+@RestController("menu")
+public class MenuController {
+
+ List