1、接口概览
2、控制器:LoginController
package cn.org.xcore.edusys.controller;
import cn.org.xcore.edusys.common.bean.ApiResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
* 登录注册接口
*
* @author 李海林 手机:13802780104|微信:lihailin9073|Email:767679879@qq.com
* @copyright 个人开发者李海林版权所有,产品详情及技术服务请登录官网查询[http://www.x-core.org.cn]
* @create 2019-08-20 07:33
*/
@Api(tags = "01-登录模块")
@RestController
public class LoginController {
@ApiOperation(value = "登录页面")
@GetMapping("/login_p")
public ApiResponse login() {
return ApiResponse.error("尚未登录,请登录!");
}
@ApiOperation(value = "用户登录", notes = " ")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "username", value = "", required = true),
@ApiImplicitParam(paramType = "query", name = "password", value = "", required = true)
})
@PostMapping("/login")
public void validateUserLogin(@RequestParam(name = "username") String username, @RequestParam(name = "password") String password){
// TODO 这里面不需要写任何代码,由Spring Security 和它的 UserDeatilsService去处理
}
@ApiOperation(value = "注销登录", notes = " ")
@GetMapping("/logout")
public void quit(){
// TODO 这里面不需要写任何代码,由Spring Security 去处理
}
@ApiOperation(value = "学生注册", notes = " ")
@ApiImplicitParams({
@ApiImplicitParam(paramType = "query", name = "mobile", value = "", required = true),
@ApiImplicitParam(paramType = "query", name = "username", value = "", required = true),
@ApiImplicitParam(paramType = "query", name = "password", value = "", required = true)
})
@PostMapping("/register")
public ApiResponse register(@RequestParam(name = "mobile") String mobile, @RequestParam(name = "username") String username, @RequestParam(name = "password") String password){
// 面向培训机构的学生客户开放注册
return ApiResponse.error("机构已暂停学生注册服务,请等待注册开放通知!");
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/10470.html