|
@@ -1,94 +0,0 @@
|
|
|
-package com.persagy.apm.controller;
|
|
|
-
|
|
|
-import com.persagy.apm.service.IProjectMonitorIndicatorConfigService;
|
|
|
-
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
-import com.persagy.apm.model.*;
|
|
|
-import com.persagy.apm.model.vo.*;
|
|
|
-import com.persagy.apm.model.dto.*;
|
|
|
-import com.persagy.apm.common.response.*;
|
|
|
-import com.persagy.apm.common.utils.ResultHelper;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * 项目监测指标配置控制层
|
|
|
- *
|
|
|
- * @author lixing
|
|
|
- * @version V1.0 2021-09-07 18:12:09
|
|
|
- */
|
|
|
-@Api(tags = "项目监测指标配置")
|
|
|
-@Validated
|
|
|
-@RestController
|
|
|
-@RequestMapping("projectMonitorIndicatorConfigs")
|
|
|
-public class ProjectMonitorIndicatorConfigController {
|
|
|
- @Autowired
|
|
|
- private IProjectMonitorIndicatorConfigService projectMonitorIndicatorConfigService;
|
|
|
-
|
|
|
- @ApiOperation(value = "创建项目监测指标配置")
|
|
|
- @PostMapping("/create")
|
|
|
- public CommonResult<ApmResponseUpsertVO> createProjectMonitorIndicatorConfig(
|
|
|
- @Valid @RequestBody AddProjectMonitorIndicatorConfigDTO addProjectMonitorIndicatorConfigDTO) {
|
|
|
- String id = projectMonitorIndicatorConfigService.createProjectMonitorIndicatorConfig(addProjectMonitorIndicatorConfigDTO);
|
|
|
- return ResultHelper.single(new ApmResponseUpsertVO(id));
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "项目监测指标配置详情")
|
|
|
- @PostMapping("/get")
|
|
|
- public CommonResult<ProjectMonitorIndicatorConfigItemVO> queryProjectMonitorIndicatorConfigDetail(
|
|
|
- @Valid @RequestBody QueryProjectMonitorIndicatorConfigDetailDTO queryProjectMonitorIndicatorConfigDetailDTO) {
|
|
|
- ProjectMonitorIndicatorConfig projectMonitorIndicatorConfig = projectMonitorIndicatorConfigService.queryProjectMonitorIndicatorConfigDetail(queryProjectMonitorIndicatorConfigDetailDTO.getId());
|
|
|
- ProjectMonitorIndicatorConfigItemVO projectMonitorIndicatorConfigItemVO = ConvertProjectMonitorIndicatorConfigTool.INSTANCE.convert2ResponseItemDTO(projectMonitorIndicatorConfig);
|
|
|
- return ResultHelper.single(projectMonitorIndicatorConfigItemVO);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "更新项目监测指标配置")
|
|
|
- @PostMapping("/update")
|
|
|
- public CommonResult<ApmResponseUpsertVO> updateProjectMonitorIndicatorConfig(
|
|
|
- @Valid @RequestBody UpdateProjectMonitorIndicatorConfigDTO updateProjectMonitorIndicatorConfigDTO) {
|
|
|
- projectMonitorIndicatorConfigService.updateProjectMonitorIndicatorConfig(updateProjectMonitorIndicatorConfigDTO);
|
|
|
- return ResultHelper.single(new ApmResponseUpsertVO(updateProjectMonitorIndicatorConfigDTO.getId()));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "删除项目监测指标配置")
|
|
|
- @PostMapping("/delete")
|
|
|
- public CommonResult deleteProjectMonitorIndicatorConfig(
|
|
|
- @RequestBody @Valid DeleteProjectMonitorIndicatorConfigDTO deleteProjectMonitorIndicatorConfigDTO) {
|
|
|
- projectMonitorIndicatorConfigService.deleteProjectMonitorIndicatorConfig(deleteProjectMonitorIndicatorConfigDTO.getId());
|
|
|
- return ResultHelper.success();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation(value = "项目监测指标配置列表")
|
|
|
- @PostMapping("/query")
|
|
|
- public CommonResult<PageList<ProjectMonitorIndicatorConfigListItemVO>> queryProjectMonitorIndicatorConfig(
|
|
|
- @Valid @RequestBody QueryProjectMonitorIndicatorConfigDTO queryProjectMonitorIndicatorConfigDTO) {
|
|
|
- List<ProjectMonitorIndicatorConfig> projectMonitorIndicatorConfigList = projectMonitorIndicatorConfigService.queryProjectMonitorIndicatorConfigList(queryProjectMonitorIndicatorConfigDTO);
|
|
|
- List<ProjectMonitorIndicatorConfigListItemVO> resultList = ConvertProjectMonitorIndicatorConfigTool.INSTANCE.convert2List(projectMonitorIndicatorConfigList);
|
|
|
- return ResultHelper.multi(resultList);
|
|
|
- }
|
|
|
-
|
|
|
- //@ApiOperation(value = "项目监测指标配置列表, 分页查询")
|
|
|
- //@PostMapping("/query")
|
|
|
- //public CommonResult<PageList<ProjectMonitorIndicatorConfigListItemVO>> queryProjectMonitorIndicatorConfig(
|
|
|
- // @Valid @RequestBody PageQueryProjectMonitorIndicatorConfigDTO pageQueryProjectMonitorIndicatorConfigDTO) {
|
|
|
- // IPage<ProjectMonitorIndicatorConfig> pagedList = projectMonitorIndicatorConfigService.pageQueryProjectMonitorIndicatorConfig(pageQueryProjectMonitorIndicatorConfigDTO);
|
|
|
- // IPage<ProjectMonitorIndicatorConfigListItemVO> pagedResultList = pagedList.convert(item -> {
|
|
|
- // try {
|
|
|
- // return ConvertProjectMonitorIndicatorConfigTool.INSTANCE.convert2ResponseListItemDTO(item);
|
|
|
- // } catch (Exception e) {
|
|
|
- // throw new IllegalArgumentException("分页查询,ProjectMonitorIndicatorConfig实体类转换为列表对象发生异常", e);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // return ResultHelper.multi(pagedResultList);
|
|
|
- //}
|
|
|
-}
|
|
|
-
|