Commit 7716e46e authored by 王飞's avatar 王飞

Refactor

1、SysUserController 增加链路追踪。

Reference N/A
parent 55c16e55
...@@ -4,6 +4,9 @@ import java.util.List; ...@@ -4,6 +4,9 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -56,6 +59,8 @@ public class SysUserController extends BaseController ...@@ -56,6 +59,8 @@ public class SysUserController extends BaseController
/** /**
* 获取用户列表 * 获取用户列表
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:list')") @PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SysUser user) public TableDataInfo list(SysUser user)
...@@ -65,6 +70,8 @@ public class SysUserController extends BaseController ...@@ -65,6 +70,8 @@ public class SysUserController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "用户管理", businessType = BusinessType.EXPORT) @Log(title = "用户管理", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:user:export')") @PreAuthorize("@ss.hasPermi('system:user:export')")
@PostMapping("/export") @PostMapping("/export")
...@@ -75,6 +82,8 @@ public class SysUserController extends BaseController ...@@ -75,6 +82,8 @@ public class SysUserController extends BaseController
util.exportExcel(response, list, "用户数据"); util.exportExcel(response, list, "用户数据");
} }
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "用户管理", businessType = BusinessType.IMPORT) @Log(title = "用户管理", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:user:import')") @PreAuthorize("@ss.hasPermi('system:user:import')")
@PostMapping("/importData") @PostMapping("/importData")
...@@ -87,6 +96,8 @@ public class SysUserController extends BaseController ...@@ -87,6 +96,8 @@ public class SysUserController extends BaseController
return success(message); return success(message);
} }
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) public void importTemplate(HttpServletResponse response)
{ {
...@@ -97,6 +108,8 @@ public class SysUserController extends BaseController ...@@ -97,6 +108,8 @@ public class SysUserController extends BaseController
/** /**
* 根据用户编号获取详细信息 * 根据用户编号获取详细信息
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:query')") @PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping(value = { "/", "/{userId}" }) @GetMapping(value = { "/", "/{userId}" })
public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
...@@ -119,6 +132,8 @@ public class SysUserController extends BaseController ...@@ -119,6 +132,8 @@ public class SysUserController extends BaseController
/** /**
* 新增用户 * 新增用户
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:add')") @PreAuthorize("@ss.hasPermi('system:user:add')")
@Log(title = "用户管理", businessType = BusinessType.INSERT) @Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
...@@ -144,6 +159,8 @@ public class SysUserController extends BaseController ...@@ -144,6 +159,8 @@ public class SysUserController extends BaseController
/** /**
* 修改用户 * 修改用户
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
...@@ -170,6 +187,8 @@ public class SysUserController extends BaseController ...@@ -170,6 +187,8 @@ public class SysUserController extends BaseController
/** /**
* 删除用户 * 删除用户
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:remove')") @PreAuthorize("@ss.hasPermi('system:user:remove')")
@Log(title = "用户管理", businessType = BusinessType.DELETE) @Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}") @DeleteMapping("/{userIds}")
...@@ -185,6 +204,8 @@ public class SysUserController extends BaseController ...@@ -185,6 +204,8 @@ public class SysUserController extends BaseController
/** /**
* 重置密码 * 重置密码
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:resetPwd')") @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/resetPwd") @PutMapping("/resetPwd")
...@@ -200,6 +221,8 @@ public class SysUserController extends BaseController ...@@ -200,6 +221,8 @@ public class SysUserController extends BaseController
/** /**
* 状态修改 * 状态修改
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.UPDATE) @Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PutMapping("/changeStatus") @PutMapping("/changeStatus")
...@@ -214,6 +237,8 @@ public class SysUserController extends BaseController ...@@ -214,6 +237,8 @@ public class SysUserController extends BaseController
/** /**
* 根据用户编号获取授权角色 * 根据用户编号获取授权角色
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:query')") @PreAuthorize("@ss.hasPermi('system:user:query')")
@GetMapping("/authRole/{userId}") @GetMapping("/authRole/{userId}")
public AjaxResult authRole(@PathVariable("userId") Long userId) public AjaxResult authRole(@PathVariable("userId") Long userId)
...@@ -229,6 +254,8 @@ public class SysUserController extends BaseController ...@@ -229,6 +254,8 @@ public class SysUserController extends BaseController
/** /**
* 用户授权角色 * 用户授权角色
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:edit')") @PreAuthorize("@ss.hasPermi('system:user:edit')")
@Log(title = "用户管理", businessType = BusinessType.GRANT) @Log(title = "用户管理", businessType = BusinessType.GRANT)
@PutMapping("/authRole") @PutMapping("/authRole")
...@@ -242,6 +269,8 @@ public class SysUserController extends BaseController ...@@ -242,6 +269,8 @@ public class SysUserController extends BaseController
/** /**
* 获取部门树列表 * 获取部门树列表
*/ */
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PreAuthorize("@ss.hasPermi('system:user:list')") @PreAuthorize("@ss.hasPermi('system:user:list')")
@GetMapping("/deptTree") @GetMapping("/deptTree")
public AjaxResult deptTree(SysDept dept) public AjaxResult deptTree(SysDept dept)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment