diff --git a/src/main/java/cn/bugstack/xfg/frame/controller/UserController.java b/src/main/java/cn/bugstack/xfg/frame/controller/UserController.java index 87a1af78908ed3bc32794ce348f04fa0801a26e6..a69fc2fccd14c773db93449fb60fd1f469fbf752 100644 --- a/src/main/java/cn/bugstack/xfg/frame/controller/UserController.java +++ b/src/main/java/cn/bugstack/xfg/frame/controller/UserController.java @@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.controller; import cn.bugstack.xfg.frame.common.Result; import cn.bugstack.xfg.frame.domain.res.UserRes; -import cn.bugstack.xfg.frame.domain.vo.UserInfo; +import cn.bugstack.xfg.frame.domain.vo.UserVO; import cn.bugstack.xfg.frame.service.IUserService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.RequestMapping; @@ -25,8 +25,8 @@ public class UserController { public UserRes queryUserInfo() { try { log.info("查询用户信息"); - List userInfoList = userService.queryUserList(); - return UserRes.builder().userInfos(userInfoList).result(Result.buildSuccess()).build(); + List userVOList = userService.queryUserList(); + return UserRes.builder().userVOList(userVOList).result(Result.buildSuccess()).build(); } catch (Exception e) { log.error("查询用户信息失败", e); return UserRes.builder().result(Result.buildSuccess()).build(); diff --git a/src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java b/src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java index fbb01e99994935f9ddbf6205c82d6d5fe74084b6..967560c2d19f8b687a7ccd882e320d9107a1a084 100644 --- a/src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java +++ b/src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java @@ -1,7 +1,7 @@ package cn.bugstack.xfg.frame.domain.res; import cn.bugstack.xfg.frame.common.Result; -import cn.bugstack.xfg.frame.domain.vo.UserInfo; +import cn.bugstack.xfg.frame.domain.vo.UserVO; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -16,6 +16,6 @@ import java.util.List; public class UserRes { private Result result; - private List userInfos; + private List userVOList; } diff --git a/src/main/java/cn/bugstack/xfg/frame/domain/vo/UserInfo.java b/src/main/java/cn/bugstack/xfg/frame/domain/vo/UserVO.java similarity index 94% rename from src/main/java/cn/bugstack/xfg/frame/domain/vo/UserInfo.java rename to src/main/java/cn/bugstack/xfg/frame/domain/vo/UserVO.java index d843cfd790b1509033a8406a9f0e0a7c8984ccb5..f19932cb4174d17b0ad2eadf05c4a1f8125737e2 100644 --- a/src/main/java/cn/bugstack/xfg/frame/domain/vo/UserInfo.java +++ b/src/main/java/cn/bugstack/xfg/frame/domain/vo/UserVO.java @@ -11,7 +11,7 @@ import java.util.Date; @AllArgsConstructor @NoArgsConstructor @Builder -public class UserInfo { +public class UserVO { /** 用户名称 */ private String userId; diff --git a/src/main/java/cn/bugstack/xfg/frame/service/IUserService.java b/src/main/java/cn/bugstack/xfg/frame/service/IUserService.java index 1fe67cf3e9185289de3b4f658bd42f4f7a4ed2b4..06d0b07e9f8db6bd291f6db8eb392a90f838a7fc 100644 --- a/src/main/java/cn/bugstack/xfg/frame/service/IUserService.java +++ b/src/main/java/cn/bugstack/xfg/frame/service/IUserService.java @@ -1,14 +1,13 @@ package cn.bugstack.xfg.frame.service; -import cn.bugstack.xfg.frame.domain.req.UserReq; -import cn.bugstack.xfg.frame.domain.vo.UserInfo; +import cn.bugstack.xfg.frame.domain.vo.UserVO; import java.util.List; public interface IUserService { - List queryUserList(); + List queryUserList(); - UserInfo queryUserInfo(String uId); + UserVO queryUserInfo(String uId); } diff --git a/src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java b/src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java index 998501fd42022df801bf6b8a0f41428cc0dcbe5a..67aa9b37755f96475fb2f9b601590900673c94f1 100644 --- a/src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java +++ b/src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java @@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.service.impl; import cn.bugstack.xfg.frame.dao.IUserDao; import cn.bugstack.xfg.frame.domain.po.User; -import cn.bugstack.xfg.frame.domain.vo.UserInfo; +import cn.bugstack.xfg.frame.domain.vo.UserVO; import cn.bugstack.xfg.frame.service.IUserService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -19,11 +19,11 @@ public class UserServiceImpl implements IUserService { private IUserDao userDao; @Override - public List queryUserList() { - List userInfoList = new ArrayList<>(); + public List queryUserList() { + List userInfoList = new ArrayList<>(); List users = userDao.queryUserList(); for (User user : users) { - UserInfo userInfo = UserInfo.builder() + UserVO userInfo = UserVO.builder() .userId(user.getUserId()) .userNickname(user.getUserNickname()) .createTime(user.getCreateTime()) @@ -34,9 +34,9 @@ public class UserServiceImpl implements IUserService { } @Override - public UserInfo queryUserInfo(String uId) { + public UserVO queryUserInfo(String uId) { log.info("查询用户信息:{}", uId); - return new UserInfo(); + return new UserVO(); } } diff --git a/src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java b/src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java index f60b0fc5b7ebff153b7ef74d6ad5ea01725af071..282bc227660e4d1ac998a31e88141683374953f9 100644 --- a/src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java +++ b/src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java @@ -1,6 +1,6 @@ package cn.bugstack.xfg.frame.test; -import cn.bugstack.xfg.frame.domain.vo.UserInfo; +import cn.bugstack.xfg.frame.domain.vo.UserVO; import cn.bugstack.xfg.frame.service.IUserService; import com.alibaba.fastjson.JSON; import lombok.extern.slf4j.Slf4j; @@ -22,8 +22,8 @@ public class ApiTest { @Test public void test_queryUserList() { - List userInfoList = userService.queryUserList(); - log.info("测试结果:{}", JSON.toJSONString(userInfoList)); + List userVOList = userService.queryUserList(); + log.info("测试结果:{}", JSON.toJSONString(userVOList)); } }