123456789101112131415161718192021222324252627282930313233343536373839 |
- package logic
- import (
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/service"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/internal/svc"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type KnowledgeDelLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewKnowledgeDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *KnowledgeDelLogic {
- return &KnowledgeDelLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // KnowledgeDel 知识删除
- func (l *KnowledgeDelLogic) KnowledgeDel(in *knowledge.KnowledgeDelReq) (*knowledge.AddResponse, error) {
- // todo: add your logic here and delete this line
- result := &knowledge.AddResponse{}
- k := service.KnowledgeService{}
- ok := k.KnowledgeDel(in.AnswerId)
- if ok {
- result.ErrorCode = 0
- result.ErrorMsg = "删除成功"
- } else {
- result.ErrorCode = -1
- result.ErrorMsg = "删除失败"
- }
- return result, nil
- }
|