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.TestPaperCatAddParam;
import com.sundot.airport.exam.logic.manage.model.params.TestPaperCatDelParam;
import com.sundot.airport.exam.logic.manage.model.params.TestPaperCatPageParam;
import com.sundot.airport.exam.logic.manage.model.params.TestPaperCatUpdParam;
import com.sundot.airport.exam.logic.manage.model.result.TestPaperCatAddResult;
import com.sundot.airport.exam.logic.manage.model.result.TestPaperCatGetResult;
import com.sundot.airport.exam.logic.manage.model.result.TestPaperCatPageResult;
import com.sundot.airport.exam.logic.manage.service.TestPaperCatBizService;
import org.springframework.web.bind.annotation.*;

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

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

    @Resource
    private TestPaperCatBizService testPaperCatBizService;

    /**
     * <b>方法名: </b> page <br>
     * <b>说明: </b> 试卷分类表分页列表 <br>
     *
     * @param param com.sundot.airport.model.params.TestPaperCatPageParam 试卷分类表分页列表请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<com.huifanedu.kernel.model.pager.PageData < com.sundot.airport.model.result.TestPaperCatPageResult>>
     * <b>修改履历: </b>
     * @author 2021-06-18 liangxiao
     */
    @PostMapping("/list")
//    @Log(key = 225101, value = "试卷分类表分页列表", mobile = SystemConstant.YGHD_LIANG_XIAO)
    public HttpResult<PageData<TestPaperCatPageResult>> page(@RequestBody TestPaperCatPageParam param) {
        return testPaperCatBizService.pageList(param);
    }

    /**
     * <b>方法名: </b> get <br>
     * <b>说明: </b> 试卷分类表详情 <br>
     *
     * @param tpcId java.lang.String 试卷分类的业务id
     * @return com.huifanedu.kernel.model.response.HttpResult<com.sundot.airport.model.result.TestPaperCatGetResult>
     * <b>修改履历: </b>
     * @author 2021-06-18 liangxiao
     */
    @GetMapping("")
//    @Log(key = 225102, value = "试卷分类表详情", mobile = SystemConstant.YGHD_LIANG_XIAO)
    public HttpResult<TestPaperCatGetResult> get(@Valid @RequestParam("tpcId") String tpcId) {
        return testPaperCatBizService.get(tpcId);
    }

    /**
     * <b>方法名: </b> add <br>
     * <b>说明: </b> 试卷分类表添加 <br>
     *
     * @param param com.sundot.airport.model.params.TestPaperCatAddParam 试卷分类表添加请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<com.sundot.airport.model.result.TestPaperCatAddResult>
     * <b>修改履历: </b>
     * @author 2021-06-18 liangxiao
     */
    @PostMapping("")
//    @Log(key = 225103, value = "试卷分类表添加", mobile = SystemConstant.YGHD_LIANG_XIAO)
    public HttpResult<TestPaperCatAddResult> add(@Valid @RequestBody TestPaperCatAddParam param) {
        return testPaperCatBizService.add(param);
    }

    /**
     * <b>方法名: </b> delete <br>
     * <b>说明: </b> 试卷分类表删除 <br>
     *
     * @param param com.sundot.airport.model.params.TestPaperCatDelParam 试卷分类表删除请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<java.lang.Boolean>
     * <b>修改履历: </b>
     * @author 2021-06-18 liangxiao
     */
    @DeleteMapping("")
//    @Log(key = 225104, value = "试卷分类表删除", mobile = SystemConstant.YGHD_LIANG_XIAO)
    public HttpResult<Boolean> del(@Valid @RequestBody TestPaperCatDelParam param) {
        return testPaperCatBizService.delete(param);
    }

    /**
     * <b>方法名: </b> update <br>
     * <b>说明: </b> 试卷分类表修改 <br>
     *
     * @param param com.sundot.airport.model.params.TestPaperCatUpdParam 试卷分类表修改请求参数
     * @return com.huifanedu.kernel.model.response.HttpResult<java.lang.Boolean>
     * <b>修改履历: </b>
     * @author 2021-06-18 liangxiao
     */
    @PutMapping("")
//    @Log(key = 225105, value = "试卷分类表修改", mobile = SystemConstant.YGHD_LIANG_XIAO)
    public HttpResult<Boolean> update(@Valid @RequestBody TestPaperCatUpdParam param) {
        return testPaperCatBizService.update(param);
    }


}
