huanghongfa
2021-06-23 b057f9985a360fcfeb3aa6e96eae99deccffa1d2
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/StatisticsApi.java
@@ -1,16 +1,43 @@
package com.panzhihua.grid_app.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.grid.GridEventStatisticsDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.grid.ComMapGridDetailVO;
import com.panzhihua.common.model.vos.grid.GridEventStatisticsDetailVO;
import com.panzhihua.common.model.vos.grid.GridEventStatisticsVO;
import com.panzhihua.common.service.grid.GridService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/statistics/")
@Api(tags = {"网格综治APP统计模块@lyq"})
public class StatisticsApi extends BaseController {
    @Resource
    private GridService gridService;
    @ApiOperation(value = "根据网格id查询统计详情-lyq",response = GridEventStatisticsVO.class)
    @PostMapping("event")
    public R getGridDetail(@RequestParam("gridId") Long gridId){
        if(gridId == null){
            return R.fail("参数错误");
        }
        return gridService.getGridEventStatisticsByApp(gridId);
    }
    @ApiOperation(value = "网格id查询统计事件详情-lyq",response = GridEventStatisticsDetailVO.class)
    @PostMapping("event/detail")
    public R getGridEventDetailStatistics(@RequestBody GridEventStatisticsDTO statisticsDTO){
        if(statisticsDTO == null || statisticsDTO.getGridId() == null){
            return R.fail("参数错误");
        }
        return gridService.getGridEventDetailStatisticsByApp(statisticsDTO);
    }
}