| | |
| | | import com.terra.system.service.data.DictService; |
| | | import com.terra.system.service.data.DomainService; |
| | | 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.tags.Tag; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | |
| | | * 值域 |
| | | * @author WWW |
| | | */ |
| | | @Api(tags = "数据管理\\值域") |
| | | @Tag(name = "数据管理\\值域") |
| | | @RestController |
| | | @RequestMapping("/domain") |
| | | public class DomainController extends BaseController { |
| | |
| | | DictService dictService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "210") |
| | | @Operation(summary = "查询记录数") |
| | | @Parameters({ |
| | | @Parameter(name = "ns", description = "名称空间", in = ParameterIn.QUERY, example = "bd"), |
| | | @Parameter(name = "tab", description = "表名", in = ParameterIn.QUERY, example = "dlg_25w_aanp"), |
| | | @Parameter(name = "code", description = "编码", in = ParameterIn.QUERY, example = "210") |
| | | }) |
| | | @GetMapping({"/selectCount"}) |
| | | public ResponseMsg<Integer> selectCount(String ns, String tab, String code) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "dlg_25w_aanp"), |
| | | @ApiImplicitParam(name = "code", value = "编码", dataType = "String", paramType = "query", example = "210"), |
| | | @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 = "ns", description = "名称空间", in = ParameterIn.QUERY, example = "bd"), |
| | | @Parameter(name = "tab", description = "表名", in = ParameterIn.QUERY, example = "dlg_25w_aanp"), |
| | | @Parameter(name = "code", description = "编码", in = ParameterIn.QUERY, example = "210"), |
| | | @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<DomainEntity>> selectByPage(String ns, String tab, String code, Integer pageSize, Integer pageIndex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "分页查询并返回记录数") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "b_hy20w_s23"), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "等级"), |
| | | @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 = "ns", description = "名称空间", in = ParameterIn.QUERY, example = "bd"), |
| | | @Parameter(name = "tab", description = "表名", in = ParameterIn.QUERY, example = "b_hy20w_s23"), |
| | | @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "等级"), |
| | | @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<DomainEntity>> selectByPageAndCount(String ns, String tab, String name, Integer pageSize, Integer pageIndex) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有") |
| | | @Operation(summary = "查询所有") |
| | | @GetMapping(value = "/selectAll") |
| | | public ResponseMsg<List<DomainEntity>> selectAll() { |
| | | try { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询值域表集合") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = "String", paramType = "query", example = "b_"), |
| | | @ApiImplicitParam(name = "hasGeom", value = "含有Geom字段", dataType = "Boolean", paramType = "query", example = "false") |
| | | @Operation(summary = "查询值域表集合") |
| | | @Parameters({ |
| | | @Parameter(name = "name", description = "名称", in = ParameterIn.QUERY, example = "b_"), |
| | | @Parameter(name = "hasGeom", description = "含有Geom字段", in = ParameterIn.QUERY, example = "false") |
| | | }) |
| | | @GetMapping(value = "/selectDomainTabs") |
| | | public ResponseMsg<List<TabEntity>> selectDomainTabs(String name, Boolean hasGeom) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据表名查询值域名称") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ns", value = "名称空间", dataType = "String", paramType = "query", example = "bd"), |
| | | @ApiImplicitParam(name = "tab", value = "表名", dataType = "String", paramType = "query", example = "b_hy20w_s23") |
| | | @Operation(summary = "根据表名查询值域名称") |
| | | @Parameters({ |
| | | @Parameter(name = "ns", description = "名称空间", in = ParameterIn.QUERY, example = "bd"), |
| | | @Parameter(name = "tab", description = "表名", in = ParameterIn.QUERY, example = "b_hy20w_s23") |
| | | }) |
| | | @GetMapping(value = "/selectDomainNames") |
| | | public ResponseMsg<List<String>> selectDomainNames(String ns, String tab) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "int", paramType = "query", example = "1") |
| | | @Operation(summary = "根据ID查询") |
| | | @Parameters({ |
| | | @Parameter(name = "id", description = "ID", in = ParameterIn.QUERY, example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectById") |
| | | public ResponseMsg<DomainEntity> selectById(int id) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "DomainEntity", paramType = "body") |
| | | @Operation(summary = "插入一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类") |
| | | }) |
| | | @PostMapping(value = "/insert", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> insert(@RequestBody DomainEntity entity, HttpServletRequest req) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "插入多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "DomainEntity", paramType = "body") |
| | | @Operation(summary = "插入多条") |
| | | @Parameters({ |
| | | @Parameter(name = "list", description = "实体类集合") |
| | | }) |
| | | @PostMapping(value = "/inserts", produces = "application/json; charset=UTF-8") |
| | | public ResponseMsg<Integer> inserts(@RequestBody List<DomainEntity> 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 = "/delete") |
| | | public ResponseMsg<Integer> delete(int id) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "ids", value = "ID数组", dataType = "Integer", paramType = "query", example = "1,2") |
| | | @Operation(summary = "删除多条") |
| | | @Parameters({ |
| | | @Parameter(name = "ids", description = "ID数组", in = ParameterIn.QUERY, example = "1,2") |
| | | }) |
| | | @GetMapping(value = "/deletes") |
| | | public ResponseMsg<Integer> deletes(@RequestParam List<Integer> ids) { |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "DomainEntity", paramType = "body") |
| | | @Operation(summary = "更新一条") |
| | | @Parameters({ |
| | | @Parameter(name = "entity", description = "实体类") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/update", produces = "application/json; charset=UTF-8") |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新多条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "DomainEntity", paramType = "body") |
| | | @Operation(summary = "更新多条") |
| | | @Parameters({ |
| | | @Parameter(name = "list", description = "实体类集合") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/updates", produces = "application/json; charset=UTF-8") |