1234567891011121314151617181920212223242526272829303132333435363738 |
- package logic
- import (
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/rpc/knowledge/knowledge"
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/svc"
- "bp.jydev.jianyu360.cn/SocialPlatform/knowledgeBase/api/knowledge/internal/types"
- )
- type CommonPhrasesInfoLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewCommonPhrasesInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) CommonPhrasesInfoLogic {
- return CommonPhrasesInfoLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *CommonPhrasesInfoLogic) CommonPhrasesInfo(req types.CommonPhrasesInfoOrDelReq) (*types.CommonRes, error) {
- resp, err := l.svcCtx.Knowledge.CommonPhrasesInfo(l.ctx, &knowledge.CommonPhrasesInfoReq{
- Id: req.Id,
- })
- if err != nil {
- return nil, err
- }
- return &types.CommonRes{
- Error_code: int(resp.ErrorCode),
- Error_msg: resp.ErrorMsg,
- Data: resp.Data,
- }, nil
- }
|