| | |
| | | import com.terra.system.service.data.StyleService; |
| | | import com.terra.system.service.sys.DownlogService; |
| | | import com.terra.system.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.Parameters; |
| | | import javax.annotation.Resource; |
| | | |
| | | import io.swagger.v3.oas.annotations.enums.ParameterIn; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | * @author sws |
| | | * @date 2022-09.26 |
| | | */ |
| | | @Api(tags = "数据管理\\样式管理") |
| | | @Tag(name = "数据管理\\样式管理") |
| | | @RestController |
| | | @RequestMapping("/style") |
| | | public class StyleController extends BaseController { |
| | |
| | | private final static String TAB_NAME = "lf.sys_style"; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", required = false, example = "a") |
| | | @Operation(summary = "查询记录数") |
| | | @Parameters({ |
| | | @Parameter(name = "name", description = "名称", in = ParameterIn.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 = "a"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | @Operation(summary = "分页查询") |
| | | @Parameters({ |
| | | @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, required = false, example = "a"), |
| | | @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"), |
| | | @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.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 = "a"), |
| | | @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "Integer", paramType = "query", example = "10"), |
| | | @ApiImplicitParam(name = "pageIndex", value = "分页数(从1开始)", dataType = "Integer", paramType = "query", example = "1") |
| | | @Operation(summary = "分页查询并返回记录数") |
| | | @Parameters({ |
| | | @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "a"), |
| | | @Parameter(name = "pageSize", description = "每页条数", in = ParameterIn.QUERY, example = "10"), |
| | | @Parameter(name = "pageIndex", description = "分页数(从1开始)", in = ParameterIn.QUERY, example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectByPageAndCount") |
| | | public ResponseMsg<List<StyleEntity>> selectByPageAndCount(String name, Integer pageSize, Integer pageIndex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "StyleEntity", paramType = "body", example = "") |
| | | @Operation(summary = "插入一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertStyle", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertStyle(@RequestBody StyleEntity entity, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "StyleEntity", paramType = "body", example = "") |
| | | @Operation(summary = "插入多条") |
| | | @Parameters({ |
| | | @Parameter(name = "list", description = "实体类集合", example = "") |
| | | }) |
| | | @PostMapping(value = "/insertStyles", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insertStyles(@RequestBody List<StyleEntity> list, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | @Operation(summary = "删除一条") |
| | | @Parameters({ |
| | | @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteStyle") |
| | | public ResponseMsg<Integer> deleteStyle(int id) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1") |
| | | @Operation(summary = "删除多条") |
| | | @Parameters({ |
| | | @Parameter(name = "ids", description = "ID数组", in = ParameterIn.QUERY, example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteStyles") |
| | | public ResponseMsg<Integer> deleteStyles(@RequestParam List<Integer> ids) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "StyleEntity", paramType = "body", example = "") |
| | | @Operation(summary = "更新一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类", example = "") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updateStyle", produces = "application/json; charset=UTF-8") |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | @Operation(summary = "根据ID查询") |
| | | @Parameters({ |
| | | @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectStyle") |
| | | public ResponseMsg<StyleEntity> selectStyle(int id) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有") |
| | | @Operation(summary = "查询所有") |
| | | @GetMapping(value = "/selectStyleAll") |
| | | public ResponseMsg<List<StyleEntity>> selectStyleAll() { |
| | | |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传文件") |
| | | @Operation(summary = "上传文件") |
| | | @ResponseBody |
| | | @PostMapping(value = "/upload") |
| | | public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | @Operation(summary = "下载文件") |
| | | @Parameters({ |
| | | @Parameter(name = "guid", description = "附件Guid") |
| | | }) |
| | | @GetMapping(value = "/download") |
| | | public void download(String guid, HttpServletResponse res) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载文件") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "文件GUID", dataType = "String", paramType = "query") |
| | | @Operation(summary = "下载文件") |
| | | @Parameters({ |
| | | @Parameter(name = "guid", description = "文件GUID", in = ParameterIn.QUERY) |
| | | }) |
| | | @RequestMapping(value = "/downloadFile", method = RequestMethod.GET) |
| | | public void downloadFile(String guid, HttpServletRequest req, HttpServletResponse res) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "请求下载") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guids", value = "附件Guid数组", dataType = "String", paramType = "body", allowMultiple = true, example = "e5b6ae0889b88111f13a4b6e048348db,fa4f299e901a0c46e634f8fcc8185c0c") |
| | | @Operation(summary = "请求下载") |
| | | @Parameters({ |
| | | @Parameter(name = "guids", description = "附件Guid数组", schema = @Schema(type = "array"), example = "e5b6ae0889b88111f13a4b6e048348db,fa4f299e901a0c46e634f8fcc8185c0c") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/downloadReqForGuids") |