package com.repair.api;

import com.repair.model.pojo.RepairArea;
import com.repair.model.request.updateRepairAreaRequest;
import com.repair.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/api/repairArea")
@Api(tags = {"RepairAreaController"}, value = "区域")
public interface RepairAreaControllerAPI {

    @PostMapping(value = "/insertRepairArea")
    @ApiOperation(value = "添加区域", notes = "添加区域数据", httpMethod = "POST")
    CommonResult InsertRepairArea(@Validated @RequestBody RepairArea repairArea, BindingResult bindingResult);

    @PostMapping(value = "/updateRepairAreaById")
    @ApiOperation(value = "编辑区域数据", notes = "编辑区域数据", httpMethod = "POST")
    CommonResult updateRepairAreaById(@Validated @RequestBody updateRepairAreaRequest ra, BindingResult bindingResult);

    @GetMapping(value = "/queryPageRepairArea")
    @ApiOperation(value = "区域分页数据", notes = "区域分页数据", httpMethod = "GET")
    CommonResult queryPageRepairAreas(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleteRepairAreaById")
    @ApiOperation(value = "根据ID删除指定区域", notes = "根据ID删除指定区域", httpMethod = "GET")
    CommonResult deleteRepairAreaById(@RequestParam int id);

    @GetMapping(value = "/queryRepairSchools")
    @ApiOperation(value = "查询校区数据", notes = "查询校区数据", httpMethod = "GET")
    CommonResult queryRepairSchools();

    @GetMapping(value = "/queryRepairAreaTree")
    @ApiOperation(value = "获取区域树形结构数据", notes = "获取区域树形结构数据", httpMethod = "GET")
    CommonResult queryRepairAreaTree(@RequestParam int schoolId);

    @GetMapping(value = "/queryRepairAreaSecond")
    @ApiOperation(value = "获取区域二级树形结构", notes = "获取区域二级树形结构", httpMethod = "GET")
    CommonResult queryRepairAreaSecond(int schoolId);
}
