用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. syntax = "proto3";
  2. package userrpc;
  3. // 使用token查询用户信息请求结构
  4. message UserRequest {
  5. string dbname = 1;
  6. string token = 2;
  7. }
  8. // 使用username查询用户信息请求结构
  9. message UserInfoByUsername {
  10. string dbname = 1;
  11. string username = 2;
  12. }
  13. // 使用usercode查询用户信息请求结构
  14. message UserInfoByUsercode {
  15. string dbname = 1;
  16. string usercode = 2;
  17. }
  18. // 使用token查询用户信息响应结构
  19. message UserResponse {
  20. string user_id = 1; //ID
  21. string username = 2; //用户名
  22. string nickname = 3; //昵称
  23. string mobile = 4; //手机
  24. string email = 5; //邮箱
  25. string status = 6; //状态
  26. string business_id = 7; //所属商家
  27. string store_id = 8; //门店
  28. string fans_to = 9;//被谁锁粉
  29. string is_vip = 10;//是否VIP
  30. string usercode = 11;//工号
  31. string group_id = 12;//分组ID
  32. string type = 13;//类型
  33. }
  34. // 用户登录请求结构
  35. message LoginRequest {
  36. string dbname = 1;
  37. string account = 2;
  38. string password = 3;
  39. }
  40. // 使用token查询用户信息响应结构
  41. message LoginResponse {
  42. string user_id = 1; //ID
  43. string username = 2; //用户名
  44. string nickname = 3; //昵称
  45. string mobile = 4; //手机
  46. string email = 5; //邮箱
  47. string status = 6; //状态
  48. string business_id = 7; //所属商家
  49. string store_id = 8; //门店
  50. string fans_to = 9;//被谁锁粉
  51. string is_vip = 10;//是否VIP
  52. string token = 11;//token
  53. string usercode = 12;//工号
  54. string group_id = 13;//分组ID
  55. string type = 14;//类型
  56. }
  57. // 信息请求结构
  58. message Request {
  59. string data = 1;
  60. string time = 2;
  61. string sign = 3;
  62. }
  63. // 信息响应结构
  64. message Response {
  65. string data = 1;
  66. string time = 2;
  67. string sign = 3;
  68. }
  69. // rpc方法
  70. service UserService {
  71. rpc getByToken (UserRequest) returns (UserResponse); // 使用token查询用户
  72. rpc login (LoginRequest) returns (LoginResponse); // 登录
  73. rpc getByUsername (UserInfoByUsername) returns (UserResponse); // 使用username查询用户
  74. rpc getByUsercode (UserInfoByUsercode) returns (UserResponse); // 使用usercode查询用户
  75. rpc bindThird (Request) returns (Response); // 绑定第三方账号
  76. rpc getThird(Request) returns (Response); // 查询第三方账号
  77. }