From 905e1779a53dfddd66649976c4e486a9eb453b77 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 16 Dec 2021 19:11:46 +0800 Subject: [PATCH] save --- history/history.go | 3 +++ history/service.go | 17 +++++++++++++++++ system/helper.go | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 history/service.go diff --git a/history/history.go b/history/history.go index 95dc4b0..e25ce63 100644 --- a/history/history.go +++ b/history/history.go @@ -50,6 +50,9 @@ func Stop() { } func Send(h *History) { + if h.Type == "" { + h.Type = INFO + } Tunnel <- h } diff --git a/history/service.go b/history/service.go new file mode 100644 index 0000000..143e6a8 --- /dev/null +++ b/history/service.go @@ -0,0 +1,17 @@ +package history + +import "kumoly.io/kumoly/app/system" + +type Service struct { + system.BaseService +} + +func (srv Service) GetName() string { return "history.Service" } +func (srv Service) IsService() bool { return true } +func (srv Service) Main() error { + Start(DBReceiver) + return nil +} +func (srv Service) Del() { + Stop() +} diff --git a/system/helper.go b/system/helper.go index 243843a..ac27e9a 100644 --- a/system/helper.go +++ b/system/helper.go @@ -9,7 +9,7 @@ import ( type BaseService struct{} func (srv BaseService) GetName() string { return "base" } -func (srv BaseService) GetDependencies() []string { return []string{""} } +func (srv BaseService) GetDependencies() []string { return []string{} } func (srv BaseService) IsService() bool { return false } func (srv BaseService) Init() error { return nil } func (srv BaseService) Load() error { return nil }