package com.miaxis.pc.controller.question;

import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.core.page.ResponsePageInfo;
import com.miaxis.three.domain.ThreeForce;
import com.miaxis.three.service.IThreeForceService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 【三力测试】Controller
 *
 * @author miaxis
 * @date 2023-04-03
 */
@RestController
@RequestMapping("/three/force")
@Api(tags={"【PC-三力测试】"})
public class PcThreeForceController extends BaseController {
    @Autowired
    private IThreeForceService threeForceService;

    /**
     * 查询三力测试列表
     */
    @GetMapping("/list")
    @ApiOperation("查询三力测试列表")
        @ApiImplicitParams({
            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
    })
    public ResponsePageInfo<ThreeForce> list(@ModelAttribute ThreeForce threeForce){
        startPage();
        List<ThreeForce> list = threeForceService.selectThreeForceList(threeForce);
        return toResponsePageInfo(list);
    }
    

    /**
     * 获取三力测试详细信息
     */
    @GetMapping(value = "/{id}")
    @ApiOperation("获取三力测试详细信息")
    public Response<ThreeForce> getInfo(
            @ApiParam(name = "id", value = "三力测试参数", required = true)
            @PathVariable("id") Long id
    ){
        return Response.success(threeForceService.getById(id));
    }

    /**
     * 获取三力测试模拟考题
     */
    @GetMapping("/selectTestQuestionInfoList")
    @ApiOperation("获取三力测试模拟考题")
    public ResponsePageInfo<ThreeForce> selectTestQuestionInfoList(){
        List<ThreeForce> list = threeForceService.selectTestQuestionInfoList();
        return toResponsePageInfo(list);
    }


}
