golang-im聊天
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.

business.int.proto 939 B

2 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. syntax = "proto3";
  2. package pb;
  3. option go_package = "gim/pkg/pb/";
  4. service BusinessInt {
  5. // 权限校验
  6. rpc Auth (AuthReq) returns (Empty);
  7. // 批量获取用户信息
  8. rpc GetUser (GetUserReq) returns (GetUserResp);
  9. // 批量获取用户信息
  10. rpc GetUsers (GetUsersReq) returns (GetUsersResp);
  11. }
  12. message Empty{}
  13. message User {
  14. int64 user_id = 1; // 用户id
  15. string nickname = 2; // 昵称
  16. int32 sex = 3; // 性别
  17. string avatar_url = 4; // 头像地址
  18. string extra = 5; // 附加字段
  19. int64 create_time = 6; // 创建时间
  20. int64 update_time = 7; // 更新时间
  21. }
  22. message GetUserReq {
  23. int64 user_id = 1; // 用户id
  24. }
  25. message GetUserResp {
  26. User user = 1; // 用户信息
  27. }
  28. message AuthReq {
  29. int64 user_id = 1;
  30. int64 device_id = 2;
  31. string token = 3;
  32. }
  33. message GetUsersReq {
  34. map<int64, int32> user_ids = 1; // 用户id
  35. }
  36. message GetUsersResp {
  37. map<int64, User> users = 1; // 用户信息
  38. }