重构部分枚举, 让models包不依赖其他项目中的包
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"time"
|
||||
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/models"
|
||||
"git.huangwc.com/pig/pig-farm-controller/internal/infra/notify"
|
||||
|
||||
"go.uber.org/zap/zapcore"
|
||||
)
|
||||
@@ -12,7 +11,7 @@ import (
|
||||
// SendTestNotificationRequest 定义了发送测试通知请求的 JSON 结构
|
||||
type SendTestNotificationRequest struct {
|
||||
// Type 指定要测试的通知渠道
|
||||
Type notify.NotifierType `json:"type" validate:"required"`
|
||||
Type models.NotifierType `json:"type" validate:"required"`
|
||||
}
|
||||
|
||||
// ListNotificationRequest 定义了获取通知列表的请求参数
|
||||
@@ -20,7 +19,7 @@ type ListNotificationRequest struct {
|
||||
Page int `json:"page" query:"page"`
|
||||
PageSize int `json:"page_size" query:"page_size"`
|
||||
UserID *uint `json:"user_id" query:"user_id"`
|
||||
NotifierType *notify.NotifierType `json:"notifier_type" query:"notifier_type"`
|
||||
NotifierType *models.NotifierType `json:"notifier_type" query:"notifier_type"`
|
||||
Status *models.NotificationStatus `json:"status" query:"status"`
|
||||
Level *zapcore.Level `json:"level" query:"level"`
|
||||
StartTime *time.Time `json:"start_time" query:"start_time"`
|
||||
@@ -33,11 +32,11 @@ type NotificationDTO struct {
|
||||
ID uint `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
NotifierType notify.NotifierType `json:"notifier_type"`
|
||||
NotifierType models.NotifierType `json:"notifier_type"`
|
||||
UserID uint `json:"user_id"`
|
||||
Title string `json:"title"`
|
||||
Message string `json:"message"`
|
||||
Level zapcore.Level `json:"level"`
|
||||
Level models.SeverityLevel `json:"level"`
|
||||
AlarmTimestamp time.Time `json:"alarm_timestamp"`
|
||||
ToAddress string `json:"to_address"`
|
||||
Status models.NotificationStatus `json:"status"`
|
||||
|
||||
Reference in New Issue
Block a user