🎨 优化用户和分类相关接口,新增banner接口

This commit is contained in:
2025-06-23 17:04:44 +08:00
parent a5ae680f94
commit cf0f60d221
29 changed files with 695 additions and 299 deletions

View File

@@ -5,6 +5,7 @@ import (
"git.echol.cn/loser/lckt/global"
"git.echol.cn/loser/lckt/model/category"
categoryReq "git.echol.cn/loser/lckt/model/category/request"
"go.uber.org/zap"
)
type CategoryService struct{}
@@ -83,3 +84,12 @@ func (catService *CategoryService) GetCategoryPublic(ctx context.Context) {
// 此方法为获取数据源定义的数据
// 请自行实现
}
func (catService *CategoryService) GetIndexCategoryList() (list []category.Category, err error) {
err = global.GVA_DB.Model(&category.Category{}).Where("categories.index = 1").Find(&list).Error
if err != nil {
global.GVA_LOG.Error("获取首页分类失败", zap.Error(err))
return nil, err
}
return
}