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

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


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

@RestController
@RequestMapping("/new/api/app/questionType")
public class AppQuestionTypeController {

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

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

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

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


}