commonphrasesdellogic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/service"
  4. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
  5. "context"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/svc"
  8. )
  9. type CommonPhrasesDelLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewCommonPhrasesDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CommonPhrasesDelLogic {
  15. return &CommonPhrasesDelLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // CommonPhrasesDel 客服话术删除
  22. func (l *CommonPhrasesDelLogic) CommonPhrasesDel(in *knowledge.CommonPhrasesInfoReq) (*knowledge.AddResponse, error) {
  23. result := &knowledge.AddResponse{}
  24. c := service.CommonPhrasesService{}
  25. ok := c.CommonPhrasesDel(in.Id)
  26. if ok {
  27. result.ErrorCode = 0
  28. result.ErrorMsg = "删除成功"
  29. } else {
  30. result.ErrorCode = -1
  31. result.ErrorMsg = "删除失败"
  32. }
  33. return result, nil
  34. }