package com.sundot.airport.web.controller.exam;

import com.sundot.airport.exam.common.HttpResult;
import com.sundot.airport.exam.common.PageData;
import com.sundot.airport.exam.logic.manage.model.params.QuesCatAddParam;
import com.sundot.airport.exam.logic.manage.model.params.QuesCatDelParam;
import com.sundot.airport.exam.logic.manage.model.params.QuesCatPageParam;
import com.sundot.airport.exam.logic.manage.model.params.QuesCatUpdParam;
import com.sundot.airport.exam.logic.manage.model.result.QuesCatAddResult;
import com.sundot.airport.exam.logic.manage.model.result.QuesCatGetResult;
import com.sundot.airport.exam.logic.manage.model.result.QuesCatPageResult;
import com.sundot.airport.exam.logic.manage.service.QuesCatBizService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <b>功能名：</b>QuesCatController<br>
 * <b>说明：</b> 题目分类表管理 <br>
 * <b>著作权：</b> Copyright (C) 2021 HUIFANEDU  CORPORATION<br>
 * <b>修改履历：
 *
 * @author 2021-06-17 liangxiao
 */
@RestController
@RequestMapping("/v1/cs/manage/ques_cat")
public class QuesCatController extends BaseController {

    @Resource
    private QuesCatBizService quesCatBizService;

    /**
     * <b>方法名: </b> page <br>
     * <b>说明: </b> 题目分类表分页列表 <br>
     *
     * @param param com.sundot.airport.model.params.QuesCatPageParam 题目分类表分页列表请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<com.huifanedu.kernel.model.pager.PageData < com.sundot.airport.model.result.QuesCatPageResult>>
     * <b>修改履历: </b>
     * @author 2021-06-17 liangxiao
     */
    @PostMapping("/list")
    public HttpResult<PageData<QuesCatPageResult>> page(@RequestBody QuesCatPageParam param) {
        return quesCatBizService.pageList(param);
    }

    /**
     * <b>方法名: </b> get <br>
     * <b>说明: </b> 题目分类表详情 <br>
     *
     * @param qcId java.lang.String 题目分类的业务id
     * @return com.huifanedu.kernel.model.response.HttpResult<com.sundot.airport.model.result.QuesCatGetResult>
     * <b>修改履历: </b>
     * @author 2021-06-17 liangxiao
     */
    @GetMapping("")
    public HttpResult<QuesCatGetResult> get(@Valid @RequestParam("qcId") String qcId) {
        return quesCatBizService.get(qcId);
    }

    /**
     * <b>方法名: </b> add <br>
     * <b>说明: </b> 题目分类表添加 <br>
     *
     * @param param com.sundot.airport.model.params.QuesCatDelParam 题目分类表添加请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<com.sundot.airport.logic.manage.model.result.QuesCatAddResult><br>
     * <b>修改履历: </b>
     * @author 2021/6/18 liangxiao
     */
    @PostMapping("")
    public HttpResult<QuesCatAddResult> add(@Valid @RequestBody QuesCatAddParam param) {
        return quesCatBizService.add(param);
    }

    /**
     * <b>方法名: </b> delete <br>
     * <b>说明: </b> 题目分类表删除 <br>
     *
     * @param param com.sundot.airport.model.params.QuesCatDelParam 题目分类表删除请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<java.lang.Boolean>
     * <b>修改履历: </b>
     * @author 2021-06-17 liangxiao
     */
    @DeleteMapping("")
    public HttpResult<Boolean> del(@Valid @RequestBody QuesCatDelParam param) {
        return quesCatBizService.delete(param);
    }

    /**
     * <b>方法名: </b> update <br>
     * <b>说明: </b> 题目分类表修改 <br>
     *
     * @param param com.sundot.airport.model.params.QuesCatUpdParam 题目分类表修改请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<java.lang.Boolean>
     * <b>修改履历: </b>
     * @author 2021-06-17 liangxiao
     */
    @PutMapping("")
    public HttpResult<Boolean> update(@Valid @RequestBody QuesCatUpdParam param) {
        return quesCatBizService.update(param);
    }


}
