package com.template.api;

import com.template.model.request.insertAccountRequest;
import com.template.model.request.insertClubRequest;
import com.template.model.request.updateAccountRequest;
import com.template.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.*;

import java.text.ParseException;


@RequestMapping("/api/alumniUser")
@Api(tags = {"AlumniUserController"}, value = "校友")
public interface AlumniUserControllerAPI {

    /**
     * @param userId
     * @param currentPage 当前页数
     * @param pageCount   一页数据条数
     * @param name        姓名（姓名模糊查询）
     * @param orgName     组织名称（模糊查询）
     * @param collegeId   学院ID
     * @param periodId    学段ID
     * @param majorId     专业ID
     * @param classId     班级ID
     * @return
     */
    @GetMapping(value = "/queryUsersPage")
    @ApiOperation(value = "获取校友分页数据", notes = "获取校友分页数据", httpMethod = "GET")
    CommonResult queryUsersPage(@RequestAttribute Integer userId, @RequestParam int currentPage, @RequestParam int pageCount, String name, String orgName, Integer collegeId, Integer periodId, Integer majorId, Integer classId);


    @GetMapping(value = "/queryAccountPage")
    @ApiOperation(value = "获取账号分页数据", notes = "获取账号分页数据", httpMethod = "GET")
    CommonResult queryAccountPage(@RequestParam int currentPage, @RequestParam int pageCount, String account, String startTime, String endTime);


    @GetMapping(value = "/queryUsers")
    @ApiOperation(value = "获取人员列表数据", notes = "获取人员列表数据", httpMethod = "GET")
    CommonResult queryUsers(String keyword);


    @GetMapping(value = "/queryPageUser")
    @ApiOperation(value = "根据部门获取用户分页数据", notes = "根据部门获取用户分页数据", httpMethod = "GET")
    CommonResult queryPageUser(@RequestParam int currentPage, @RequestParam int pageCount, Integer departmentId);

    /**
     * 根据微卡获取用户信息
     */
    @GetMapping(value = "/queryMobileInfo")
    @ApiOperation(value = "根据微卡获取用户信息", notes = "根据微卡获取用户信息", httpMethod = "GET")
    CommonResult queryMobileInfo(@RequestParam String cardNumber);


    /**
     * 新增账号
     * 账号绑定移动端
     */
    @PostMapping("/insertAccountData")
    @ApiOperation(value = "新增账号", httpMethod = "POST")
    CommonResult insertAccountData(@Validated @RequestBody insertAccountRequest iar, BindingResult bindingResult);


    /**
     * 新增账号
     * 账号绑定移动端
     */
    @PostMapping("/updateAccountData")
    @ApiOperation(value = "编辑账号", httpMethod = "POST")
    CommonResult updateAccountData(@Validated @RequestBody updateAccountRequest iar, BindingResult bindingResult);


    @GetMapping("/queryRoleTypes")
    @ApiOperation(value = "获取角色下拉列表数据", httpMethod = "GET")
    CommonResult queryRoleTypes();


    @GetMapping("/deleteUserById")
    @ApiOperation(value = "根据ID删除账号", httpMethod = "GET")
    CommonResult deleteUserById(@RequestParam int id);


    /**
     * 获取校友通讯录和班级通讯录分页数据 名字模糊查询
     *
     * @param typeId 类型ID
     *               校友通讯录：1
     *               班级通讯录：2
     * @return
     */
    @GetMapping("/queryMobileUserPages")
    @ApiOperation(value = "获取校友通讯录和班级通讯录分页数据", httpMethod = "GET")
    CommonResult queryMobileUserPages(@RequestAttribute Integer userId, @RequestParam int currentPage, @RequestParam int pageCount, @RequestParam int typeId, String name);

    //获取通讯录类型列表数据
    @GetMapping("/queryTypes")
    @ApiOperation(value = "获取通讯录类型列表数据", httpMethod = "GET")
    CommonResult queryTypes();

}
