package com.ym.mec.teacher.controller;

import com.ym.mec.auth.api.dto.MenuQueryInfo;
import com.ym.mec.biz.service.ResourceRespositoryService;
import com.ym.mec.common.controller.BaseController;
import com.ym.mec.common.page.QueryInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("resourceRepository")
@Api(tags = "资源服务")
@RestController
public class ResourceRepositoryController extends BaseController {

    @Autowired
    private ResourceRespositoryService resourceRepositoryService;

    @ApiOperation(value = "获取资源")
    @GetMapping("/get")
    public Object get(Integer id){
        return succeed(resourceRepositoryService.get(id));
    }

    @ApiOperation(value = "获取资源列表")
    @GetMapping("/queryTree")
    public Object queryTree(MenuQueryInfo menuQueryInfo){
        return succeed(resourceRepositoryService.queryTree(menuQueryInfo));
    }
}
