Przeglądaj źródła

修改包的引用

renjiaojiao 2 lat temu
rodzic
commit
75583f11f9

+ 41 - 0
rpc/knowledge/internal/logic/commonphrasesaddlogic.go

@@ -0,0 +1,41 @@
+package logic
+
+import "C"
+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 := c.CommonPhrasesAdd(in)
+	if ok > -1 {
+		result.ErrorCode = 0
+		result.ErrorMsg = "插入成功"
+
+	} else {
+		result.ErrorCode = -1
+		result.ErrorMsg = "插入失败"
+	}
+	return result, nil
+}

+ 39 - 0
rpc/knowledge/internal/logic/commonphrasesdellogic.go

@@ -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 CommonPhrasesDelLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCommonPhrasesDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhrasesDelLogic {
+	return &CommonPhrasesDelLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// CommonPhrasesDel 客服话术删除
+func (l *CommonPhrasesDelLogic) CommonPhrasesDel(in *knowledgeclient.CommonPhrasesInfoReq) (*knowledgeclient.AddResponse, error) {
+	result := &knowledgeclient.AddResponse{}
+	c := service.CommonPhrasesService{}
+	ok := c.CommonPhrasesDel(in.Id)
+	if ok {
+		result.ErrorCode = 0
+		result.ErrorMsg = "删除成功"
+	} else {
+		result.ErrorCode = -1
+		result.ErrorMsg = "删除失败"
+	}
+	return result, nil
+}

+ 40 - 0
rpc/knowledge/internal/logic/commonphrasesinfologic.go

@@ -0,0 +1,40 @@
+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 CommonPhrasesInfoLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCommonPhrasesInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhrasesInfoLogic {
+	return &CommonPhrasesInfoLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// CommonPhrasesInfo 客服话术详情
+func (l *CommonPhrasesInfoLogic) CommonPhrasesInfo(in *knowledgeclient.CommonPhrasesInfoReq) (*knowledgeclient.CommonPhrasesInfoResp, error) {
+	result := &knowledgeclient.CommonPhrasesInfoResp{}
+	c := service.CommonPhrasesService{}
+	info, ok := c.CommonPhrasesInfo(in.Id)
+	if info != nil && ok {
+		result.ErrorCode = 0
+		result.ErrorMsg = "查询成功"
+		result.Data = info
+	} else {
+		result.ErrorCode = -1
+		result.ErrorMsg = "查询出错"
+	}
+	return result, nil
+}

+ 30 - 0
rpc/knowledge/internal/logic/commonphraseslistlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+	"github.com/zeromicro/go-zero/core/logx"
+
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/svc"
+	"bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
+)
+
+type CommonPhrasesListLogic struct {
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+	logx.Logger
+}
+
+func NewCommonPhrasesListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhrasesListLogic {
+	return &CommonPhrasesListLogic{
+		ctx:    ctx,
+		svcCtx: svcCtx,
+		Logger: logx.WithContext(ctx),
+	}
+}
+
+// 客服话术列表
+func (l *CommonPhrasesListLogic) CommonPhrasesList(in *knowledge.CommonPhrasesListReq) (*knowledge.CommonPhrasesListResp, error) {
+	// todo: add your logic here and delete this line
+
+	return &knowledge.CommonPhrasesListResp{}, nil
+}