add_friend_by_phone_logic.go 934 B

123456789101112131415161718192021222324252627282930313233343536
  1. package add_friend
  2. import (
  3. "context"
  4. "wechat-api/internal/logic/chat"
  5. "wechat-api/internal/svc"
  6. "wechat-api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type AddFriendByPhoneLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewAddFriendByPhoneLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddFriendByPhoneLogic {
  15. return &AddFriendByPhoneLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx}
  19. }
  20. func (l *AddFriendByPhoneLogic) AddFriendByPhone(req *types.AddWechatFriendLogInfo) (resp *types.BaseMsgResp, err error) {
  21. // todo: add your logic here and delete this line
  22. chatLogic := chat.NewAddFriendByPhoneLogic(l.ctx, l.svcCtx)
  23. nreq := &types.AddFriendByPhoneReq{Type: req.Type,
  24. WeChatIds: req.WeChatIds,
  25. Phones: req.Phones,
  26. Message: req.Message,
  27. CallbackURL: req.CallbackURL}
  28. return chatLogic.AddFriendByPhone(nreq)
  29. }