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 UpdateQrcodeLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewUpdateQrcodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateQrcodeLogic {
- return &UpdateQrcodeLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx}
- }
- func (l *UpdateQrcodeLogic) UpdateQrcode(req *types.UpdateQrcodeReq) (*types.BaseMsgResp, error) {
- resp := types.BaseMsgResp{Msg: "修改成功"}
- _, err := aliyun.UpdateCamsQrcode(req.Phone, req.WaId, req.GenerateQrImage, req.PrefilledMessage, req.QrdlCode)
- l.Logger.Infof("update qrcode err:%v\n", err)
- if err != nil {
- resp.Msg = err.Error()
- resp.Code = 1
- }
- return &resp, nil
- }
|