hotgo/server/addons/hgexample/logic/sys/index.go

36 lines
916 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Package sys
// @Link https://github.com/bufanyun/hotgo
// @Copyright Copyright (c) 2023 HotGo CLI
// @Author Ms <133814250@qq.com>
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
package sys
import (
"context"
"fmt"
"github.com/gogf/gf/v2/os/gtime"
"hotgo/addons/hgexample/global"
"hotgo/addons/hgexample/model/input/sysin"
"hotgo/addons/hgexample/service"
"hotgo/internal/library/contexts"
)
type sSysIndex struct{}
func NewSysIndex() *sSysIndex {
return &sSysIndex{}
}
func init() {
service.RegisterSysIndex(NewSysIndex())
}
// Test 测试
func (s *sSysIndex) Test(ctx context.Context, in sysin.IndexTestInp) (res *sysin.IndexTestModel, err error) {
res = new(sysin.IndexTestModel)
res.Name = in.Name
res.Module = fmt.Sprintf("当前插件模块是:%s当前应用模块是%s", global.GetSkeleton().Name, contexts.Get(ctx).Module)
res.Time = gtime.Now()
return
}