|
@@ -3,13 +3,13 @@ package whatsapp
|
|
|
import (
|
|
|
"context"
|
|
|
|
|
|
- "wechat-api/ent/whatsapp"
|
|
|
- "wechat-api/internal/svc"
|
|
|
- "wechat-api/internal/types"
|
|
|
- "wechat-api/internal/utils/dberrorhandler"
|
|
|
+ "wechat-api/ent/whatsapp"
|
|
|
+ "wechat-api/internal/svc"
|
|
|
+ "wechat-api/internal/types"
|
|
|
+ "wechat-api/internal/utils/dberrorhandler"
|
|
|
|
|
|
- "github.com/suyuan32/simple-admin-common/msg/errormsg"
|
|
|
- "github.com/zeromicro/go-zero/core/logx"
|
|
|
+ "github.com/suyuan32/simple-admin-common/msg/errormsg"
|
|
|
+ "github.com/zeromicro/go-zero/core/logx"
|
|
|
)
|
|
|
|
|
|
type DeleteWhatsappLogic struct {
|
|
@@ -29,9 +29,11 @@ func NewDeleteWhatsappLogic(ctx context.Context, svcCtx *svc.ServiceContext) *De
|
|
|
func (l *DeleteWhatsappLogic) DeleteWhatsapp(req *types.IDsReq) (*types.BaseMsgResp, error) {
|
|
|
_, err := l.svcCtx.DB.Whatsapp.Delete().Where(whatsapp.IDIn(req.Ids...)).Exec(l.ctx)
|
|
|
|
|
|
- if err != nil {
|
|
|
+ if err != nil {
|
|
|
return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
|
|
|
}
|
|
|
|
|
|
- return &types.BaseMsgResp{Msg: errormsg.DeleteSuccess}, nil
|
|
|
+ _ = l.svcCtx.Rds.Del(l.ctx, "wa_info")
|
|
|
+
|
|
|
+ return &types.BaseMsgResp{Msg: errormsg.DeleteSuccess}, nil
|
|
|
}
|