package com.ruoyi.platform.controller.workspace;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.domain.GenericsAjaxResult;
import com.ruoyi.platform.service.JupyterService;
import com.ruoyi.platform.service.WorkspaceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("workspace")
@Api("工作空间管理")
public class WorkspaceController extends BaseController {

    @Resource
    private WorkspaceService workspaceService;

    @GetMapping("/overview")
    @ApiOperation("得到运行概览")
    public GenericsAjaxResult<Map<String, Object>> getOverview() {
        return genericsSuccess(this.workspaceService.getOverview());
    }

    @GetMapping("/assetCount")
    @ApiOperation("得到AI资产计数")
    public GenericsAjaxResult<Map<String, Integer>> getAssetCount(@RequestParam(value = "isPublic",
            defaultValue = "true") Boolean isPublic) throws Exception {
        return genericsSuccess(this.workspaceService.getAssetCount(isPublic));
    }

}
