package com.bocloud.ims.booter.controller.resource.sangforV68;

import com.bocloud.common.annotations.Log;
import com.bocloud.common.enums.BoCloudService;
import com.bocloud.common.model.BocloudResult;
import com.bocloud.common.model.GridBean;
import com.bocloud.common.model.Pager;
import com.bocloud.common.model.RequestContext;
import com.bocloud.common.utils.Common;
import com.bocloud.ims.entity.resource.CloudVendor;
import com.bocloud.ims.entity.resource.SangforAz;
import com.bocloud.ims.interfaces.resource.sangfor.SangforAzService;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 深信服6.8资源池控制器
 *
 * @author sxp
 * @since 2023/6/1
 */
@RestController
@RequestMapping("/v1/sangfor/azs")
public class SangforAzController {
    @Autowired
    private SangforAzService sangforAzService;

    @ApiOperation(tags = {"CMC", "CSC"}, value = "深信服6.8资源池查询", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "深信服6.8资源池查询", operation = "深信服6.8资源池查询")
    @GetMapping
    public BocloudResult<GridBean<SangforAz>> list(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return sangforAzService.list(pager, context);
    }

    @ApiOperation(tags = {"CMC",
            "CSC"}, value = "查看资源池的详细信息", httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "深信服6.8资源池查询", operation = "查看资源池的详细信息")
    @GetMapping("/{uuid}")
    public BocloudResult<SangforAz> detail(@PathVariable(value = "uuid") String uuid) {
        return sangforAzService.detail(uuid);
    }
}
