Bladeren bron

feat(applet): 迁移用户信息接口至独立控制器

- 将 getUserInfo 接口从 AppletHomeController 迁移至新的 AppletUserController
- 新增 AppletUserController 控制器并配置相关依赖注入
- 保留原有接口功能及文档注解
- 更新请求路径前缀为 /applet/v1/user
- 移除原 AppletHomeController 中冗余的 userInfoService 注入
wzq 1 dag geleden
bovenliggende
commit
f66ff67784

+ 0 - 9
src/main/java/com/zsElectric/boot/business/controller/applet/AppletHomeController.java

@@ -24,15 +24,6 @@ import org.springframework.web.bind.annotation.RestController;
 @RequiredArgsConstructor
 public class AppletHomeController {
 
-    private final UserInfoService userInfoService;
-
-    @Operation(summary = "微信小程序获取当前登录信息")
-    @GetMapping("/getUserInfo")
-    public Result<UserInfoVO> getUserInfo() {
-        UserInfoVO currentUserInfo = userInfoService.getCurrentUserInfo();
-        return Result.success(currentUserInfo);
-    }
-
     private final AppletHomeService appletHomeService;
 
     /**

+ 27 - 0
src/main/java/com/zsElectric/boot/business/controller/applet/AppletUserController.java

@@ -0,0 +1,27 @@
+package com.zsElectric.boot.business.controller.applet;
+
+import com.zsElectric.boot.business.model.vo.UserInfoVO;
+import com.zsElectric.boot.business.service.UserInfoService;
+import com.zsElectric.boot.core.web.Result;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@Tag(name = "用户相关接口")
+@RestController
+@RequestMapping("/applet/v1/user")
+@RequiredArgsConstructor
+public class AppletUserController {
+
+    private final UserInfoService userInfoService;
+
+    @Operation(summary = "微信小程序获取当前登录信息")
+    @GetMapping("/getUserInfo")
+    public Result<UserInfoVO> getUserInfo() {
+        UserInfoVO currentUserInfo = userInfoService.getCurrentUserInfo();
+        return Result.success(currentUserInfo);
+    }
+}

+ 0 - 4
src/main/java/com/zsElectric/boot/business/controller/applet/TestController.java

@@ -1,4 +0,0 @@
-package com.zsElectric.boot.business.controller.applet;
-
-public class TestController {
-}