Pixiv - Miracle
1-web开发
461 字
2 分钟
1-web开发
原理
目前打算做个智能工单平台作为项目写简历上
架构

Maven
项目依赖管理,基于pom——project object model(项目对象模型),可以理解为依赖配置
| 标签 | 含义 |
|---|---|
| <parent> | 子项继承父项目的pom |
| <modules> | 子模块列表 |
| <dependencyManagement> | 管理在BOM——Bills of Material(物料清单)范围内的依赖版本 |
| 目前使用springBoot来管理依赖版本。 |
-
聚合项目的pom
使用SpringBoot对SpringFramework的相关依赖进行管理
<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>4.0.0</version></parent>SpringBoot未将SpringAI的依赖纳入管理,故需要导入bom的pom的<dependencyManagement>来对其进行管理
<dependencyManagement><dependencies><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-bom</artifactId><version>2.0.0</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement> -
通用类的pom
加个lombok即可
<dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency> -
平凡Java对象的pom
<dependencies><!-- Spring --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-validation</artifactId></dependency><!-- common依赖 --><dependency><groupId>com.ethercraft</groupId><artifactId>oxygen-common</artifactId><version>1.0-SNAPSHOT</version><scope>compile</scope></dependency><!-- 第三方依赖 --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependency></dependencies>即可
-
server的pom
<dependencies><!-- 其余子模块 --><dependency><groupId>com.ethercraft</groupId><artifactId>oxygen-common</artifactId><version>1.0-SNAPSHOT</version><scope>compile</scope></dependency><dependency><groupId>com.ethercraft</groupId><artifactId>oxygen-pojo</artifactId><version>1.0-SNAPSHOT</version><scope>compile</scope></dependency><!-- 第三方依赖 --><!-- Spring --><dependency><!-- spring-starter-webmvc --><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-webmvc</artifactId></dependency><dependency><!-- HTTP 客户端 --><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-restclient</artifactId></dependency><dependency><!-- BCrypt加密 --><groupId>org.springframework.security</groupId><artifactId>spring-security-crypto</artifactId></dependency><dependency><!-- 参数校验 --><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-validation</artifactId></dependency><dependency><!-- Redis --><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-redis</artifactId></dependency><dependency><!-- Security --><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><!-- Ollama --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-starter-model-ollama</artifactId></dependency><dependency><!-- RAG Advisor --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-vector-store-advisor</artifactId></dependency><dependency><!-- RAG --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-rag</artifactId></dependency><dependency><!-- Qdrant 向量数据库 --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-starter-vector-store-qdrant</artifactId></dependency><dependency><!-- 文档解析 --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-tika-document-reader</artifactId></dependency><dependency><!-- Testcontainers --><groupId>org.springframework.ai</groupId><artifactId>spring-ai-spring-boot-testcontainers</artifactId></dependency><!-- MySQL --><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>4.0.1</version></dependency><dependency><groupId>com.mysql</groupId><artifactId>mysql-connector-j</artifactId></dependency><!-- JWT --><dependency><groupId>io.jsonwebtoken</groupId><artifactId>jjwt-api</artifactId><version>0.12.7</version></dependency><dependency><groupId>io.jsonwebtoken</groupId><artifactId>jjwt-impl</artifactId><version>0.12.7</version><scope>runtime</scope></dependency><dependency><groupId>io.jsonwebtoken</groupId><artifactId>jjwt-jackson</artifactId><version>0.12.7</version><scope>runtime</scope></dependency><!-- 接口文档生成 --><dependency><groupId>org.springdoc</groupId><artifactId>springdoc-openapi-starter-webmvc-ui</artifactId><version>3.0.3</version></dependency><!-- OSS --><dependency><groupId>com.aliyun.oss</groupId><artifactId>aliyun-sdk-oss</artifactId><version>3.17.4</version></dependency><!-- other --><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><scope>provided</scope></dependency><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>4.0.0</version></dependency></dependencies>
统一响应类
package com.ethercraft.result;
import com.ethercraft.constant.ResultStatus;import lombok.AllArgsConstructor;import lombok.Getter;
@AllArgsConstructor@Getterpublic class Result<T> { private final int code; private final String message; private final T data;
public static <T> Result<T> success(T data) { return new Result<>(ResultStatus.SUCCESS, "Success", data); }
public static Result<Void> success() { return new Result<>(ResultStatus.SUCCESS, "Success", null); }
public static Result<Void> fail() { return new Result<>(ResultStatus.FAIL, "Fail", null); }}文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
相关文章 智能推荐
1
2-mysql
web 无
2
2-数据结构-绪论
模板 考研
3
10-Obsidian设置模板
杂项 杂项
4
1-数据结构-前置基础
模板 考研
5
19-数论
数学 数学
随机文章 随机推荐