管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-19 73e8f38ca1c41290d129dddbce3cb7136c7b4c89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.lf.server.controller.show;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lf.server.aspect.SysLog;
import com.lf.server.controller.all.BaseController;
import com.lf.server.entity.all.ResponseMsg;
import com.lf.server.entity.bd.DlgAgnp;
import com.lf.server.service.show.ComprehensiveService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * 综合展示
 * @author WWW
 */
@Api(tags = "综合展示\\综合展示")
@RestController
@RequestMapping("/comprehensive")
public class ComprehensiveController extends BaseController {
    @Autowired
    ComprehensiveService comprehensiveService;
 
    @SysLog()
    @ApiOperation(value = "分页查询并返回记录数-地名地址")
    @ApiImplicitParams({
            @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")
    })
    @GetMapping(value = "/selectAddrByPage")
    public ResponseMsg<List<DlgAgnp>> selectAddrByPage(String name, Integer pageSize, Integer pageIndex) {
        try {
            if (pageSize < 1 || pageIndex < 1) {
                return fail("每页页数或分页数小于1", null);
            }
 
            Page<DlgAgnp> paged = comprehensiveService.selectAddrByPage(name, pageSize, pageIndex);
 
            return success(paged.getTotal(), paged.getRecords());
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
 
    @SysLog()
    @ApiOperation(value = "根据ID查询-地名地址")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1")
    })
    @GetMapping(value = "/selectAddrById")
    public ResponseMsg<DlgAgnp> selectAddrById(Integer id) {
        try {
            DlgAgnp entity = comprehensiveService.selectAddrById(id);
 
            return success(entity);
        } catch (Exception ex) {
            return fail(ex.getMessage(), null);
        }
    }
}