// Code scaffolded by goctl. Safe to edit.
// goctl 1.10.1

package wiki

import (
	"context"

	"github.com/zeromicro/go-zero/core/logx"
	"sundynix-micro-go/app/plant/api/internal/svc"
	"sundynix-micro-go/app/plant/rpc/plant"
)

type GetWikiClassListLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 百科分类列表
func NewGetWikiClassListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWikiClassListLogic {
	return &GetWikiClassListLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *GetWikiClassListLogic) GetWikiClassList() (interface{}, error) {
	result, err := l.svcCtx.PlantRpc.GetWikiClassList(l.ctx, &plant.IdReq{})
	if err != nil {
		return nil, err
	}
	return map[string]interface{}{"list": result.List}, nil
}
