package com.bocloud.ims.booter.controller.resource.azure.db;

import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.utils.Common;
import com.bocloud.ims.interfaces.resource.azure.db.DbConnectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

/**
 * @Company: 博云 www.bocloud.com
 * @ClassName: DbConnectController
 * @Description:
 * @author: zhenpingLi/李振平
 * @date: 2021/2/20 13:58
 */
@Api(value = "DatabaseConnect", tags = "DatabaseConnect管理")
@RestController
@RequestMapping("/v1/cloud/database/server/connects")
public class DbConnectController {

    @Autowired
    private DbConnectService service;

    /**
     * 查询连接字符串
     *
     * @param id
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "详情DatabaseConnect", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "DatabaseConnect", operation = "详情DatabaseConnect")
    @GetMapping("/{id}")
    public BocloudResult detail(@PathVariable(value = Common.ID) Long id) {
        return service.connects(id);
    }
}