package com.qmth.paper.library.api;

import com.qmth.boot.api.annotation.Aac;
import com.qmth.boot.api.constant.ApiConstant;
import com.qmth.paper.library.common.bean.dto.SchoolDto;
import com.qmth.paper.library.common.contant.ApiPrefixConstant;
import com.qmth.paper.library.common.service.BasicSchoolService;
import com.qmth.paper.library.common.util.Result;
import com.qmth.paper.library.common.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 学校表 前端控制器
 * </p>
 */
@Api(tags = "学校Controller")
@RestController
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + ApiPrefixConstant.PREFIX_COMMON + "/school")
public class BasicSchoolController {

    @Resource
    private BasicSchoolService basicSchoolService;

    /**
     * 学校查询
     */
    @Aac(auth = false)
    @ApiOperation(value = "查询")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public Result list() {
        List<SchoolDto> list = basicSchoolService.listSchool();
        return ResultUtil.ok(list);
    }
}

