123456789101112131415161718192021222324252627282930313233343536373839 |
- package logic
- import (
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
- "context"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type KeywordListLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewKeywordListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *KeywordListLogic {
- return &KeywordListLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *KeywordListLogic) KeywordList(req *types.CommonPhrasesQueryReq) (resp *types.CommonRes, err error) {
- res, rErr := l.svcCtx.Knowledge.KeywordList(l.ctx, &knowledge.KeywordListReq{
- AppId: req.AppId,
- })
- if rErr != nil {
- return nil, rErr
- }
- return &types.CommonRes{
- Error_code: int(res.ErrorCode),
- Error_msg: res.ErrorMsg,
- Data: res.Data,
- }, nil
- }
|