rpc_log.go 965 B

123456789101112131415161718192021222324252627282930
  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) AssistLogAdd(c context.Context, arg *assist.ArgAssistLogAdd, res *struct{}) (err error) {
  7. err = r.s.AddLog(c, arg.Mid, arg.AssistMid, arg.Type, arg.Action, arg.SubjectID, arg.ObjectID, arg.Detail)
  8. return
  9. }
  10. func (r *RPC) AssistLogCancel(c context.Context, arg *assist.ArgAssistLog, res *struct{}) (err error) {
  11. err = r.s.CancelLog(c, arg.Mid, arg.AssistMid, arg.LogID)
  12. return
  13. }
  14. func (r *RPC) AssistLogs(c context.Context, arg *assist.ArgAssistLogs, res *[]*assist.Log) (err error) {
  15. *res, err = r.s.Logs(c, arg.Mid, arg.AssistMid, arg.Stime, arg.Etime, arg.Pn, arg.Ps)
  16. return
  17. }
  18. func (r *RPC) AssistLogInfo(c context.Context, arg *assist.ArgAssistLog, res *assist.Log) (err error) {
  19. var info *assist.Log
  20. if info, err = r.s.LogInfo(c, arg.LogID, arg.Mid, arg.AssistMid); err == nil && info != nil {
  21. *res = *info
  22. }
  23. return
  24. }