服务增加不同架构的编译代码,区分windows与linux的相同方法进行交叉编译
This commit is contained in:
41
internal/logic/os/os.go
Normal file
41
internal/logic/os/os.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package os
|
||||
|
||||
import (
|
||||
"github.com/ayflying/utility_go/service"
|
||||
"github.com/gogf/gf/v2/os/gcmd"
|
||||
)
|
||||
|
||||
type systrayType struct {
|
||||
Icon string `json:"icon" dc:"图标"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Tooltip string `json:"tooltip" dc:"提示"`
|
||||
}
|
||||
|
||||
type sOS struct {
|
||||
systray *systrayType
|
||||
}
|
||||
|
||||
func New() *sOS {
|
||||
return &sOS{
|
||||
systray: &systrayType{},
|
||||
}
|
||||
}
|
||||
func init() {
|
||||
service.RegisterOS(New())
|
||||
}
|
||||
|
||||
func (s *sOS) Load(title string, tooltip string, ico string) {
|
||||
if title == "" {
|
||||
title = gcmd.GetArg(0).String()
|
||||
}
|
||||
if tooltip == "" {
|
||||
tooltip = gcmd.GetArg(0).String()
|
||||
}
|
||||
|
||||
s.systray = &systrayType{
|
||||
Icon: ico,
|
||||
Title: title,
|
||||
Tooltip: tooltip,
|
||||
}
|
||||
s.start()
|
||||
}
|
||||
Reference in New Issue
Block a user