mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-01 22:53:29 +08:00
不重要的一些小调整(主要是部分Api权限的调整以及Api文档调整)
This commit is contained in:
@@ -53,10 +53,16 @@ public class FileController extends BaseController {
|
||||
// @Autowired
|
||||
// ScheduleTaskServiceImpl scheduleTaskService;
|
||||
|
||||
@ApiOperation(value = "查询文件列表", notes = "查询文件列表")
|
||||
@ApiOperation(value = "【管理员】查询文件列表", notes = "查询文件列表")
|
||||
@RequestMapping(value = "list", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType list(@RequestParam(value = "token", required = false) String token) throws InvocationTargetException, IllegalAccessException, BusinessException {
|
||||
|
||||
UserModel userModel = userService.getUserByToken(redisTemplate, token);
|
||||
if (userModel == null || !Objects.equals(userModel.getGroup(), "ADMIN")) {
|
||||
throw new BusinessException(BusinessErrorCode.OPERATION_NOT_ALLOWED, "非管理员用户无权进行此操作");
|
||||
}
|
||||
|
||||
List<FileModel> fileModels = fileService.list(token);
|
||||
List<FileVO> fileVOS = new ArrayList<>();
|
||||
for (FileModel fileModel : fileModels) {
|
||||
@@ -74,10 +80,16 @@ public class FileController extends BaseController {
|
||||
return fileVO;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询文件对象列表", notes = "查询文件列表")
|
||||
@ApiOperation(value = "【管理员】查询文件对象列表", notes = "查询文件列表")
|
||||
@RequestMapping(value = "object/list", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType objectList(@RequestParam(value = "token", required = false) String token) throws InvocationTargetException, IllegalAccessException, BusinessException {
|
||||
|
||||
UserModel userModel = userService.getUserByToken(redisTemplate, token);
|
||||
if (userModel == null || !Objects.equals(userModel.getGroup(), "ADMIN")) {
|
||||
throw new BusinessException(BusinessErrorCode.OPERATION_NOT_ALLOWED, "非管理员用户无权进行此操作");
|
||||
}
|
||||
|
||||
List<FileObjectModel> fileObjectModels = fileObjectService.list(token);
|
||||
List<FileObjectVO> fileObjectVOS = new ArrayList<>();
|
||||
for (FileObjectModel fileObjectModel : fileObjectModels) {
|
||||
@@ -108,7 +120,7 @@ public class FileController extends BaseController {
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
*/
|
||||
@ApiOperation(value = "创建腾讯云 COS 预授权 URL", notes = "")
|
||||
@ApiOperation(value = "【用户|管理员】创建腾讯云 COS 预授权 URL", notes = "")
|
||||
@RequestMapping(value = "/cos/{httpMethod}", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType cos(@PathVariable(value = "httpMethod") String httpMethod,
|
||||
@@ -176,6 +188,13 @@ public class FileController extends BaseController {
|
||||
return CommonReturnType.create(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 腾讯云 COS 文件上传成功回调方法
|
||||
* @param eventStr
|
||||
* @param contextStr
|
||||
* @return
|
||||
* @throws BusinessException
|
||||
*/
|
||||
@ApiOperation(value = "【COS】腾讯云 COS 文件上传成功回调", notes = "客户端向腾讯云 COS 存储桶上传文件完毕,有云函数触发此请求")
|
||||
@RequestMapping(value = "/upload/cos-check-file-state", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
|
@@ -18,9 +18,9 @@ import plus.bookshelf.Service.Model.UserModel;
|
||||
import java.util.Objects;
|
||||
|
||||
@Api(tags = "系统调试接口")
|
||||
@Controller("debug")
|
||||
@RequestMapping("/debug")
|
||||
public class DebugController extends BaseController {
|
||||
@Controller("system")
|
||||
@RequestMapping("/system")
|
||||
public class SystemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
ThirdPartyConfig thirdPartyConfig;
|
||||
@@ -28,7 +28,7 @@ public class DebugController extends BaseController {
|
||||
@Autowired
|
||||
UserServiceImpl userService;
|
||||
|
||||
@ApiOperation(value = "获取系统配置", notes = "仅限管理员登录状态下可获取")
|
||||
@ApiOperation(value = "【管理员】获取系统配置", notes = "仅限管理员登录状态下可获取")
|
||||
@RequestMapping(value = "status", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType status(@RequestParam(value = "token", required = false) String token) throws BusinessException {
|
@@ -80,7 +80,7 @@ public class ThirdPartyController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取用户已绑定的第三方平台", notes = "传入当前登录用户 token ,返回已绑定的第三方平台")
|
||||
@ApiOperation(value = "【用户|管理员】获取用户已绑定的第三方平台", notes = "传入当前登录用户 token ,返回已绑定的第三方平台")
|
||||
@RequestMapping(value = "getBindingStatus", method = {RequestMethod.GET})
|
||||
@ResponseBody
|
||||
public CommonReturnType getBindingStatus(@RequestParam(value = "token", required = false) String token) throws BusinessException, InvocationTargetException, IllegalAccessException {
|
||||
@@ -92,7 +92,7 @@ public class ThirdPartyController extends BaseController {
|
||||
return CommonReturnType.create(bindingPlatformList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "取消第三方平台绑定", notes = "传入当前登录用户 token 和平台 platform (不区分大小写),返回 bool 值,true 为取消绑定成功")
|
||||
@ApiOperation(value = "【用户|管理员】取消第三方平台绑定", notes = "传入当前登录用户 token 和平台 platform (不区分大小写),返回 bool 值,true 为取消绑定成功")
|
||||
@RequestMapping(value = "withdrawThirdPartyBings", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType unbindThirdPartAccount(@RequestParam(value = "token", required = true) String token,
|
||||
|
@@ -66,7 +66,7 @@ public class UserController extends BaseController {
|
||||
return login(username, password);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户登出", notes = "用户退出登录")
|
||||
@ApiOperation(value = "【用户|管理员】用户登出", notes = "用户退出登录")
|
||||
// @ApiImplicitParams({
|
||||
// @ApiImplicitParam(name = "token", value = "用户token", required = true, dataType = "String")
|
||||
// })
|
||||
@@ -94,7 +94,7 @@ public class UserController extends BaseController {
|
||||
return CommonReturnType.create(userVO);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "账号注销", notes = "传入用户 token ,以及密码明文,后台计算密码SHA1值,进行注销")
|
||||
@ApiOperation(value = "【用户】账号注销", notes = "传入用户 token ,以及密码明文,后台计算密码SHA1值,进行注销")
|
||||
@RequestMapping(value = "cancelAccount", method = {RequestMethod.POST}, consumes = {CONTENT_TYPE_FORMED})
|
||||
@ResponseBody
|
||||
public CommonReturnType cancelAccount(@RequestParam(value = "token", required = false) String token,
|
||||
|
Reference in New Issue
Block a user