| | |
| | | package com.lf.server.controller.data; |
| | | |
| | | import com.lf.server.aspect.SysLog; |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.data.StyleEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.service.all.FileService; |
| | | import com.lf.server.service.all.UploadAttachService; |
| | | import com.lf.server.service.data.StyleService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | */ |
| | | @Api(tags = "数据管理\\样式管理") |
| | | @RestController |
| | | @RequestMapping("/Style") |
| | | @RequestMapping("/style") |
| | | public class StyleController extends BaseController { |
| | | @Autowired |
| | | StyleService styleService; |
| | |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | FileService fileService; |
| | | UploadAttachService uploadAttachService; |
| | | |
| | | private final static String TAB_NAME = "sys_style"; |
| | | private final static String TAB_NAME = "lf.sys_style"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "sys_style") |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "a") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String name) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "sys_style"), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "a"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页索引(从0开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPage") |
| | | public ResponseMsg<List<StyleEntity>> selectByPage(String name, Integer pageSize, Integer pageIndex) { |
| | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "sys_style"), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "a"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页索引(从0开始)", dataType = "Integer", paramType = "query", example = "0") |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<StyleEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | |
| | | @ApiOperation(value = "上传文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestBody MultipartFile file, HttpServletRequest req) { |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | |
| | | return fileService.upload(ue, TAB_NAME, file, this); |
| | | return uploadAttachService.upload(ue, TAB_NAME, file, this); |
| | | } |
| | | |
| | | @SysLog() |
| | |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | | fileService.download(guid, req, res, this); |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | } |
| | | } |