Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service
Commits
f6e3fb00
Commit
f6e3fb00
authored
Jul 27, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 用户类型接口
parent
f35564e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
12 deletions
+17
-12
HomeCommonController.java
...rvice/miniapp/controller/common/HomeCommonController.java
+2
-2
UserController.java
...onsiteservice/miniapp/controller/user/UserController.java
+6
-0
HomeCommonService.java
...teservice/miniapp/service/category/HomeCommonService.java
+1
-10
UserService.java
...a/com/onsiteservice/miniapp/service/user/UserService.java
+8
-0
No files found.
mini-app/src/main/java/com/onsiteservice/miniapp/controller/common/HomeCommonController.java
View file @
f6e3fb00
...
@@ -33,8 +33,8 @@ public class HomeCommonController {
...
@@ -33,8 +33,8 @@ public class HomeCommonController {
@ApiOperation
(
value
=
"首页"
)
@ApiOperation
(
value
=
"首页"
)
@GetMapping
(
"home"
)
@GetMapping
(
"home"
)
public
Result
<
HomeViewVO
>
home
(
@CurrentUserId
Long
userId
)
{
public
Result
<
HomeViewVO
>
home
()
{
return
homeCommonService
.
home
(
userId
);
return
homeCommonService
.
home
();
}
}
@ApiOperation
(
value
=
"地域树"
)
@ApiOperation
(
value
=
"地域树"
)
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/controller/user/UserController.java
View file @
f6e3fb00
...
@@ -47,5 +47,11 @@ public class UserController {
...
@@ -47,5 +47,11 @@ public class UserController {
return
ResultGenerator
.
success
(
userService
.
getInfo
(
userId
));
return
ResultGenerator
.
success
(
userService
.
getInfo
(
userId
));
}
}
@ApiOperation
(
"用户身份 0 普通用户 1 客服 2 估价员 3 销售"
)
@GetMapping
(
"/role-type"
)
public
Result
<
Integer
>
getRoleType
(
@CurrentUserId
Long
userId
)
{
return
ResultGenerator
.
success
(
userService
.
getRoleType
(
userId
));
}
}
}
mini-app/src/main/java/com/onsiteservice/miniapp/service/category/HomeCommonService.java
View file @
f6e3fb00
...
@@ -64,7 +64,7 @@ public class HomeCommonService {
...
@@ -64,7 +64,7 @@ public class HomeCommonService {
private
SysParamMapper
sysParamMapper
;
private
SysParamMapper
sysParamMapper
;
public
Result
<
HomeViewVO
>
home
(
Long
userId
)
{
public
Result
<
HomeViewVO
>
home
()
{
// 轮播图
// 轮播图
List
<
Banner
>
bannerList
=
bannerMapper
.
selectAll
();
List
<
Banner
>
bannerList
=
bannerMapper
.
selectAll
();
List
<
BannerVO
>
bannerVOList
=
bannerList
.
parallelStream
()
List
<
BannerVO
>
bannerVOList
=
bannerList
.
parallelStream
()
...
@@ -84,7 +84,6 @@ public class HomeCommonService {
...
@@ -84,7 +84,6 @@ public class HomeCommonService {
.
bannerList
(
bannerVOList
)
.
bannerList
(
bannerVOList
)
.
noticeList
(
homeNoticeVOList
)
.
noticeList
(
homeNoticeVOList
)
.
serviceList
(
serviceResult
.
getData
())
.
serviceList
(
serviceResult
.
getData
())
.
roleType
(
getRoleType
(
userId
))
.
build
();
.
build
();
return
ResultGenerator
.
success
(
homeViewVO
);
return
ResultGenerator
.
success
(
homeViewVO
);
...
@@ -110,14 +109,6 @@ public class HomeCommonService {
...
@@ -110,14 +109,6 @@ public class HomeCommonService {
return
ResultGenerator
.
success
(
list
);
return
ResultGenerator
.
success
(
list
);
}
}
private
Integer
getRoleType
(
Long
userId
)
{
if
(
userId
==
null
)
{
return
ServiceUserTypeEnum
.
USER
.
getId
();
}
Condition
condition
=
new
Condition
(
User
.
class
);
var
user
=
userMapper
.
selectByPrimaryKey
(
userId
);
return
user
.
getRoleType
();
}
public
Result
aboutUs
()
{
public
Result
aboutUs
()
{
return
ResultGenerator
.
success
(
sysParamMapper
.
selectOne
(
SysParam
.
builder
().
code
(
SysParamConstants
.
ABOUT_US
).
build
()).
getValue
(),
""
);
return
ResultGenerator
.
success
(
sysParamMapper
.
selectOne
(
SysParam
.
builder
().
code
(
SysParamConstants
.
ABOUT_US
).
build
()).
getValue
(),
""
);
...
...
mini-app/src/main/java/com/onsiteservice/miniapp/service/user/UserService.java
View file @
f6e3fb00
...
@@ -143,4 +143,12 @@ public class UserService extends AbstractMapper<User> {
...
@@ -143,4 +143,12 @@ public class UserService extends AbstractMapper<User> {
));
));
return
vo
;
return
vo
;
}
}
public
Integer
getRoleType
(
Long
userId
)
{
if
(
userId
==
null
)
{
return
ServiceUserTypeEnum
.
USER
.
getId
();
}
var
user
=
userMapper
.
selectByPrimaryKey
(
userId
);
return
user
.
getRoleType
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment