Browse Source

feat:数据库配置和openAPI文档配置

yangyi 4 tháng trước cách đây
mục cha
commit
ae371d92b2
2 tập tin đã thay đổi với 23 bổ sung và 0 xóa
  1. 5 0
      pom.xml
  2. 18 0
      src/main/resources/application.yaml

+ 5 - 0
pom.xml

@@ -62,6 +62,11 @@
             <version>3.0.5</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.springdoc</groupId>
+            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
+            <version>2.8.16</version>
+        </dependency>
     </dependencies>
 
     <build>

+ 18 - 0
src/main/resources/application.yaml

@@ -1,6 +1,24 @@
 spring:
   application:
     name: PetServiceManagementSystem
+  datasource:
+    url: jdbc:mysql://localhost:3306/pet_service_managemen_system?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+    username: root
+    password: root
+    driver-class-name: com.mysql.cj.jdbc.Driver
+
+mybatis:
+  mapper-locations: classpath:mapper/*.xml
+  type-aliases-package: space.anyi.petServiceManagementSystem.server.entity
+  configuration:
+    map-underscore-to-camel-case: true
+
+springdoc:
+  api-docs:
+    path: /v3/api-docs
+  swagger-ui:
+    path: /swagger-ui.html
+
 server:
   servlet:
     context-path: /api