LoginController.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.yihu.jw.controller.login;
  2. import com.yihu.jw.restmodel.common.Envelop;
  3. import io.swagger.annotations.Api;
  4. import io.swagger.annotations.ApiOperation;
  5. import io.swagger.annotations.ApiParam;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.cloud.sleuth.Tracer;
  8. import org.springframework.http.MediaType;
  9. import org.springframework.web.bind.annotation.*;
  10. /**
  11. * Created by chenweida on 2017/6/16.
  12. */
  13. @RestController
  14. @Api(value = "登陆相关操作", description = "登陆相关操作")
  15. public class LoginController {
  16. @Autowired
  17. private Tracer tracer;
  18. @GetMapping(value = "/doctorlogin", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  19. @ApiOperation(value = "医生登陆", notes = "医生登陆")
  20. public Envelop doctorlogin(
  21. @ApiParam(name = "account", value = "账号", defaultValue = "") @RequestParam(name = "account", required = true) String account,
  22. @ApiParam(name = "password", value = "密码", defaultValue = "") @RequestParam(name = "password", required = true) String password,
  23. @ApiParam(name = "type", value = "登陆方式(默认1):1账号密码 2账号验证码", defaultValue = "") @RequestParam(name = "type", required = true, defaultValue = "1") Integer type) throws Exception {
  24. //获取用户信息
  25. //判断用户是否存在
  26. //判断密码是否正确
  27. //获取用户的版本信息
  28. //获取用户的模块信息
  29. //用户登陆的信息放入缓存中
  30. //保存登陆日志
  31. return null;
  32. }
  33. @GetMapping(value = "/employLogin", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
  34. @ApiOperation(value = "患者登陆", notes = "患者登陆")
  35. public Envelop employLogin(
  36. @ApiParam(name = "account", value = "账号", defaultValue = "") @RequestParam(name = "account", required = true) String account,
  37. @ApiParam(name = "password", value = "密码", defaultValue = "") @RequestParam(name = "password", required = true) String password,
  38. @ApiParam(name = "type", value = "登陆方式(默认1):1账号密码 2账号验证码", defaultValue = "") @RequestParam(name = "type", required = true, defaultValue = "1") Integer type) throws Exception {
  39. //获取用户信息
  40. //判断用户是否存在
  41. //判断密码是否正确
  42. //获取用户的版本信息
  43. //用户登陆的信息放入缓存中
  44. //保存登陆日志
  45. return null;
  46. }
  47. }