13693261870
7 天以前 73e913fb24bf163ab9c5332ab960b1eb56a6402b
se-system/src/main/java/com/terra/system/controller/data/StyleController.java
@@ -1,9 +1,9 @@
package com.terra.system.controller.data;
import com.terra.system.annotation.SysLog;
import com.terra.system.controller.all.BaseController;
import com.terra.system.entity.all.HttpStatus;
import com.terra.system.entity.all.ResponseMsg;
import com.terra.common.controller.all.BaseController;
import com.terra.common.entity.all.HttpStatus;
import com.terra.common.entity.all.ResponseMsg;
import com.terra.system.entity.ctrl.DownloadReqEntity;
import com.terra.system.entity.data.DownloadEntity;
import com.terra.system.entity.data.StyleEntity;
@@ -14,11 +14,14 @@
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.*;
@@ -31,7 +34,7 @@
 * @author sws
 * @date 2022-09.26
 */
@Api(tags = "数据管理\\样式管理")
@Tag(name = "数据管理\\样式管理")
@RestController
@RequestMapping("/style")
public class StyleController extends BaseController {
@@ -53,9 +56,9 @@
    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) {
@@ -69,11 +72,11 @@
    }
    @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) {
@@ -92,11 +95,11 @@
    }
    @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) {
@@ -119,9 +122,9 @@
    }
    @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) {
@@ -140,9 +143,9 @@
    }
    @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) {
@@ -163,9 +166,9 @@
    }
    @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) {
@@ -179,9 +182,9 @@
    }
    @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) {
@@ -199,9 +202,9 @@
    }
    @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")
@@ -221,9 +224,9 @@
    }
    @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) {
@@ -237,7 +240,7 @@
    }
    @SysLog()
    @ApiOperation(value = "查询所有")
    @Operation(summary = "查询所有")
    @GetMapping(value = "/selectStyleAll")
    public ResponseMsg<List<StyleEntity>> selectStyleAll() {
@@ -250,7 +253,7 @@
    }
    @SysLog()
    @ApiOperation(value = "上传文件")
    @Operation(summary = "上传文件")
    @ResponseBody
    @PostMapping(value = "/upload")
    public ResponseMsg<String> upload(@RequestParam("file") MultipartFile file, HttpServletRequest req) {
@@ -260,9 +263,9 @@
    }
    @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) {
@@ -270,9 +273,9 @@
    }
    @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) {
@@ -298,9 +301,9 @@
    }
    @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")