knowledgelistlogic.go 991 B

12345678910111213141516171819202122232425262728293031323334
  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/internal/svc"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
  6. "context"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type KnowledgeListLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewKnowledgeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *KnowledgeListLogic {
  15. return &KnowledgeListLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // KnowledgeList 知识列表
  22. func (l *KnowledgeListLogic) KnowledgeList(in *knowledge.ListRequest) (*knowledge.ListResponse, error) {
  23. // todo: add your logic here and delete this line
  24. result := &knowledge.ListResponse{}
  25. k := service.KnowledgeService{}
  26. knowledgeList := k.KnowledgeList(in)
  27. result.ErrorCode = 0
  28. result.Data = knowledgeList
  29. return result, nil
  30. }