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

import com.bocloud.cmp.params.azure.AzureListPriceParams;
import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.ims.interfaces.resource.azure.prices.AzurePriceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * @Company: 博云 www.bocloud.com
 * @ClassName: AzurePriceController
 * @Description:
 * @author: zhenpingLi/李振平
 * @date: 2021/1/6 16:41
 */
@Api(value = "azurePrices", tags = "azurePrices管理")
@RestController
@RequestMapping("/v1/azure/prices")
public class AzurePriceController {

    @Autowired
    private AzurePriceService service;

    /**
     * 查询规格定价
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询规格定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询规格定价")
    @PostMapping("/flavors")
    public BocloudResult flavor(@RequestBody AzureListPriceParams params) {
        return service.flavors(params);
    }

    /**
     * 查询磁盘定价
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询磁盘定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询磁盘定价")
    @PostMapping("/volumes")
    public BocloudResult volumes(@RequestBody AzureListPriceParams params) {
        return service.volumes(params);
    }

    /**
     * 查询eip定价
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询规格定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询eip定价")
    @PostMapping("/eips")
    public BocloudResult eips(@RequestBody AzureListPriceParams params) {
        return service.eips(params);
    }


    /**
     * 查询redis定价
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询redis定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询redis定价")
    @PostMapping("/redis")
    public BocloudResult redis(@RequestBody AzureListPriceParams params) {
        return service.redis(params);
    }

    /**
     * 查询mysql存储定价
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询mysql存储定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询mysql存储定价")
    @PostMapping("/mysql/storages")
    public BocloudResult mysqlStorage(@RequestBody AzureListPriceParams params) {
        return service.mysqlStorage(params);
    }

    /**
     * 查询mysql-vcore
     *
     * @param params
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "查询mysql-vcore定价", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "azurePrice", operation = "查询mysql-vcore定价")
    @PostMapping("/mysql/vcores")
    public BocloudResult mysqlVcore(@RequestBody AzureListPriceParams params) {
        return service.mysqlVcore(params);
    }


}