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

import com.bocloud.cmp.params.azure.AzureTagsParams;
import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.RequestContext;
import com.bocloud.common.utils.Common;
import com.bocloud.ims.interfaces.resource.azure.tags.AzureTagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PutMapping;
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: TagController
 * @Description:
 * @author: zhenpingLi/李振平
 * @date: 2021/6/7 20:44
 */
@Api(value = "标签管理", tags = "标签管理")
@RestController
@RequestMapping("/v1/resource/tags")
public class AzureTagController {

    @Autowired
    private AzureTagService service;

    /**
     * 更新标签
     *
     * @param params
     * @param context
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "更新标签", httpMethod = "PUT")
    @Log(module = BoCloudService.IMS, target = "标签", operation = "更新标签")
    @PutMapping
    public BocloudResult tags(
            @RequestBody AzureTagsParams params,
            @Value(Common.REQ_CONTEXT) RequestContext context) {
        return service.tags(params, context);
    }

}