🎨 优化用户和分类相关接口,新增banner接口
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user