package com.qmth.teachcloud.common.api.api;

import com.qmth.boot.api.constant.ApiConstant;
import com.qmth.teachcloud.common.bean.dto.SchoolDto;
import com.qmth.teachcloud.common.service.BasicSchoolService;
import com.qmth.teachcloud.common.util.Result;
import com.qmth.teachcloud.common.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 学校表 前端控制器
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
@Api(tags = "学校Controller")
@RestController
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.common}/school")
public class BasicSchoolController {

    @Autowired
    private BasicSchoolService basicSchoolService;

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

