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 e29cfbb6
authored
Jan 18, 2024
by
HlQ
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[fix] 修复控制器访问权限设置为 private,导致访问不到的 bug
1 parent
12a21868
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
16 deletions
src/main/java/vion/advice/LogAspect.java
src/main/java/vion/controller/ResourceController.java
src/main/java/vion/controller/RoleController.java
src/main/java/vion/controller/ServiceOrderController.java
src/main/java/vion/model/RPointDevice.java
src/main/java/vion/advice/LogAspect.java
View file @
e29cfbb
...
...
@@ -60,7 +60,6 @@ public class LogAspect {
}
HttpServletRequest
request
=
attributes
.
getRequest
();
// Calculate response time
long
startTime
=
(
Long
)
request
.
getAttribute
(
"startTime"
);
long
responseTime
=
System
.
currentTimeMillis
()
-
startTime
;
...
...
src/main/java/vion/controller/ResourceController.java
View file @
e29cfbb
...
...
@@ -46,14 +46,14 @@ public class ResourceController {
@PostMapping
(
"/resource"
)
@SaCheckPermission
(
value
=
"resource:save"
,
orRole
=
"admin"
)
p
rivate
String
save
(
@RequestBody
ResourceDTO
dto
)
{
p
ublic
String
save
(
@RequestBody
ResourceDTO
dto
)
{
Resource
resource
=
converter
.
convert
(
dto
,
Resource
.
class
);
return
resourceService
.
save
(
resource
)
?
"创建成功"
:
"创建失败"
;
}
@PostMapping
(
"/resource/{id}"
)
@SaCheckPermission
(
value
=
"resource:edit"
,
orRole
=
"admin"
)
p
rivate
String
update
(
@PathVariable
Long
id
,
@RequestBody
RoleDTO
dto
)
{
p
ublic
String
update
(
@PathVariable
Long
id
,
@RequestBody
RoleDTO
dto
)
{
Resource
resource
=
converter
.
convert
(
dto
,
Resource
.
class
);
resource
.
setId
(
id
);
return
resourceService
.
updateById
(
resource
)
?
"更新成功"
:
"更新失败"
;
...
...
@@ -61,7 +61,7 @@ public class ResourceController {
@DeleteMapping
(
"/resource/{id}"
)
@SaCheckPermission
(
value
=
"resource:remove"
,
orRole
=
"admin"
)
p
rivate
String
remove
(
@PathVariable
Long
id
)
{
p
ublic
String
remove
(
@PathVariable
Long
id
)
{
return
resourceService
.
removeById
(
id
)
?
"删除成功"
:
"删除失败"
;
}
...
...
src/main/java/vion/controller/RoleController.java
View file @
e29cfbb
...
...
@@ -49,7 +49,7 @@ public class RoleController {
@PostMapping
(
"/role"
)
@SaCheckPermission
(
value
=
"role:save"
,
orRole
=
"admin"
)
p
rivate
String
save
(
@RequestBody
RoleDTO
dto
)
{
p
ublic
String
save
(
@RequestBody
RoleDTO
dto
)
{
if
(
StrUtil
.
equals
(
dto
.
getCode
(),
"admin"
))
{
return
"管理员角色编码[admin]已存在,不允许再次创建"
;
}
...
...
@@ -59,7 +59,7 @@ public class RoleController {
@PostMapping
(
"/role/{id}"
)
@SaCheckPermission
(
value
=
"role:edit"
,
orRole
=
"admin"
)
p
rivate
String
update
(
@PathVariable
Long
id
,
@RequestBody
RoleDTO
dto
)
{
p
ublic
String
update
(
@PathVariable
Long
id
,
@RequestBody
RoleDTO
dto
)
{
if
(
id
==
1
)
{
return
"管理员角色不允许修改"
;
}
...
...
@@ -70,7 +70,7 @@ public class RoleController {
@DeleteMapping
(
"/role/{id}"
)
@SaCheckPermission
(
value
=
"role:remove"
,
orRole
=
"admin"
)
p
rivate
String
remove
(
@PathVariable
Long
id
)
{
p
ublic
String
remove
(
@PathVariable
Long
id
)
{
if
(
id
==
1
)
{
return
"管理员角色不允许删除"
;
}
...
...
src/main/java/vion/controller/ServiceOrderController.java
View file @
e29cfbb
...
...
@@ -48,7 +48,7 @@ public class ServiceOrderController {
@PostMapping
(
"/order"
)
@SaCheckPermission
(
value
=
"order:save"
,
orRole
=
"admin"
)
p
rivate
Object
save
(
@RequestBody
ServiceOrderDTO
serviceOrderDTO
)
{
p
ublic
Object
save
(
@RequestBody
ServiceOrderDTO
serviceOrderDTO
)
{
Long
count
=
serviceOrderService
.
lambdaQuery
().
eq
(
ServiceOrder:
:
getTaskId
,
serviceOrderDTO
.
getTaskId
()).
count
();
Assert
.
isFalse
(
count
>
0
,
"该工单已存在服务单,不能重复创建!"
);
ServiceOrder
serviceOrder
=
converter
.
convert
(
serviceOrderDTO
,
ServiceOrder
.
class
);
...
...
@@ -58,7 +58,7 @@ public class ServiceOrderController {
@PostMapping
(
"/order/{id}"
)
@SaCheckPermission
(
value
=
"order:edit"
,
orRole
=
"admin"
)
p
rivate
String
update
(
@PathVariable
Long
id
,
@RequestBody
ServiceOrderDTO
serviceOrderDTO
)
{
p
ublic
String
update
(
@PathVariable
Long
id
,
@RequestBody
ServiceOrderDTO
serviceOrderDTO
)
{
ServiceOrder
serviceOrder
=
converter
.
convert
(
serviceOrderDTO
,
ServiceOrder
.
class
);
serviceOrder
.
setId
(
id
);
return
serviceOrderService
.
updateById
(
serviceOrder
)
?
"更新成功"
:
"更新失败"
;
...
...
@@ -66,7 +66,7 @@ public class ServiceOrderController {
@DeleteMapping
(
"/order/{id}"
)
@SaCheckPermission
(
value
=
"order:remove"
,
orRole
=
"admin"
)
p
rivate
String
remove
(
@PathVariable
Long
id
)
{
p
ublic
String
remove
(
@PathVariable
Long
id
)
{
return
serviceOrderService
.
removeById
(
id
)
?
"删除成功"
:
"删除失败"
;
}
...
...
src/main/java/vion/model/RPointDevice.java
View file @
e29cfbb
package
vion
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -30,9 +28,11 @@ public class RPointDevice {
@TableField
(
value
=
"device_no"
)
private
String
deviceNo
;
@TableField
(
value
=
"create_time"
)
@TableField
(
value
=
"create_time"
,
fill
=
FieldFill
.
INSERT
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@TableField
(
value
=
"update_time"
)
@TableField
(
value
=
"update_time"
,
fill
=
FieldFill
.
INSERT_UPDATE
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
\ No newline at end of file
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