Commit e29cfbb6 by HlQ

[fix] 修复控制器访问权限设置为 private,导致访问不到的 bug

1 parent 12a21868
......@@ -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;
......
......@@ -46,14 +46,14 @@ public class ResourceController {
@PostMapping("/resource")
@SaCheckPermission(value = "resource:save", orRole = "admin")
private String save(@RequestBody ResourceDTO dto) {
public 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")
private String update(@PathVariable Long id, @RequestBody RoleDTO dto) {
public 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")
private String remove(@PathVariable Long id) {
public String remove(@PathVariable Long id) {
return resourceService.removeById(id) ? "删除成功" : "删除失败";
}
......
......@@ -49,7 +49,7 @@ public class RoleController {
@PostMapping("/role")
@SaCheckPermission(value = "role:save", orRole = "admin")
private String save(@RequestBody RoleDTO dto) {
public 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")
private String update(@PathVariable Long id, @RequestBody RoleDTO dto) {
public 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")
private String remove(@PathVariable Long id) {
public String remove(@PathVariable Long id) {
if (id == 1) {
return "管理员角色不允许删除";
}
......
......@@ -48,7 +48,7 @@ public class ServiceOrderController {
@PostMapping("/order")
@SaCheckPermission(value = "order:save", orRole = "admin")
private Object save(@RequestBody ServiceOrderDTO serviceOrderDTO) {
public 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")
private String update(@PathVariable Long id, @RequestBody ServiceOrderDTO serviceOrderDTO) {
public 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")
private String remove(@PathVariable Long id) {
public String remove(@PathVariable Long id) {
return serviceOrderService.removeById(id) ? "删除成功" : "删除失败";
}
......
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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!