api.proto 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. syntax = "proto3";
  2. package sms.service.v1;
  3. import "app/service/main/sms/model/model.proto";
  4. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  5. option go_package = "v1";
  6. service Sms {
  7. // Send send sms
  8. rpc Send(SendReq) returns(SendReply);
  9. // SendBatch send sms batch
  10. rpc SendBatch(SendBatchReq) returns(SendBatchReply);
  11. }
  12. message AddTemplateReply {}
  13. message AddTemplateReq {
  14. int32 stype = 1 [(gogoproto.moretags) = 'form:"type" validate:"required,min=1"'];
  15. string tcode = 2 [(gogoproto.moretags) = 'form:"code" validate:"required"'];
  16. string template = 3 [(gogoproto.moretags) = 'form:"content" validate:"required"'];
  17. string submitter = 5 [(gogoproto.moretags) = 'form:"submitter"'];
  18. }
  19. message TemplateListReply {
  20. repeated model.ModelTemplate list = 1;
  21. int32 total = 2;
  22. }
  23. message TemplateListReq {
  24. int32 pn = 1 [(gogoproto.moretags) = 'form:"pn" default:"1"'];
  25. int32 ps = 2 [(gogoproto.moretags) = 'form:"ps" default:"10"'];
  26. string st = 3 [(gogoproto.moretags) = 'form:"st"'];
  27. string sw = 4 [(gogoproto.moretags) = 'form:"sw"'];
  28. }
  29. message UpdateTemplateReply {}
  30. message UpdateTemplateReq {
  31. int64 id = 1 [(gogoproto.customname) = "ID", (gogoproto.moretags) = 'form:"id" validate:"required,min=1"'];
  32. int32 stype = 2 [(gogoproto.moretags) = 'form:"type" validate:"required,min=1"'];
  33. int32 status = 3 [(gogoproto.moretags) = 'form:"status"'];
  34. string tcode = 4 [(gogoproto.moretags) = 'form:"code" validate:"required"'];
  35. string template = 5 [(gogoproto.moretags) = 'form:"content" validate:"required"'];
  36. string submitter = 6 [(gogoproto.moretags) = 'form:"submitter"'];
  37. }
  38. message SendReply {}
  39. message SendReq {
  40. int64 mid = 1 [(gogoproto.moretags) = 'form:"mid"'];
  41. string mobile = 2 [(gogoproto.moretags) = 'form:"mobile"'];
  42. string country = 3 [(gogoproto.moretags) = 'form:"country"'];
  43. string tcode = 4 [(gogoproto.moretags) = 'form:"tcode"'];
  44. string tparam = 5 [(gogoproto.moretags) = 'form:"tparam"'];
  45. }
  46. message SendBatchReply {}
  47. message SendBatchReq {
  48. repeated int64 mids = 1 [(gogoproto.moretags) = 'form:"mids,split"'];
  49. repeated string mobiles = 2 [(gogoproto.moretags) = 'form:"mobiles,split"'];
  50. string tcode = 3 [(gogoproto.moretags) = 'form:"tcode"'];
  51. string tparam = 4 [(gogoproto.moretags) = 'form:"tparam"'];
  52. }
  53. message AddTaskReq {
  54. int32 type = 1 [(gogoproto.moretags) = 'form:"type" validate:"required,min=1"'];
  55. int32 business_id = 2 [(gogoproto.customname) = "BusinessID", (gogoproto.moretags) = 'form:"business_id"'];
  56. string template_code = 3 [(gogoproto.moretags) = 'form:"template_code" validate:"required"'];
  57. string desc = 4 [(gogoproto.moretags) = 'form:"desc"'];
  58. string file_name = 5 [(gogoproto.moretags) = 'form:"file_name" validate:"required"'];
  59. string file_path = 6 [(gogoproto.moretags) = 'form:"file_path" validate:"required"'];
  60. int64 send_time = 7 [(gogoproto.moretags) = 'form:"send_time" validate:"required,min=1"'];
  61. }
  62. message AddTaskReply {}
  63. message UpdateTaskReq {
  64. int64 id = 1 [(gogoproto.customname) = "ID", (gogoproto.moretags) = 'form:"id"'];
  65. int32 type = 2 [(gogoproto.moretags) = 'form:"type" validate:"required,min=1"'];
  66. int32 business_id = 3 [(gogoproto.customname) = "BusinessID", (gogoproto.moretags) = 'form:"business_id"'];
  67. string template_code = 4 [(gogoproto.moretags) = 'form:"template_code" validate:"required"'];
  68. string desc = 5 [(gogoproto.moretags) = 'form:"desc"'];
  69. string file_name = 6 [(gogoproto.moretags) = 'form:"file_name" validate:"required"'];
  70. string file_path = 7 [(gogoproto.moretags) = 'form:"file_path" validate:"required"'];
  71. int64 send_time = 8 [(gogoproto.moretags) = 'form:"send_time" validate:"required,min=1"'];
  72. }
  73. message UpdateTaskReply {}
  74. message DeleteTaskReq {
  75. int64 id = 1 [(gogoproto.customname) = "ID", (gogoproto.moretags) = 'form:"id"'];
  76. }
  77. message DeleteTaskReply {}
  78. message TaskInfoReq {
  79. int64 id = 1 [(gogoproto.customname) = "ID", (gogoproto.moretags) = 'form:"id"'];
  80. }
  81. message TaskInfoReply {
  82. model.ModelTask info = 1;
  83. }
  84. message TaskListReq {
  85. int32 pn = 1 [(gogoproto.moretags) = 'form:"pn" default:"1"'];
  86. int32 ps = 2 [(gogoproto.moretags) = 'form:"ps" default:"20"'];
  87. }
  88. message TaskListReply {
  89. repeated model.ModelTask list = 1;
  90. int32 total = 2;
  91. }