From 0d10bc99eec75672b049339399e4f762fbd9746e Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 11 九月 2026 11:45:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java |  337 +++++++++++++++++++++++++------------------------------
 1 files changed, 154 insertions(+), 183 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
index b4f6bac..b9ce0ce 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java
@@ -1,183 +1,154 @@
-package com.ruoyi.web.controller.tool;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.utils.StringUtils;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiImplicitParam;
-import io.swagger.annotations.ApiImplicitParams;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
-
-/**
- * swagger 鐢ㄦ埛娴嬭瘯鏂规硶
- * 
- * @author ruoyi
- */
-@Api("鐢ㄦ埛淇℃伅绠$悊")
-@RestController
-@RequestMapping("/test/user")
-public class TestController extends BaseController
-{
-    private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
-    {
-        users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
-        users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
-    }
-
-    @ApiOperation("鑾峰彇鐢ㄦ埛鍒楄〃")
-    @GetMapping("/list")
-    public R<List<UserEntity>> userList()
-    {
-        List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
-        return R.ok(userList);
-    }
-
-    @ApiOperation("鑾峰彇鐢ㄦ埛璇︾粏")
-    @ApiImplicitParam(name = "userId", value = "鐢ㄦ埛ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
-    @GetMapping("/{userId}")
-    public R<UserEntity> getUser(@PathVariable Integer userId)
-    {
-        if (!users.isEmpty() && users.containsKey(userId))
-        {
-            return R.ok(users.get(userId));
-        }
-        else
-        {
-            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
-        }
-    }
-
-    @ApiOperation("鏂板鐢ㄦ埛")
-    @ApiImplicitParams({
-        @ApiImplicitParam(name = "userId", value = "鐢ㄦ埛id", dataType = "Integer", dataTypeClass = Integer.class),
-        @ApiImplicitParam(name = "username", value = "鐢ㄦ埛鍚嶇О", dataType = "String", dataTypeClass = String.class),
-        @ApiImplicitParam(name = "password", value = "鐢ㄦ埛瀵嗙爜", dataType = "String", dataTypeClass = String.class),
-        @ApiImplicitParam(name = "mobile", value = "鐢ㄦ埛鎵嬫満", dataType = "String", dataTypeClass = String.class)
-    })
-    @PostMapping("/save")
-    public R<String> save(UserEntity user)
-    {
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
-        {
-            return R.fail("鐢ㄦ埛ID涓嶈兘涓虹┖");
-        }
-        users.put(user.getUserId(), user);
-        return R.ok();
-    }
-
-    @ApiOperation("鏇存柊鐢ㄦ埛")
-    @PutMapping("/update")
-    public R<String> update(@RequestBody UserEntity user)
-    {
-        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId()))
-        {
-            return R.fail("鐢ㄦ埛ID涓嶈兘涓虹┖");
-        }
-        if (users.isEmpty() || !users.containsKey(user.getUserId()))
-        {
-            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
-        }
-        users.remove(user.getUserId());
-        users.put(user.getUserId(), user);
-        return R.ok();
-    }
-
-    @ApiOperation("鍒犻櫎鐢ㄦ埛淇℃伅")
-    @ApiImplicitParam(name = "userId", value = "鐢ㄦ埛ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
-    @DeleteMapping("/{userId}")
-    public R<String> delete(@PathVariable Integer userId)
-    {
-        if (!users.isEmpty() && users.containsKey(userId))
-        {
-            users.remove(userId);
-            return R.ok();
-        }
-        else
-        {
-            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
-        }
-    }
-}
-
-@ApiModel(value = "UserEntity", description = "鐢ㄦ埛瀹炰綋")
-class UserEntity
-{
-    @ApiModelProperty("鐢ㄦ埛ID")
-    private Integer userId;
-
-    @ApiModelProperty("鐢ㄦ埛鍚嶇О")
-    private String username;
-
-    @ApiModelProperty("鐢ㄦ埛瀵嗙爜")
-    private String password;
-
-    @ApiModelProperty("鐢ㄦ埛鎵嬫満")
-    private String mobile;
-
-    public UserEntity()
-    {
-
-    }
-
-    public UserEntity(Integer userId, String username, String password, String mobile)
-    {
-        this.userId = userId;
-        this.username = username;
-        this.password = password;
-        this.mobile = mobile;
-    }
-
-    public Integer getUserId()
-    {
-        return userId;
-    }
-
-    public void setUserId(Integer userId)
-    {
-        this.userId = userId;
-    }
-
-    public String getUsername()
-    {
-        return username;
-    }
-
-    public void setUsername(String username)
-    {
-        this.username = username;
-    }
-
-    public String getPassword()
-    {
-        return password;
-    }
-
-    public void setPassword(String password)
-    {
-        this.password = password;
-    }
-
-    public String getMobile()
-    {
-        return mobile;
-    }
-
-    public void setMobile(String mobile)
-    {
-        this.mobile = mobile;
-    }
-}
+//package com.ruoyi.web.controller.tool;
+//
+//import java.util.ArrayList;
+//import java.util.LinkedHashMap;
+//import java.util.List;
+//import java.util.Map;
+//
+//import org.springframework.web.bind.annotation.DeleteMapping;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.PathVariable;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.PutMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//import com.ruoyi.common.core.controller.BaseController;
+//import com.ruoyi.common.core.domain.R;
+//import com.ruoyi.common.utils.StringUtils;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiImplicitParam;
+//import io.swagger.annotations.ApiImplicitParams;
+//import io.swagger.annotations.ApiModel;
+//import io.swagger.annotations.ApiModelProperty;
+//import io.swagger.annotations.ApiOperation;
+//
+///**
+// * swagger 鐢ㄦ埛娴嬭瘯鏂规硶
+// *
+// * @author ruoyi
+// */
+//@Api("鐢ㄦ埛淇℃伅绠$悊")
+//@RestController
+//@RequestMapping("/test/user")
+//public class TestController extends BaseController {
+//    private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
+//
+//    {
+//        users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
+//        users.put(2, new UserEntity(2, "ry", "admin123", "15666666666"));
+//    }
+//
+//    @ApiOperation("鑾峰彇鐢ㄦ埛鍒楄〃")
+//    @GetMapping("/list")
+//    public R<List<UserEntity>> userList() {
+//        List<UserEntity> userList = new ArrayList<UserEntity>(users.values());
+//        return R.ok(userList);
+//    }
+//
+//    @ApiOperation("鑾峰彇鐢ㄦ埛璇︾粏")
+//    @ApiImplicitParam(name = "userId", value = "鐢ㄦ埛ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
+//    @GetMapping("/{userId}")
+//    public R<UserEntity> getUser(@PathVariable Integer userId) {
+//        if (!users.isEmpty() && users.containsKey(userId)) {
+//            return R.ok(users.get(userId));
+//        } else {
+//            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
+//        }
+//    }
+//
+//    @ApiOperation("鏂板鐢ㄦ埛")
+//    @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "鐢ㄦ埛id", dataType = "Integer", dataTypeClass = Integer.class), @ApiImplicitParam(name = "username", value = "鐢ㄦ埛鍚嶇О", dataType = "String", dataTypeClass = String.class), @ApiImplicitParam(name = "password", value = "鐢ㄦ埛瀵嗙爜", dataType = "String", dataTypeClass = String.class), @ApiImplicitParam(name = "mobile", value = "鐢ㄦ埛鎵嬫満", dataType = "String", dataTypeClass = String.class)})
+//    @PostMapping("/save")
+//    public R<String> save(UserEntity user) {
+//        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
+//            return R.fail("鐢ㄦ埛ID涓嶈兘涓虹┖");
+//        }
+//        users.put(user.getUserId(), user);
+//        return R.ok();
+//    }
+//
+//    @ApiOperation("鏇存柊鐢ㄦ埛")
+//    @PutMapping("/update")
+//    public R<String> update(@RequestBody UserEntity user) {
+//        if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) {
+//            return R.fail("鐢ㄦ埛ID涓嶈兘涓虹┖");
+//        }
+//        if (users.isEmpty() || !users.containsKey(user.getUserId())) {
+//            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
+//        }
+//        users.remove(user.getUserId());
+//        users.put(user.getUserId(), user);
+//        return R.ok();
+//    }
+//
+//    @ApiOperation("鍒犻櫎鐢ㄦ埛淇℃伅")
+//    @ApiImplicitParam(name = "userId", value = "鐢ㄦ埛ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
+//    @GetMapping("/{userId}")
+//    public R<String> delete(@PathVariable Integer userId) {
+//        if (!users.isEmpty() && users.containsKey(userId)) {
+//            users.remove(userId);
+//            return R.ok();
+//        } else {
+//            return R.fail("鐢ㄦ埛涓嶅瓨鍦�");
+//        }
+//    }
+//}
+//
+//@ApiModel(value = "UserEntity", description = "鐢ㄦ埛瀹炰綋")
+//class UserEntity {
+//    @ApiModelProperty("鐢ㄦ埛ID")
+//    private Integer userId;
+//
+//    @ApiModelProperty("鐢ㄦ埛鍚嶇О")
+//    private String username;
+//
+//    @ApiModelProperty("鐢ㄦ埛瀵嗙爜")
+//    private String password;
+//
+//    @ApiModelProperty("鐢ㄦ埛鎵嬫満")
+//    private String mobile;
+//
+//    public UserEntity() {
+//
+//    }
+//
+//    public UserEntity(Integer userId, String username, String password, String mobile) {
+//        this.userId = userId;
+//        this.username = username;
+//        this.password = password;
+//        this.mobile = mobile;
+//    }
+//
+//    public Integer getUserId() {
+//        return userId;
+//    }
+//
+//    public void setUserId(Integer userId) {
+//        this.userId = userId;
+//    }
+//
+//    public String getUsername() {
+//        return username;
+//    }
+//
+//    public void setUsername(String username) {
+//        this.username = username;
+//    }
+//
+//    public String getPassword() {
+//        return password;
+//    }
+//
+//    public void setPassword(String password) {
+//        this.password = password;
+//    }
+//
+//    public String getMobile() {
+//        return mobile;
+//    }
+//
+//    public void setMobile(String mobile) {
+//        this.mobile = mobile;
+//    }
+//}

--
Gitblit v1.9.3