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

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.project.api.project.service.CpProjectApiService;
import net.northking.cctp.project.dto.project.CpProjectDetailDto;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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/CpProjects")
@RestController
public class CpProjectRestfulCtrl
{
  /**
   * 日志
   */
  private final static Logger logger = LoggerFactory.getLogger(CpProjectRestfulCtrl.class);

  @Autowired
  private CpProjectApiService apiService;

  /**
   * Restful接口-get： 获取系统基本信息表
   *
   * @param uuid       数据库主键
   * @return 接口数据传输对象
   */
  @ApiOperation(value = "获取：系统基本信息表")
  @GetMapping(
      value = "/{uuid}",
      produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  public ResultWrapper<CpProjectDetailDto> findByPK(
      @PathVariable("uuid") String uuid)
  {
    ResultWrapper<CpProjectDetailDto> wrapper = new ResultWrapper<>();
    CpProjectDetailDto user = apiService.findByPK(uuid);
    return wrapper.success(user);
  }

}
