123456789101112131415161718192021222324252627282930313233343536 |
- package whatsapp
- import (
- "context"
- "wechat-api/hook/aliyun"
- "wechat-api/internal/svc"
- "wechat-api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type SetAutomationLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewSetAutomationLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetAutomationLogic {
- return &SetAutomationLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx}
- }
- func (l *SetAutomationLogic) SetAutomation(req *types.SetAutomationReq) (*types.BaseMsgResp, error) {
- resp := types.BaseMsgResp{}
- _, err := aliyun.SetAutomation(req.WaId, req.PhoneNumber, req.Prompts)
- if err != nil {
- resp.Code = 1
- resp.Msg = err.Error()
- }
- return &resp, nil
- }
|