package com.repair.api;

import com.repair.model.request.insertRepairUserRequest;
import com.repair.model.request.updateAddressBookRequest;
import com.repair.model.request.updateUserDataRequest;
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/repairUser")
@Api(tags = {"RepairUserController"}, value = "用户")
public interface RepairUserControllerAPI {

    @PostMapping(value = "/insertRepairUserSetting")
    @ApiOperation(value = "添加用户", notes = "添加用户数据", httpMethod = "POST")
    CommonResult InsertRepairUser(@Validated @RequestBody insertRepairUserRequest irur) throws Exception;

    @PostMapping(value = "/updateRepairUserSettingById")
    @ApiOperation(value = "编辑用户数据", notes = "编辑用户数据", httpMethod = "POST")
    CommonResult updateRepairUserById(@Validated @RequestBody updateUserDataRequest ra, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/queryPageRepairUser")
    @ApiOperation(value = "用户分页数据", notes = "用户分页数据", httpMethod = "GET")
    CommonResult queryPageRepairUser(@RequestParam int currentPage, @RequestParam int pageCount, String keyWord, Integer teamId, Integer schoolId);

    @GetMapping(value = "/deleteRepairUserSettingById")
    @ApiOperation(value = "根据ID删除指定用户", notes = "根据ID删除指定用户", httpMethod = "GET")
    CommonResult deleteRepairUserById(@RequestParam int id) throws Exception;

    @GetMapping(value = "/queryRepairUserByCardNumber")
    @ApiOperation(value = "根据卡号删除指定用户", notes = "根据卡号删除指定用户", httpMethod = "GET")
    CommonResult queryRepairUserByCardNumber(@RequestParam String cardNumber);

    @GetMapping(value = "/queryPageRepairUsers")
    @ApiOperation(value = "获取派单的人员分页数据", notes = "获取派单的人员分页数据", httpMethod = "GET")
    CommonResult queryPageRepairUsers(@RequestParam int currentPage, @RequestParam int pageCount, Integer recordId, String keyWord);

    @GetMapping(value = "/queryPageOfflineUsers")
    @ApiOperation(value = "获取线下的人员分页数据", notes = "获取线下的人员分页数据", httpMethod = "GET")
    CommonResult queryPageOfflineUsers(Integer currentPage, Integer pageCount, Integer recordId, String keyWord);

    @GetMapping(value = "/getAddressBook")
    @ApiOperation(value = "获取通讯录列表数据", notes = "获取通讯录列表数据", httpMethod = "GET")
    CommonResult getAddressBook(@RequestParam Integer schoolId,@RequestParam Integer userId, String keyWord);

    @PostMapping(value = "/updateAddressBook")
    @ApiOperation(value = "通讯录编辑数据", notes = "通讯录编辑数据", httpMethod = "POST")
    CommonResult updateAddressBook(@Validated @RequestBody updateAddressBookRequest uabp, BindingResult bindingResult);

    @GetMapping(value = "/queryPageCollaborator")
    @ApiOperation(value = "获取协作审核下拉人员分页数据", notes = "获取协作审核下拉人员分页数据", httpMethod = "GET")
    CommonResult queryPageCollaborator(Integer currentPage, Integer pageCount, @RequestParam Integer schoolId,@RequestParam Integer userId, String keyWord, Integer recordId);

    @GetMapping(value = "/queryPositiveReviewPage")
    @ApiOperation(value = "工单完成排行榜分页数据", notes = "工单完成排行榜分页数据", httpMethod = "GET")
    CommonResult queryPositiveReviewPage(@RequestParam int currentPage, @RequestParam int pageCount, @RequestParam Integer schoolId);

    @GetMapping(value = "/insertArticleBuild")
    @ApiOperation(value = "新增报修关联楼栋", notes = "新增报修关联楼栋", httpMethod = "GET")
    CommonResult insertArticleBuild();
}
