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

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.horizon.VmwareHorizonFarm;
import com.bocloud.ims.interfaces.resource.horizon.VmwareHorizonFarmService;
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.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 场
 *
 * @author HP
 */
@RestController
@RequestMapping("/v1/horizon/farms")
@Api(value = "场", tags = "场")
public class VmwareHorizonFarmController {

    @Autowired
    private VmwareHorizonFarmService service;

    /**
     * 获取场列表
     *
     * @param pager
     * @param context
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "获取场列表",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "场", operation = "获取场列表")
    @GetMapping
    public BocloudResult<GridBean<VmwareHorizonFarm>> list(Pager pager, @RequestParam(value = Common.CONDITION, required = false) String condition,
                                                           @Value(Common.REQ_CONTEXT) RequestContext context) {
        return service.list(pager, context);
    }

}
