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.*;
import com.bocloud.ims.interfaces.resource.sangfor.SangforHostService;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/sangfor/host")
@Api(value = "深信服SCP物理机管理", tags = "深信服SCP物理机管理")
public class SangforHostController {
    @Autowired
    private SangforHostService sangforHostService;

    @ApiOperation(tags = {"CMC",
            "CSC"}, value = "深信服SCP物理机查询管理",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "深信服SCP物理机列表管理", operation = "查询深信服SCP物理机列表")
    @GetMapping
    public BocloudResult<GridBean<Server>> list(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return sangforHostService.list(pager);
    }

//    @ApiOperation(tags = {"CMC",
//            "CSC"}, value = "深信服SCP物理机系统盘查询管理",  httpMethod = "GET")
//    @Log(module = BoCloudService.IMS, target = "深信服SCP物理机系统盘列表管理", operation = "查询深信服SCP物理机系统盘列表管理")
//    @GetMapping("/systemDisk")
//    public BocloudResult<GridBean<Storage>> hostSystemList(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
//        return sangforHostService.hostSystemList(pager, context);
//    }

    @ApiOperation(tags = {"CMC",
            "CSC"}, value = "深信服SCP物理机物理网络查询管理",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "深信服SCP物理机物理网络列表管理", operation = "查询深信服SCP物理机物理网络列表管理")
    @GetMapping("/iface")
    public BocloudResult<GridBean<SangforIface>> hostIfaceList(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return sangforHostService.hostIfaceList(pager, context);
    }

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

    @ApiOperation(tags = {"CMC",
            "CSC"}, value = "查询深信服SCP用户列表",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "查询深信服SCP用户列表", operation = "查询深信服SCP用户列表")
    @GetMapping("/users")
    public BocloudResult<GridBean<SangforProject>> listUsers(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return sangforHostService.listUsers(pager, context);
    }
}
