Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
李苗
/
Vion-DevOps
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit cc04b388
authored
Nov 29, 2023
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[add] 添加注销接口
[chg] 拦截器优化以及合同接口优化
1 parent
0cefa4b3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
src/main/java/vion/controller/ContractController.java
src/main/java/vion/controller/ContractPaymentController.java
src/main/java/vion/controller/UserController.java
src/main/java/vion/interceptor/StpInterfaceImpl.java
src/main/java/vion/controller/ContractController.java
View file @
cc04b38
...
...
@@ -46,8 +46,8 @@ public class ContractController {
}
@PostMapping
(
"/contract/store"
)
@SaCheckPermission
(
value
=
"contract:store
"
,
orRole
=
"admin"
)
public
String
s
s
(
List
<
RContractStore
>
contractStoreList
)
{
@SaCheckPermission
(
value
=
"contract:store
:edit"
,
orRole
=
"admin"
)
public
String
s
aveOrUpdateRContractStore
(
@RequestBody
List
<
RContractStore
>
contractStoreList
)
{
return
contractStoreService
.
saveBatch
(
contractStoreList
)
?
"更新成功"
:
"更新失败"
;
}
...
...
src/main/java/vion/controller/ContractPaymentController.java
View file @
cc04b38
...
...
@@ -23,7 +23,7 @@ public class ContractPaymentController {
@PostMapping
(
"/contractPayment"
)
@SaCheckPermission
(
value
=
"contractPayment:edit"
,
orRole
=
"admin"
)
public
String
updPayment
(
List
<
ContractPaymentDTO
>
dtoList
)
{
public
String
updPayment
(
@RequestBody
List
<
ContractPaymentDTO
>
dtoList
)
{
return
contractPaymentService
.
saveBatch
(
converter
.
convert
(
dtoList
,
ContractPayment
.
class
))
?
"更新成功"
:
"更新失败"
;
}
...
...
src/main/java/vion/controller/UserController.java
View file @
cc04b38
package
vion
.
controller
;
import
cn.dev33.satoken.annotation.SaCheckPermission
;
import
cn.dev33.satoken.stp.StpUtil
;
import
cn.hutool.core.lang.Opt
;
import
cn.hutool.core.lang.tree.Tree
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -90,6 +91,12 @@ public class UserController {
return
dingMod
.
dingCallback
(
target
,
dto
,
res
);
}
@GetMapping
(
"/logout/{id}"
)
public
String
logout
(
@PathVariable
Long
id
)
{
StpUtil
.
logout
(
id
);
return
"注销成功"
;
}
@GetMapping
(
"/wechat/callback"
)
public
Object
wechatCallback
(
String
code
,
Long
taskTempId
)
{
Object
obj
=
wechatMod
.
wechatCallback
(
code
);
...
...
src/main/java/vion/interceptor/StpInterfaceImpl.java
View file @
cc04b38
...
...
@@ -2,6 +2,8 @@ package vion.interceptor;
import
cn.dev33.satoken.stp.StpInterface
;
import
cn.dev33.satoken.stp.StpUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.lang.Opt
;
import
org.springframework.stereotype.Component
;
import
vion.vo.RoleVO
;
import
vion.vo.UserVO
;
...
...
@@ -26,6 +28,6 @@ public class StpInterfaceImpl implements StpInterface {
public
List
<
String
>
getRoleList
(
Object
loginId
,
String
loginType
)
{
UserVO
userVO
=
(
UserVO
)
StpUtil
.
getTokenSession
().
get
(
"curLoginUser"
);
List
<
RoleVO
>
roleVOList
=
userVO
.
getRoleVOList
();
return
roleVOList
.
stream
().
map
(
RoleVO:
:
getCode
).
collect
(
Collectors
.
toList
());
return
Opt
.
ofEmptyAble
(
roleVOList
).
map
(
list
->
list
.
stream
().
map
(
RoleVO:
:
getCode
).
collect
(
Collectors
.
toList
())).
orElse
(
ListUtil
.
empty
());
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment