package com.hc.web.controller.browser.front;

import com.hc.business.service.ToolsService;
import com.hc.core.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户表(User)表控制层
 *
 * @author java
 * @since 2020-11-09 10:04:14
 */

@RestController
@RequestMapping("/new/api/front/tools")
public class FrontToolsController {

    /**
     * 服务对象
     */
    private final ToolsService toolsService ;

    public FrontToolsController(ToolsService toolsService) {
        this.toolsService = toolsService;
    }

    @GetMapping("/getClassUserList/{id}")
    @ApiOperation(value = "依据培训班获取用户列表", response = Result.class)
    public Result selectExpertList(@PathVariable("id") Integer id) {
        return Result.success(this.toolsService.getClassUserList(id));
    }


    @GetMapping("/getClassScoreList/{id}")
    @ApiOperation(value = "依据培训班获取用户成绩列表", response = Result.class)
    public Result selectCompanyList(@PathVariable("id") Integer id) {
        return Result.success(this.toolsService.getClassScoreList(id));
    }

    @GetMapping("/getClassProgress/{id}")
    @ApiOperation(value = "根据培训班ID获取学习进度列表", response = Result.class)
    public Result selectExpertStatusList(@PathVariable("id") Integer id) {
        return Result.success(this.toolsService.getClassProgress(id));
    }

}