package com.template.api;

import com.template.annotation.PassToken;
import com.template.model.pojo.RepairAdmin;
import com.template.model.request.changePasswordRequest;
import com.template.model.request.loginRequest;
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 javax.validation.Valid;


@RequestMapping("/api/login")
@Api(tags = {"LoginController"}, value = "登录")
public interface LoginControllerAPI {

    @GetMapping(value = "/queryReduce")
    @ApiOperation(value = "查看系统版本", notes = "查看系统版本", httpMethod = "GET")
    CommonResult queryReduce();

    @PostMapping(value = "/Register")
    @ApiOperation(value = "注册", notes = "注册", httpMethod = "POST")
    CommonResult Register(@Validated @RequestBody RepairAdmin loginRequest, BindingResult bindingResult);

    @PostMapping(value = "/Login")
    @ApiOperation(value = "登录", notes = "登录", httpMethod = "POST")
    CommonResult Login(@Validated @RequestBody loginRequest lr, BindingResult bindingResult);

    @PostMapping(value = "/ChangePassword")
    @ApiOperation(value = "修改密码", notes = "修改密码", httpMethod = "POST")
    CommonResult ChangePassword(@Validated @RequestBody changePasswordRequest cpr, @RequestHeader("user_head") String userhead, BindingResult bindingResult);
}
