1 Star 0 Fork 0

ichub/gogateway

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
instance_service_init.go 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
leijmdas 提交于 2024-06-16 19:28 . add
package service
import (
"gitee.com/ichub/goconfig/common/base/baseiface"
"gitee.com/ichub/goconfig/common/basedi"
"github.com/sirupsen/logrus"
)
/*
* ********************************************************
* godi工具生成代码,不建议直接修改!
* ********************************************************
*/
/* ********************************************************
@Title 文件名称: instance_service_init.go
@Desp 描述: 自动注册注入
@Author 作者: LEIJMDAS@163.COM 时间(2024-06-01 10:25:52)
@Update 作者: LEIJMDAS@163.COM 时间(2024-06-01 10:25:52)
* *********************************************************/
const singleNameInstanceService = "centerservice.InstanceService"
// init center load
func init() {
registerBeanInstanceService()
}
// center InstanceService
func registerBeanInstanceService() {
basedi.RegisterLoadBean(singleNameInstanceService, LoadInstanceService)
}
func FindBeanInstanceService() *InstanceService {
bean, ok := basedi.FindBean(singleNameInstanceService).(*InstanceService)
if !ok {
logrus.Errorf("FindBeanInstanceService: failed to cast bean to *InstanceService")
return nil
}
return bean
}
func LoadInstanceService() baseiface.ISingleton {
var s = NewInstanceService()
InjectInstanceService(s)
return s
}
func InjectInstanceService(s *InstanceService) {
logrus.Debug("inject")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ichub/gogateway.git
git@gitee.com:ichub/gogateway.git
ichub
gogateway
gogateway
954c9c1ec508

搜索帮助