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

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.http.ResultWrapper;

import net.northking.cctp.dw.api.atu.service.DwAtuCaseDesignApiService;

import net.northking.cctp.dw.dto.atu.DwAtuCaseDesignQueryDto;
import net.northking.cctp.dw.dto.atu.DwAtuDetailTmpDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * 自动化用例设计同步表 => Restful 类型 HTTP/HTTPS 接口
 *
 * @author maven-cctp-plugin
 * @since 1.0
 */
@Api(tags = "自动化用例设计同步表")
@RequestMapping("/v1/DwAtuCaseDesigns")
@RestController
public class DwAtuCaseDesignRestfulCtrl
{
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(DwAtuCaseDesignRestfulCtrl.class);

  @Autowired
  private DwAtuCaseDesignApiService apiService;

  /**
   * Restful接口-get： 获取自动化用例设计同步表
   *
   * @param query       条件查询对象
   * @return 接口数据传输对象
   */
  @ApiOperation(value = "获取：自动化用例设计同步表")
  @PostMapping(
      value = "/count",
      consumes = MediaType.APPLICATION_JSON_UTF8_VALUE,
      produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResultWrapper<DwAtuDetailTmpDto> count(
      @RequestBody DwAtuCaseDesignQueryDto query)
  {
    ResultWrapper<DwAtuDetailTmpDto> wrapper = new ResultWrapper<>();
    DwAtuDetailTmpDto dto = apiService.count(query);
    return wrapper.success(dto);
  }
}
