为每个接口添加调试接口需要的描述
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.genersoft.iot.vmp.vmanager.user;
|
||||
|
||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
import com.genersoft.iot.vmp.conf.security.JwtUtils;
|
||||
import com.genersoft.iot.vmp.conf.security.SecurityUtils;
|
||||
import com.genersoft.iot.vmp.service.IRoleService;
|
||||
import com.genersoft.iot.vmp.storager.dao.dto.Role;
|
||||
@@ -8,6 +9,7 @@ import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -24,7 +26,7 @@ public class RoleController {
|
||||
private IRoleService roleService;
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "添加角色")
|
||||
@Operation(summary = "添加角色", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "name", description = "角色名", required = true)
|
||||
@Parameter(name = "authority", description = "权限(自行定义内容,目前未使用)", required = true)
|
||||
public void add(@RequestParam String name,
|
||||
@@ -49,7 +51,7 @@ public class RoleController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除角色")
|
||||
@Operation(summary = "删除角色", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "id", description = "用户Id", required = true)
|
||||
public void delete(@RequestParam Integer id){
|
||||
// 获取当前登录用户id
|
||||
@@ -66,7 +68,7 @@ public class RoleController {
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
@Operation(summary = "查询角色")
|
||||
@Operation(summary = "查询角色", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public List<Role> all(){
|
||||
// 获取当前登录用户id
|
||||
List<Role> allRoles = roleService.getAll();
|
||||
|
||||
@@ -67,7 +67,7 @@ public class UserController {
|
||||
|
||||
|
||||
@PostMapping("/changePassword")
|
||||
@Operation(summary = "修改密码")
|
||||
@Operation(summary = "修改密码", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "username", description = "用户名", required = true)
|
||||
@Parameter(name = "oldpassword", description = "旧密码(已md5加密的密码)", required = true)
|
||||
@Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true)
|
||||
@@ -132,7 +132,7 @@ public class UserController {
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户")
|
||||
@Operation(summary = "删除用户", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "id", description = "用户Id", required = true)
|
||||
public void delete(@RequestParam Integer id){
|
||||
// 获取当前登录用户id
|
||||
@@ -148,7 +148,7 @@ public class UserController {
|
||||
}
|
||||
|
||||
@GetMapping("/all")
|
||||
@Operation(summary = "查询用户")
|
||||
@Operation(summary = "查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
public List<User> all(){
|
||||
// 获取当前登录用户id
|
||||
return userService.getAllUsers();
|
||||
@@ -162,7 +162,7 @@ public class UserController {
|
||||
* @return 分页用户列表
|
||||
*/
|
||||
@GetMapping("/users")
|
||||
@Operation(summary = "分页查询用户")
|
||||
@Operation(summary = "分页查询用户", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "page", description = "当前页", required = true)
|
||||
@Parameter(name = "count", description = "每页查询数量", required = true)
|
||||
public PageInfo<User> users(int page, int count) {
|
||||
@@ -170,7 +170,7 @@ public class UserController {
|
||||
}
|
||||
|
||||
@RequestMapping("/changePushKey")
|
||||
@Operation(summary = "修改pushkey")
|
||||
@Operation(summary = "修改pushkey", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "userId", description = "用户Id", required = true)
|
||||
@Parameter(name = "pushKey", description = "新的pushKey", required = true)
|
||||
public void changePushKey(@RequestParam Integer userId,@RequestParam String pushKey) {
|
||||
@@ -188,7 +188,7 @@ public class UserController {
|
||||
}
|
||||
|
||||
@PostMapping("/changePasswordForAdmin")
|
||||
@Operation(summary = "管理员修改普通用户密码")
|
||||
@Operation(summary = "管理员修改普通用户密码", security = @SecurityRequirement(name = JwtUtils.HEADER))
|
||||
@Parameter(name = "adminId", description = "管理员id", required = true)
|
||||
@Parameter(name = "userId", description = "用户id", required = true)
|
||||
@Parameter(name = "password", description = "新密码(未md5加密的密码)", required = true)
|
||||
|
||||
Reference in New Issue
Block a user