修复内容:

- UserController.java:25-30 - 将通配符导入改为显式导入
  - UserController.java:85-86 - 使用完全限定名消除Swagger注解歧义
  - 确保Spring的@RequestBody正确绑定Map参数
This commit is contained in:
75681 2025-08-13 11:19:59 +08:00
parent c01bec129f
commit ad9efdbdd8
4 changed files with 14 additions and 6 deletions

View File

@ -22,7 +22,12 @@ import io.swagger.v3.oas.annotations.parameters.RequestBody;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -47,7 +52,7 @@ public class UserController {
private String privateKey;
@Operation(summary = "1.业务系统登录接口",
requestBody = @RequestBody(description = "登录数据",
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "登录数据",
content = @Content(examples = @ExampleObject(value = "{\"username\":\"用户名\",\"password\":\"密码\",\"vcode\":\"验证码\",\"userId\":\"用户ID(可选)\"}"))))
@PostMapping("/loginBusiness")
public RestResult<String> loginBusiness(@RequestBody Map<String, String> data, HttpServletRequest request) throws Exception {
@ -77,7 +82,7 @@ public class UserController {
}
@Operation(summary = "2.工程师登录接口",
requestBody = @RequestBody(description = "登录数据",
requestBody = @io.swagger.v3.oas.annotations.parameters.RequestBody(description = "登录数据",
content = @Content(examples = @ExampleObject(value = "{\"username\":\"用户名\",\"password\":\"密码\",\"vcode\":\"验证码\"}"))))
@PostMapping("/loginEngineer")
public RestResult<String> loginEngineer(@RequestBody Map<String, String> data, HttpServletRequest request) throws Exception {

View File

@ -7,11 +7,11 @@ logging:
spring:
datasource:
youfool:
url: jdbc:postgresql://172.22.80.157:5432/devops_gd
url: jdbc:postgresql://172.22.80.157:5432/devops_gd?currentSchema=public
username: devops_gd
password: ChinaWeal@2024
devops:
url: jdbc:postgresql://172.22.80.157:5432/devops_gd
url: jdbc:postgresql://172.22.80.157:5432/devops_gd?currentSchema=public
username: devops_gd
password: ChinaWeal@2024
main:

View File

@ -15,6 +15,9 @@ spring:
url: jdbc:postgresql://172.22.80.157:5432/devops_gd
username: devops_gd
password: ChinaWeal@2024
main:
# Spring Boot 2.7+新增:允许循环依赖(临时修复,后续需重构代码消除循环依赖)
allow-circular-references: true
file:
devopsDir: D:\project\devops-gd\upload

View File

@ -3,7 +3,7 @@ logging:
root: info
spring:
profiles:
active: dev
active: prod
application:
name: youfoo-devops
datasource: