diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..141f938 --- /dev/null +++ b/.gitignore @@ -0,0 +1,72 @@ +# ========== IDEA ========== +# IntelliJ IDEA 项目文件 +.idea/ +# IDEA 模块文件 +*.iml +*.iws +# IDEA 生成的工作区文件 +workspace.xml +# 代码样式、运行配置等 +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries +.idea/vcs.xml +# 防止提交本地历史 +.idea/**/localHistory/ + +# ========== 编译输出 ========== +# Maven 默认输出目录 +target/ +# Gradle 默认输出目录 +build/ + +# ========== 操作系统 ========== +# Windows 缓存文件 +Thumbs.db +ehthumbs.db +# macOS 缓存文件 +.DS_Store +.AppleDouble +.LSOverride +# Linux 缓存文件 +*~ + +# ========== 日志和临时文件 ========== +*.log +*.tmp +*.temp +*.swp + +# ========== Test 输出 ========== +test-output/ +surefire-reports/ +failsafe-reports/ + +# ========== 依赖管理 ========== +# Maven 本地仓库 +.mvn/repository/ +# Gradle 缓存(可选) +.gradle/ + +# ========== 打包文件 ========== +# Spring Boot 可执行包 +*.jar +*.war +# Spring Boot 可执行包目录 +BOOT-INF/ + +# ========== IDE 外插件 ========== +# Lombok 插件生成文件 +*.class +# JRebel 缓存 +rebel.xml + +# ========== 其它 ========== +# 环境变量文件(如包含敏感配置) +*.env +# Docker 相关 +docker-compose.override.yml + +# 如果你用到 IDEA 自带的 File-Based Storage(8+版本默认),可以添加: +# .idea/.name +# .idea/gradle.xml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..8b12ac7 --- /dev/null +++ b/pom.xml @@ -0,0 +1,104 @@ + + + 4.0.0 + edu.whut + smile-picture-backend + 0.0.1-SNAPSHOT + smile-picture-backend + smile-picture-backend + + 17 + UTF-8 + UTF-8 + 2.7.6 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-aop + + + + com.baomidou + mybatis-plus-boot-starter + 3.5.9 + + + + cn.hutool + hutool-all + 5.8.26 + + + + com.github.xiaoymin + knife4j-openapi2-spring-boot-starter + 4.4.0 + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring-boot.version} + pom + import + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 17 + 17 + UTF-8 + + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + edu.whut.smilepicturebackend.SmilePictureBackendApplication + true + + + + repackage + + repackage + + + + + + + + diff --git a/src/main/java/edu/whut/smilepicturebackend/SmilePictureBackendApplication.java b/src/main/java/edu/whut/smilepicturebackend/SmilePictureBackendApplication.java new file mode 100644 index 0000000..a1a85ad --- /dev/null +++ b/src/main/java/edu/whut/smilepicturebackend/SmilePictureBackendApplication.java @@ -0,0 +1,13 @@ +package edu.whut.smilepicturebackend; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class SmilePictureBackendApplication { + + public static void main(String[] args) { + SpringApplication.run(SmilePictureBackendApplication.class, args); + } + +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..d83ed6d --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,39 @@ +server: + port: 8100 + servlet: + context-path: /api + +spring: + application: + name: smile-picture-backend + # 数据库配置 + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://localhost:3306/smile-picture + username: root + password: 123456 + +mybatis-plus: + configuration: + # MyBatis 配置 + map-underscore-to-camel-case: true #是否开启驼峰转换 + # 仅在开发环境打印日志 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + global-config: + enable-sql-runner: true + db-config: + logic-delete-field: isDelete # 全局逻辑删除的实体字段名 删除操作时表中数据不会被物理删除,只会设置isDelete为1 + logic-delete-value: 1 # 逻辑已删除值(默认为 1) + logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) + +# 接口文档配置 +knife4j: + enable: true + openapi: + title: 接口文档 + version: 1.0 + group: + default: + api-rule: package + api-rule-resources: + - edu.whut.smilepicturebackend.controller #接口地址 \ No newline at end of file