/*
* Copyright (c) 京北方信息技术股份有限公司 Corporation 2023 . All rights reserved.
*
*/
package net.northking.cctp.project.api.env;

import cn.gjing.tools.auth.annotation.RequiredPermissions;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.db.Pagination;
import net.northking.cctp.common.http.QueryByPage;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.project.api.env.service.CpProjectEnvSysApiService;
import net.northking.cctp.project.dto.env.CpProjectEnvSysDetailDto;
import net.northking.cctp.project.dto.env.CpProjectEnvSysQueryDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "系统环境被测系统信息")
@RequestMapping("/v1")
@RestController
public class CpProjectEnvSysQueryCtrl
{
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(CpProjectEnvSysQueryCtrl.class);

  @Autowired
  private CpProjectEnvSysApiService apiService;

  /**
   * 分页查询
   *
   * @param queryByPage  查询条件
   * @return 数据列表
   */
  @ApiOperation(value = "分页查询列表：系统环境被测系统信息")
  @RequiredPermissions({"ui-queryEnvDss","ui-configureEnvDss"})
  @PostMapping(value = "/paging/query/CpProjectEnvSyss",
      produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
      consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResultWrapper<Pagination<CpProjectEnvSysDetailDto>> pagingQuery(
      @RequestBody @Validated QueryByPage<CpProjectEnvSysQueryDto> queryByPage)
  {
    ResultWrapper<Pagination<CpProjectEnvSysDetailDto>> wrapper = new ResultWrapper<>();
    Pagination<CpProjectEnvSysDetailDto> page = apiService.pagingQuery(queryByPage);

    return wrapper.success(page);
  }

}


