sendmaillogic.go 966 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/BaseService/biService/rpc/biservice"
  4. "context"
  5. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/svc"
  6. "bp.jydev.jianyu360.cn/BaseService/biService/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type SendMailLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewSendMailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendMailLogic {
  15. return &SendMailLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *SendMailLogic) SendMail(req *types.ExportByDbReq) (resp *types.BiResp, err error) {
  22. res, err := l.svcCtx.BiServiceRpc.SendMail(l.ctx, &biservice.ExportByDbReq{
  23. Token: req.Token,
  24. Title: req.Title,
  25. Content: req.Content,
  26. Mails: req.Mails,
  27. Query: req.Query,
  28. Stype: req.Stype,
  29. })
  30. return &types.BiResp{Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: string(res.Data)}, err
  31. }