diff options
Diffstat (limited to 'src/main/java/com/mesasoft/cn/web/controller/UploadedController.java')
| -rw-r--r-- | src/main/java/com/mesasoft/cn/web/controller/UploadedController.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/com/mesasoft/cn/web/controller/UploadedController.java b/src/main/java/com/mesasoft/cn/web/controller/UploadedController.java new file mode 100644 index 0000000..a99827f --- /dev/null +++ b/src/main/java/com/mesasoft/cn/web/controller/UploadedController.java @@ -0,0 +1,39 @@ +package com.mesasoft.cn.web.controller; + +import com.mesasoft.cn.annotation.AuthInterceptor; +import com.mesasoft.cn.enums.InterceptorLevel; +import com.mesasoft.cn.service.IUploadedService; +import com.zhazhapan.util.Formatter; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author pantao + * @since 2018/2/28 + */ +@RestController +@RequestMapping(value = "/uploaded") +@Api(value = "/uploaded", description = "上传记录相关操作") +public class UploadedController { + + private final IUploadedService uploadedService; + + @Autowired + public UploadedController(IUploadedService uploadedService) {this.uploadedService = uploadedService;} + + @ApiOperation(value = "获取文件上传记录") + @ApiImplicitParams({@ApiImplicitParam(name = "user", value = "指定用户(默认所有用户)"), @ApiImplicitParam(name = + "指定文件(默认所有文件)"), @ApiImplicitParam(name = "category", value = "指定分类(默认所有分类)"), @ApiImplicitParam(name = + "offset", value = "偏移量", required = true)}) + @AuthInterceptor(InterceptorLevel.ADMIN) + @RequestMapping(value = "all", method = RequestMethod.GET) + public String getAll(String user, String file, String category, int offset) { + return Formatter.listToJson(uploadedService.list(user, file, category, offset)); + } +} |
