assist.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. package client
  2. import (
  3. "context"
  4. "go-common/library/net/rpc"
  5. model "go-common/app/service/main/assist/model/assist"
  6. )
  7. const (
  8. _assists = "RPC.Assists"
  9. _assistIDs = "RPC.AssistIDs"
  10. _assist = "RPC.Assist"
  11. _assistExit = "RPC.AssistExit"
  12. _addAssist = "RPC.AddAssist"
  13. _delAssist = "RPC.DelAssist"
  14. _assistLogs = "RPC.AssistLogs"
  15. _assistLogInfo = "RPC.AssistLogInfo"
  16. _assistLogAdd = "RPC.AssistLogAdd"
  17. _assistLogCancel = "RPC.AssistLogCancel"
  18. _assistUps = "RPC.AssistUps"
  19. )
  20. const (
  21. _appid = "archive.service.assist"
  22. )
  23. var (
  24. _noArg = &struct{}{}
  25. )
  26. // Service def
  27. type Service struct {
  28. client *rpc.Client2
  29. }
  30. // New def
  31. func New(c *rpc.ClientConfig) (s *Service) {
  32. s = &Service{}
  33. s.client = rpc.NewDiscoveryCli(_appid, c)
  34. return s
  35. }
  36. // Assists def
  37. func (s *Service) Assists(c context.Context, arg *model.ArgAssists) (res []*model.Assist, err error) {
  38. err = s.client.Call(c, _assists, arg, &res)
  39. return
  40. }
  41. // AssistIDs def
  42. func (s *Service) AssistIDs(c context.Context, arg *model.ArgAssists) (res []int64, err error) {
  43. err = s.client.Call(c, _assistIDs, arg, &res)
  44. return
  45. }
  46. // Assist def
  47. func (s *Service) Assist(c context.Context, arg *model.ArgAssist) (res *model.AssistRes, err error) {
  48. res = new(model.AssistRes)
  49. err = s.client.Call(c, _assist, arg, &res)
  50. return
  51. }
  52. // AddAssist def
  53. func (s *Service) AddAssist(c context.Context, arg *model.ArgAssist) (err error) {
  54. err = s.client.Call(c, _addAssist, arg, _noArg)
  55. return
  56. }
  57. // DelAssist def
  58. func (s *Service) DelAssist(c context.Context, arg *model.ArgAssist) (err error) {
  59. err = s.client.Call(c, _delAssist, arg, _noArg)
  60. return
  61. }
  62. // AssistLogs def
  63. func (s *Service) AssistLogs(c context.Context, arg *model.ArgAssistLogs) (res []*model.Log, err error) {
  64. err = s.client.Call(c, _assistLogs, arg, &res)
  65. return
  66. }
  67. // AssistLogInfo def
  68. func (s *Service) AssistLogInfo(c context.Context, arg *model.ArgAssistLog) (res *model.Log, err error) {
  69. res = new(model.Log)
  70. err = s.client.Call(c, _assistLogInfo, arg, &res)
  71. return
  72. }
  73. // AssistLogAdd def
  74. func (s *Service) AssistLogAdd(c context.Context, arg *model.ArgAssistLogAdd) (err error) {
  75. err = s.client.Call(c, _assistLogAdd, arg, _noArg)
  76. return
  77. }
  78. // AssistLogCancel def
  79. func (s *Service) AssistLogCancel(c context.Context, arg *model.ArgAssistLog) (err error) {
  80. err = s.client.Call(c, _assistLogCancel, arg, _noArg)
  81. return
  82. }
  83. // AssistUps def
  84. func (s *Service) AssistUps(c context.Context, arg *model.ArgAssistUps) (res *model.AssistUpsPager, err error) {
  85. res = new(model.AssistUpsPager)
  86. err = s.client.Call(c, _assistUps, arg, &res)
  87. return
  88. }
  89. // AssistExit def
  90. func (s *Service) AssistExit(c context.Context, arg *model.ArgAssist) (err error) {
  91. err = s.client.Call(c, _assistExit, arg, _noArg)
  92. return
  93. }