重构部分枚举, 让models包不依赖其他项目中的包
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/logs"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -65,7 +66,7 @@ func (l *larkNotifier) Send(ctx context.Context, content AlarmContent, toAddr st
|
||||
"tag": "lark_md",
|
||||
"content": fmt.Sprintf("## %s\n**级别**: %s\n**时间**: %s\n\n%s",
|
||||
content.Title,
|
||||
content.Level.String(),
|
||||
content.Level,
|
||||
content.Timestamp.Format(DefaultTimeFormat),
|
||||
content.Message,
|
||||
),
|
||||
@@ -171,8 +172,8 @@ func (l *larkNotifier) getAccessToken(ctx context.Context) (string, error) {
|
||||
}
|
||||
|
||||
// Type 返回通知器的类型
|
||||
func (l *larkNotifier) Type() NotifierType {
|
||||
return NotifierTypeLark
|
||||
func (l *larkNotifier) Type() models.NotifierType {
|
||||
return models.NotifierTypeLark
|
||||
}
|
||||
|
||||
// --- API 数据结构 ---
|
||||
|
||||
Reference in New Issue
Block a user