moral.go 871 B

1234567891011121314151617181920212223242526272829303132
  1. package gorpc
  2. import (
  3. "go-common/app/service/main/member/model"
  4. "go-common/library/net/rpc/context"
  5. )
  6. // Moral get user moral.
  7. func (r *RPC) Moral(c context.Context, arg *model.ArgMemberMid, res *model.Moral) (err error) {
  8. var v *model.Moral
  9. if v, err = r.s.Moral(c, arg.Mid); err == nil && res != nil {
  10. *res = *v
  11. }
  12. return
  13. }
  14. // MoralLog get user moral log.
  15. func (r *RPC) MoralLog(c context.Context, arg *model.ArgMemberMid, res *[]*model.UserLog) (err error) {
  16. *res, err = r.s.MoralLog(c, arg.Mid)
  17. return
  18. }
  19. // AddMoral add moral.
  20. func (r *RPC) AddMoral(c context.Context, arg *model.ArgUpdateMoral, res *struct{}) (err error) {
  21. return r.s.UpdateMoral(c, arg)
  22. }
  23. // BatchAddMoral batch add moral.
  24. func (r *RPC) BatchAddMoral(c context.Context, arg *model.ArgUpdateMorals, res *map[int64]int64) (err error) {
  25. *res, err = r.s.UpdateMorals(c, arg)
  26. return
  27. }