console.proto 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. syntax = "proto3";
  2. option go_package = "./pb";
  3. package pb;
  4. service ConsoleService{
  5. rpc GetProjectInfo(Request) returns (Response) ;
  6. rpc GetUserAmount(Request) returns (Response) ;
  7. rpc EditUserAmount(Request) returns (Response) ;
  8. rpc GetChainConfig(Request) returns (Response) ;
  9. }
  10. message Request {
  11. // 请求信息
  12. google.protobuf.Any body = 1;
  13. }
  14. message Response {
  15. // 结果码
  16. string code = 1;
  17. // 结果消息
  18. string msg = 2;
  19. // 结果详情
  20. google.protobuf.Any data = 3;
  21. }
  22. message GetProjectInfoReq {
  23. string api_key = 1;
  24. }
  25. message GetProjectInfoResp {
  26. int64 project_id = 1; //项目id
  27. string api_key = 2; //api_key
  28. stiring api_secret = 3; //api_secret
  29. int64 chain_id = 4; //链id
  30. int64 user_id =5; //用户id
  31. }
  32. message GetUserAmountReq {
  33. int64 user_id = 1; //用户id
  34. }
  35. message GetUserAmountResp {
  36. int64 user_id = 1; //用户id
  37. string amount = 2; //账户余额
  38. }
  39. message EditUserAmountReq {
  40. int64 user_id = 1; //用户id
  41. string tx_hash = 2; //交易对应的hash
  42. string used = 3; //交易的花费情况
  43. uint32 tx_flow = 4; //交易流向,1为流入,2为流出
  44. string operation = 5; //交易具体操作描述
  45. }
  46. message GetChainConfigReq {
  47. int64 chain_id = 1; //链id
  48. }
  49. message GetChainConfigResp {
  50. int64 chain_id = 1; //链id
  51. string code = 2; //链code
  52. string name = 3; //链名称
  53. string module = 4; //链模块
  54. uint32 status = 5; //链状态,0为正常
  55. }