package com.miaxis.app.controller.school;


import com.miaxis.app.school.domain.SchoolEvaluateLabel;
import com.miaxis.app.school.dto.SchoolEvaluateDto;
import com.miaxis.app.school.service.ISchoolEvaluateService;
import com.miaxis.common.annotation.Log;
import com.miaxis.common.constant.Constants;
import com.miaxis.common.core.controller.BaseController;
import com.miaxis.common.core.domain.Response;
import com.miaxis.common.enums.BusinessTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 【驾校评价】Controller
 *
 * @author wwl
 * @date 2020-12-28
 */
@RestController
@RequestMapping(Constants.STUDENT_PREFIX + "/system/evaluate")
@Api(tags={"【app-驾校评价】"})
public class SchoolEvaluateController extends BaseController{

    @Autowired
    private ISchoolEvaluateService schoolEvaluateService;


    /**
     * 查询驾校评价标签列表
     */
    @GetMapping("/selectSchoolEvaluateLabelList")
    @ApiOperation("查询驾校评价标签列表")
    public Response<List<SchoolEvaluateLabel>> selectSchoolEvaluateLabelList(){
        List<SchoolEvaluateLabel> list = schoolEvaluateService.selectSchoolEvaluateLabelList();
        return Response.success(list);
    }

    /**
     * 新增驾校评价
     */
    @PostMapping("/addSchoolEvaluate")
    @ApiOperation("新增驾校评价")
    public Response addSchoolEvaluate(SchoolEvaluateDto schoolEvaluateDto){
        try {
            return schoolEvaluateService.addSchoolEvaluate(schoolEvaluateDto);
        }catch (Exception e){
            return Response.error();
        }
    }



}
