rpc_assist.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package server
  2. import (
  3. "go-common/app/service/main/assist/model/assist"
  4. "go-common/library/net/rpc/context"
  5. )
  6. func (r *RPC) Assists(c context.Context, arg *assist.ArgAssists, res *[]*assist.Assist) (err error) {
  7. *res, err = r.s.Assists(c, arg.Mid)
  8. return
  9. }
  10. func (r *RPC) AssistIDs(c context.Context, arg *assist.ArgAssists, res *[]int64) (err error) {
  11. *res, err = r.s.AssistIDs(c, arg.Mid)
  12. return
  13. }
  14. func (r *RPC) Assist(c context.Context, arg *assist.ArgAssist, res *assist.AssistRes) (err error) {
  15. var info *assist.AssistRes
  16. if info, err = r.s.Assist(c, arg.Mid, arg.AssistMid, arg.Type); err == nil && info != nil {
  17. *res = *info
  18. }
  19. return
  20. }
  21. func (r *RPC) AddAssist(c context.Context, arg *assist.ArgAssist, res *struct{}) (err error) {
  22. err = r.s.AddAssist(c, arg.Mid, arg.AssistMid)
  23. return
  24. }
  25. func (r *RPC) DelAssist(c context.Context, arg *assist.ArgAssist, res *struct{}) (err error) {
  26. err = r.s.DelAssist(c, arg.Mid, arg.AssistMid)
  27. return
  28. }
  29. func (r *RPC) AssistUps(c context.Context, arg *assist.ArgAssistUps, res *assist.AssistUpsPager) (err error) {
  30. var info *assist.AssistUpsPager
  31. if info, err = r.s.AssistUps(c, arg.AssistMid, arg.Pn, arg.Ps); err == nil && info != nil {
  32. *res = *info
  33. }
  34. return
  35. }
  36. // AssistExit notice: reuse arg *assist.ArgAssist, except Type field
  37. func (r *RPC) AssistExit(c context.Context, arg *assist.ArgAssist, res *struct{}) (err error) {
  38. err = r.s.Exit(c, arg.Mid, arg.AssistMid)
  39. return
  40. }