remove_qrcode_logic.go 809 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package whatsapp
  2. import (
  3. "context"
  4. "wechat-api/hook/aliyun"
  5. "wechat-api/internal/svc"
  6. "wechat-api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type RemoveQrcodeLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewRemoveQrcodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveQrcodeLogic {
  15. return &RemoveQrcodeLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx}
  19. }
  20. func (l *RemoveQrcodeLogic) RemoveQrcode(req *types.RemoveQrcodeReq) (*types.BaseMsgResp, error) {
  21. resp := types.BaseMsgResp{Msg: "删除成功"}
  22. _, err := aliyun.RemoveCamsQrcode(req.Phone, req.WaId, req.QrdlCode)
  23. l.Logger.Infof("remove qrcode err:%v\n", err)
  24. if err != nil {
  25. resp.Msg = err.Error()
  26. resp.Code = 1
  27. }
  28. return &resp, nil
  29. }