property_review.go 951 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package grpc
  2. import (
  3. "context"
  4. "go-common/app/service/main/member/api"
  5. "go-common/app/service/main/member/model"
  6. )
  7. // AddUserMonitor add user monitor
  8. func (s *MemberServer) AddUserMonitor(ctx context.Context, req *api.AddUserMonitorReq) (*api.EmptyStruct, error) {
  9. argAddUserMonitor := &model.ArgAddUserMonitor{
  10. Mid: req.Mid,
  11. Operator: req.Operator,
  12. Remark: req.Remark,
  13. }
  14. err := s.svr.AddUserMonitor(ctx, argAddUserMonitor)
  15. if err != nil {
  16. return nil, err
  17. }
  18. emptyStruct := &api.EmptyStruct{}
  19. return emptyStruct, nil
  20. }
  21. // IsInMonitor check whether the member is in monitored status
  22. func (s *MemberServer) IsInMonitor(ctx context.Context, req *api.MidReq) (*api.IsInMonitorReply, error) {
  23. res, err := s.svr.IsInMonitor(ctx, &model.ArgMid{
  24. Mid: req.Mid,
  25. RealIP: req.RealIP,
  26. })
  27. if err != nil {
  28. return nil, err
  29. }
  30. isInMonitorReply := &api.IsInMonitorReply{
  31. IsInMonitor: res,
  32. }
  33. return isInMonitorReply, nil
  34. }