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

import com.hc.business.service.ZccmQuestionTypeService;
import com.hc.core.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * 问题类型表(ZccmQuestionType)表控制层
 *
 * @author java
 * @since 2020-12-07 11:37:04
 */

@RestController
@RequestMapping("/new/api/front/questionType")
public class FrontQuestionTypeController {

    /**
     * 服务对象
     */
    private final ZccmQuestionTypeService questionTypeService;

    public FrontQuestionTypeController(ZccmQuestionTypeService questionTypeService) {
        this.questionTypeService = questionTypeService;
    }

    @GetMapping("/{id}")
    @ApiOperation(value = "依据主键获取 ZccmQuestionType", response = Result.class)
    public Result selectFrontQuestionType(@PathVariable("id") Integer id) {
        return Result.success(this.questionTypeService.queryById(id));
    }

    @GetMapping("/list")
    @ApiOperation(value = "获取 ZccmQuestionType列表(分页)", response = Result.class)
    public Result listFrontQuestionType(@RequestParam(defaultValue = "0") Integer page,
                                        @RequestParam(defaultValue = "0") Integer size) {
        return Result.success(questionTypeService.queryAllByLimit(page, size));
    }


}