Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KnowledgePlanet
road-map
xfg-frame-mvc
提交
70c26a5e
xfg-frame-mvc
项目概览
KnowledgePlanet
/
road-map
/
xfg-frame-mvc
通知
429
Star
24
Fork
21
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
xfg-frame-mvc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
70c26a5e
编写于
6月 23, 2023
作者:
小傅哥
⛹
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小傅哥,feat:架构的本质之 MVC 架构
上级
0b2c1b2b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
19 deletion
+18
-19
src/main/java/cn/bugstack/xfg/frame/controller/UserController.java
...java/cn/bugstack/xfg/frame/controller/UserController.java
+3
-3
src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java
src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java
+2
-2
src/main/java/cn/bugstack/xfg/frame/domain/vo/UserVO.java
src/main/java/cn/bugstack/xfg/frame/domain/vo/UserVO.java
+1
-1
src/main/java/cn/bugstack/xfg/frame/service/IUserService.java
...main/java/cn/bugstack/xfg/frame/service/IUserService.java
+3
-4
src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java
...a/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java
+6
-6
src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java
src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java
+3
-3
未找到文件。
src/main/java/cn/bugstack/xfg/frame/controller/UserController.java
浏览文件 @
70c26a5e
...
@@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.controller;
...
@@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.controller;
import
cn.bugstack.xfg.frame.common.Result
;
import
cn.bugstack.xfg.frame.common.Result
;
import
cn.bugstack.xfg.frame.domain.res.UserRes
;
import
cn.bugstack.xfg.frame.domain.res.UserRes
;
import
cn.bugstack.xfg.frame.domain.vo.User
Info
;
import
cn.bugstack.xfg.frame.domain.vo.User
VO
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -25,8 +25,8 @@ public class UserController {
...
@@ -25,8 +25,8 @@ public class UserController {
public
UserRes
queryUserInfo
()
{
public
UserRes
queryUserInfo
()
{
try
{
try
{
log
.
info
(
"查询用户信息"
);
log
.
info
(
"查询用户信息"
);
List
<
User
Info
>
userInfo
List
=
userService
.
queryUserList
();
List
<
User
VO
>
userVO
List
=
userService
.
queryUserList
();
return
UserRes
.
builder
().
user
Infos
(
userInfo
List
).
result
(
Result
.
buildSuccess
()).
build
();
return
UserRes
.
builder
().
user
VOList
(
userVO
List
).
result
(
Result
.
buildSuccess
()).
build
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"查询用户信息失败"
,
e
);
log
.
error
(
"查询用户信息失败"
,
e
);
return
UserRes
.
builder
().
result
(
Result
.
buildSuccess
()).
build
();
return
UserRes
.
builder
().
result
(
Result
.
buildSuccess
()).
build
();
...
...
src/main/java/cn/bugstack/xfg/frame/domain/res/UserRes.java
浏览文件 @
70c26a5e
package
cn.bugstack.xfg.frame.domain.res
;
package
cn.bugstack.xfg.frame.domain.res
;
import
cn.bugstack.xfg.frame.common.Result
;
import
cn.bugstack.xfg.frame.common.Result
;
import
cn.bugstack.xfg.frame.domain.vo.User
Info
;
import
cn.bugstack.xfg.frame.domain.vo.User
VO
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -16,6 +16,6 @@ import java.util.List;
...
@@ -16,6 +16,6 @@ import java.util.List;
public
class
UserRes
{
public
class
UserRes
{
private
Result
result
;
private
Result
result
;
private
List
<
User
Info
>
userInfos
;
private
List
<
User
VO
>
userVOList
;
}
}
src/main/java/cn/bugstack/xfg/frame/domain/vo/User
Info
.java
→
src/main/java/cn/bugstack/xfg/frame/domain/vo/User
VO
.java
浏览文件 @
70c26a5e
...
@@ -11,7 +11,7 @@ import java.util.Date;
...
@@ -11,7 +11,7 @@ import java.util.Date;
@AllArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@NoArgsConstructor
@Builder
@Builder
public
class
User
Info
{
public
class
User
VO
{
/** 用户名称 */
/** 用户名称 */
private
String
userId
;
private
String
userId
;
...
...
src/main/java/cn/bugstack/xfg/frame/service/IUserService.java
浏览文件 @
70c26a5e
package
cn.bugstack.xfg.frame.service
;
package
cn.bugstack.xfg.frame.service
;
import
cn.bugstack.xfg.frame.domain.req.UserReq
;
import
cn.bugstack.xfg.frame.domain.vo.UserVO
;
import
cn.bugstack.xfg.frame.domain.vo.UserInfo
;
import
java.util.List
;
import
java.util.List
;
public
interface
IUserService
{
public
interface
IUserService
{
List
<
User
Info
>
queryUserList
();
List
<
User
VO
>
queryUserList
();
User
Info
queryUserInfo
(
String
uId
);
User
VO
queryUserInfo
(
String
uId
);
}
}
src/main/java/cn/bugstack/xfg/frame/service/impl/UserServiceImpl.java
浏览文件 @
70c26a5e
...
@@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.service.impl;
...
@@ -2,7 +2,7 @@ package cn.bugstack.xfg.frame.service.impl;
import
cn.bugstack.xfg.frame.dao.IUserDao
;
import
cn.bugstack.xfg.frame.dao.IUserDao
;
import
cn.bugstack.xfg.frame.domain.po.User
;
import
cn.bugstack.xfg.frame.domain.po.User
;
import
cn.bugstack.xfg.frame.domain.vo.User
Info
;
import
cn.bugstack.xfg.frame.domain.vo.User
VO
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -19,11 +19,11 @@ public class UserServiceImpl implements IUserService {
...
@@ -19,11 +19,11 @@ public class UserServiceImpl implements IUserService {
private
IUserDao
userDao
;
private
IUserDao
userDao
;
@Override
@Override
public
List
<
User
Info
>
queryUserList
()
{
public
List
<
User
VO
>
queryUserList
()
{
List
<
User
Info
>
userInfoList
=
new
ArrayList
<>();
List
<
User
VO
>
userInfoList
=
new
ArrayList
<>();
List
<
User
>
users
=
userDao
.
queryUserList
();
List
<
User
>
users
=
userDao
.
queryUserList
();
for
(
User
user
:
users
)
{
for
(
User
user
:
users
)
{
User
Info
userInfo
=
UserInfo
.
builder
()
User
VO
userInfo
=
UserVO
.
builder
()
.
userId
(
user
.
getUserId
())
.
userId
(
user
.
getUserId
())
.
userNickname
(
user
.
getUserNickname
())
.
userNickname
(
user
.
getUserNickname
())
.
createTime
(
user
.
getCreateTime
())
.
createTime
(
user
.
getCreateTime
())
...
@@ -34,9 +34,9 @@ public class UserServiceImpl implements IUserService {
...
@@ -34,9 +34,9 @@ public class UserServiceImpl implements IUserService {
}
}
@Override
@Override
public
User
Info
queryUserInfo
(
String
uId
)
{
public
User
VO
queryUserInfo
(
String
uId
)
{
log
.
info
(
"查询用户信息:{}"
,
uId
);
log
.
info
(
"查询用户信息:{}"
,
uId
);
return
new
User
Info
();
return
new
User
VO
();
}
}
}
}
src/test/java/cn/bugstack/xfg/frame/test/ApiTest.java
浏览文件 @
70c26a5e
package
cn.bugstack.xfg.frame.test
;
package
cn.bugstack.xfg.frame.test
;
import
cn.bugstack.xfg.frame.domain.vo.User
Info
;
import
cn.bugstack.xfg.frame.domain.vo.User
VO
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
cn.bugstack.xfg.frame.service.IUserService
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -22,8 +22,8 @@ public class ApiTest {
...
@@ -22,8 +22,8 @@ public class ApiTest {
@Test
@Test
public
void
test_queryUserList
()
{
public
void
test_queryUserList
()
{
List
<
User
Info
>
userInfo
List
=
userService
.
queryUserList
();
List
<
User
VO
>
userVO
List
=
userService
.
queryUserList
();
log
.
info
(
"测试结果:{}"
,
JSON
.
toJSONString
(
user
Info
List
));
log
.
info
(
"测试结果:{}"
,
JSON
.
toJSONString
(
user
VO
List
));
}
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录