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.VmwareHorizonUserOrGroup;
import com.bocloud.ims.interfaces.resource.horizon.VmwareHorizonUserOrGroupService;
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.*;

/**
 * 用户和组
 *
 * @author wangyu
 * @version 1.0
 * @since 2020年2月25日
 */
@RestController
@RequestMapping("/v1/horizon/users-or-groups")
@Api(value = "用户和组", tags = "用户和组")
public class VmwareHorizonUserOrGroupController {

    @Autowired
    private VmwareHorizonUserOrGroupService service;

    /**
     * 获取用户，组列表
     *
     * @param pager
     * @param context
     * @return
     */
    @ApiOperation(tags = {"CMC", "CSC"}, value = "获取用户，组列表",  httpMethod = "GET")
    @Log(module = BoCloudService.IMS, target = "用户，组", operation = "获取用户，组列表")
    @GetMapping
    public BocloudResult<GridBean<VmwareHorizonUserOrGroup>> list(Pager pager, @Value(Common.REQ_CONTEXT) RequestContext context) {
        return service.list(pager, context);
    }

}
