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

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.scriptcase.api.comLib.service.LibraryBusComInfoApiService;
import net.northking.cctp.scriptcase.dto.comLib.LibraryBusComCheckDto;
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;


/**
 * 业务组件库组件列表 => Restful 类型 HTTP/HTTPS 接口
 *
 * @author maven-cctp-plugin
 * @since 1.0
 */
@Api(tags = "业务组件库组件列表")
@RequestMapping("/v1/LibraryBusComInfos")
@RestController
public class LibraryBusComInfoRestfulCtrl {
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(LibraryBusComInfoRestfulCtrl.class);

  @Autowired
  private LibraryBusComInfoApiService apiService;

  /**
   * 批量审核组件库组件
   */
  @ApiOperation(value = "批量审核组件库组件")
  @PostMapping(
          value = "/checkByIds",
          produces = MediaType.APPLICATION_JSON_UTF8_VALUE,
          consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResultWrapper<Integer> checkByIds(
          @RequestBody @Validated LibraryBusComCheckDto target) {
    ResultWrapper<Integer> wrapper = new ResultWrapper<>();
    int dto = apiService.checkByIds(target);
    return wrapper.success(dto);

  }
}
