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

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.scriptcase.api.component.service.HisBusComponentInfoApiService;
import net.northking.cctp.scriptcase.dto.component.HisBusComponentInfoDetailDto;
import net.northking.cctp.scriptcase.dto.component.HisBusComponentInfoQueryDto;
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/HisBusComInfos")
@RestController
public class HisBusComInfoRestfulCtrl
{
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(HisBusComInfoRestfulCtrl.class);

  @Autowired
  private HisBusComponentInfoApiService apiService;

  /**
   * 查询指定版本组件数据
   */
  @ApiOperation(value = "查询指定版本组件数据")
  @PostMapping(
          value = "/queryHisInfoByVersion",
          produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
          consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResultWrapper<HisBusComponentInfoDetailDto> queryHisInfoByVersion(
          @RequestBody @Validated HisBusComponentInfoQueryDto dto)
  {
    ResultWrapper<HisBusComponentInfoDetailDto> wrapper = new ResultWrapper<>();
    HisBusComponentInfoDetailDto result = apiService.queryHisInfoByVersion(dto);
    return wrapper.success(result);
  }
}


