1234567891011121314151617181920212223242526272829303132333435363738 |
- package whatsapp
- import (
- "context"
- "wechat-api/hook/aliyun"
- "wechat-api/internal/svc"
- "wechat-api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type CreateQrcodeLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewCreateQrcodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateQrcodeLogic {
- return &CreateQrcodeLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx}
- }
- func (l *CreateQrcodeLogic) CreateQrcode(req *types.CreateQrcodeReq) (*types.BaseMsgResp, error) {
- resp := types.BaseMsgResp{Msg: "创建成功"}
- _, err := aliyun.CreateCamsQrcode(req.Phone, req.WaId, req.GenerateQrImage, req.PrefilledMessage)
- l.Logger.Infof("create qrcode err:%v\n", err)
- if err != nil {
- resp.Msg = err.Error()
- resp.Code = 1
- }
- return &resp, nil
- }
|