|
@@ -0,0 +1,39 @@
|
|
|
+package logic
|
|
|
+
|
|
|
+import (
|
|
|
+ "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/service"
|
|
|
+ "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledgeclient"
|
|
|
+ "context"
|
|
|
+ "github.com/zeromicro/go-zero/core/logx"
|
|
|
+
|
|
|
+ "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/svc"
|
|
|
+)
|
|
|
+
|
|
|
+type CommonPhrasesAddLogic struct {
|
|
|
+ ctx context.Context
|
|
|
+ svcCtx *svc.ServiceContext
|
|
|
+ logx.Logger
|
|
|
+}
|
|
|
+
|
|
|
+func NewCommonPhrasesAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhrasesAddLogic {
|
|
|
+ return &CommonPhrasesAddLogic{
|
|
|
+ ctx: ctx,
|
|
|
+ svcCtx: svcCtx,
|
|
|
+ Logger: logx.WithContext(ctx),
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// CommonPhrasesAdd 客服话术添加、编辑
|
|
|
+func (l *CommonPhrasesAddLogic) CommonPhrasesAdd(in *knowledgeclient.CommonPhrasesAddReq) (*knowledgeclient.AddResponse, error) {
|
|
|
+ result := &knowledgeclient.AddResponse{}
|
|
|
+ c := service.CommonPhrasesService{}
|
|
|
+ ok, msg := c.CommonPhrasesAdd(in)
|
|
|
+ if ok {
|
|
|
+ result.ErrorCode = 0
|
|
|
+ result.ErrorMsg = msg
|
|
|
+ } else {
|
|
|
+ result.ErrorCode = -1
|
|
|
+ result.ErrorMsg = msg
|
|
|
+ }
|
|
|
+ return result, nil
|
|
|
+}
|