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

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.constants.BaseDefineDependencyConstants;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.dto.TagDto;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.vo.ResponseVO;
import cn.gjing.tools.auth.annotation.RequiredPermissions;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.executePlan.api.execplanTag.service.AtuExecplanTagApiService;
import net.northking.cctp.executePlan.constants.MsgConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@Api(tags = "执行计划标签表")
@RequestMapping("/v1")
@RestController
public class AtuExecplanTagQueryCtrl
{
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(AtuExecplanTagQueryCtrl.class);

  @Autowired
  private AtuExecplanTagApiService apiService;


  @RequiredPermissions("ui-queryPlanTag")
  @ApiOperation(value = "获取执行计划引用的标签列表")
  @GetMapping("/queryExecplanTag/{execplanId}")
  public ResponseVO<List<TagDto>> queryExecplanTag(@PathVariable("execplanId") String execplanId)
  {
    logger.debug("start queryExecplanTag, execplanId:{}", execplanId);
    ResponseVO<List<TagDto>> responseVO = new ResponseVO<>();
    List<TagDto> tagDtos = apiService.queryExecplanTag(execplanId);
    logger.debug("end queryExecplanTag");
    responseVO.setCode(BaseDefineDependencyConstants.SYSTEM_RESPONSE_CODE_SUCCESS);
    responseVO.setData(tagDtos);
    responseVO.setMessage(MsgConstant.RESPONSE_VO_GET_EXE_PLAN_LAB_SUCCESSFULLY);
    return responseVO;
  }


}


