25 lines
537 B
Go
25 lines
537 B
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"github.com/go-kratos/kratos/v2/log"
|
|
"voucher/internal/biz/bo"
|
|
)
|
|
|
|
func (j *VoucherService) WechatNotifyConsumer(ctx context.Context, tag, msg string) error {
|
|
|
|
var x *bo.WechatVoucherNotifyBo
|
|
|
|
if err := json.Unmarshal([]byte(msg), x); err != nil {
|
|
return fmt.Errorf("consume msg json.Unmarshal error:%s", err.Error())
|
|
}
|
|
|
|
if err := j.VoucherBiz.WechatNotifyConsumer(ctx, tag, x); err != nil {
|
|
log.Errorf("WechatNotifyConsumer error:%s", err.Error())
|
|
}
|
|
|
|
return nil
|
|
}
|