36 lines
1009 B
Go
36 lines
1009 B
Go
|
|
// Code scaffolded by goctl. Safe to edit.
|
||
|
|
package member
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"gateway/internal/model/member/domain/enum"
|
||
|
|
notifenum "gateway/internal/model/notification/domain/enum"
|
||
|
|
"gateway/internal/svc"
|
||
|
|
"gateway/internal/types"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
|
)
|
||
|
|
|
||
|
|
type StartEmailVerificationLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewStartEmailVerificationLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StartEmailVerificationLogic {
|
||
|
|
return &StartEmailVerificationLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *StartEmailVerificationLogic) StartEmailVerification(req *types.VerificationStartReq) (*types.VerificationStartData, error) {
|
||
|
|
actor, err := actorOrErr(l.ctx)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
target := ""
|
||
|
|
if req != nil {
|
||
|
|
target = req.Target
|
||
|
|
}
|
||
|
|
return startVerification(l.ctx, l.svcCtx, actor, enum.OTPPurposeBusinessEmail, notifenum.ChannelEmail, notifenum.NotifyVerifyEmail, target)
|
||
|
|
}
|