mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-21 16:36:48 +08:00
🎨 🔥 ✨ 🚑 集成前端代码的&兼容容器化部署插件的插件改造&提供了一个新的轮播图插件
This commit is contained in:
34
server/addons/flashbanner/controller/home/index.go
Normal file
34
server/addons/flashbanner/controller/home/index.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Package home
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package home
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/addons/flashbanner/api/home/index"
|
||||
"hotgo/addons/flashbanner/service"
|
||||
"hotgo/internal/model"
|
||||
isc "hotgo/internal/service"
|
||||
)
|
||||
|
||||
// Index 基础
|
||||
var Index = cIndex{}
|
||||
|
||||
type cIndex struct{}
|
||||
|
||||
func (a *cIndex) Index(ctx context.Context, req *index.TestReq) (res *index.TestRes, err error) {
|
||||
data, err := service.SysIndex().Test(ctx, &req.IndexTestInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
isc.View().RenderTpl(ctx, "home/index.html", model.View{Data: g.Map{
|
||||
"name": data.Name,
|
||||
"module": data.Module,
|
||||
"time": data.Time,
|
||||
}})
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user