- 新增文件上传接口,支持multipart/form-data格式 - 配置Spring Servlet multipart参数,设置文件大小限制 - 添加Feign客户端配置,支持表单提交 - 实现Feign请求拦截器,传递用户上下文信息 - 创建OSS服务API接口,用于文件上传 - 在用户服务中集成OSS RPC调用,实现头像和背景图上传 - 添加上传失败的业务异常处理 - 更新pom.xml依赖,引入OpenFeign、负载均衡及Feign表单相关组件 - 定义API常量和服务名称 - 启用Feign客户端扫描,支持跨服务调用
44 lines
1.5 KiB
XML
44 lines
1.5 KiB
XML
<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>com.hanserwei</groupId>
|
|
<artifactId>han-note-oss</artifactId>
|
|
<version>${revision}</version>
|
|
</parent>
|
|
|
|
<!-- 打包方式 -->
|
|
<packaging>jar</packaging>
|
|
|
|
<artifactId>han-note-oss-api</artifactId>
|
|
<name>${project.artifactId}</name>
|
|
<description>RPC层, 供其他服务调用</description>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>com.hanserwei</groupId>
|
|
<artifactId>hanserwei-common</artifactId>
|
|
</dependency>
|
|
<!-- OpenFeign -->
|
|
<dependency>
|
|
<groupId>org.springframework.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
|
</dependency>
|
|
<!-- 负载均衡 -->
|
|
<dependency>
|
|
<groupId>org.springframework.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
|
</dependency>
|
|
<!-- Feign 表单提交 -->
|
|
<dependency>
|
|
<groupId>io.github.openfeign.form</groupId>
|
|
<artifactId>feign-form-spring</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.github.openfeign.form</groupId>
|
|
<artifactId>feign-form</artifactId>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|