package vo
|
|
import (
|
"database/sql/driver"
|
"encoding/json"
|
"errors"
|
)
|
|
type Subscribe struct {
|
SubscribeID string `json:"SubscribeID"`
|
Title string `json:"Title"`
|
SubscribeDetail string `json:"SubscribeDetail"`
|
ResourceURI string `json:"ResourceURI"`
|
ApplicantName string `json:"ApplicantName"`
|
ApplicantOrg string `json:"ApplicantOrg"`
|
BeginTime string `json:"BeginTime"` // Kept as string for direct compatibility
|
EndTime string `json:"EndTime"` // Kept as string for direct compatibility
|
ReceiveAddr string `json:"ReceiveAddr"`
|
ReportInterval int `json:"ReportInterval"`
|
Reason string `json:"Reason"`
|
OperateType int `json:"OperateType"`
|
SubscribeStatus int `json:"SubscribeStatus"`
|
SubscribeCancelOrg string `json:"SubscribeCancelOrg"`
|
SubscribeCancelPerson string `json:"SubscribeCancelPerson"`
|
CancelTime string `json:"CancelTime"` // Kept as string for direct compatibility
|
CancelReason string `json:"CancelReason"`
|
}
|
|
func (s *Subscribe) Scan(value interface{}) error {
|
b, ok := value.([]byte)
|
if !ok {
|
return errors.New("failed to unmarshal Author value")
|
}
|
var config Subscribe
|
err := json.Unmarshal(b, &config)
|
if err != nil {
|
return err
|
}
|
*s = config
|
return nil
|
}
|
|
func (s Subscribe) Value() (driver.Value, error) {
|
return json.Marshal(s)
|
}
|
|
type RequestSubscribe struct {
|
SubscribeListObject struct {
|
SubscribeObject []Subscribe `json:"SubscribeObject"`
|
} `json:"SubscribeListObject"`
|
}
|
|
type RequestSubscribeNotification struct {
|
SubscribeNotificationListObject struct {
|
SubscribeNotificationObject []interface{} `json:"SubscribeNotificationObject"`
|
} `json:"SubscribeNotificationListObject"`
|
}
|
|
type DeviceNotification struct {
|
NotificationID string
|
SubscribeID string
|
Title string
|
TriggerTime string
|
InfoIDs string
|
ExecuteOperation int
|
DeviceList NotificationApeList
|
}
|
|
type FaceNotification struct {
|
NotificationID string
|
SubscribeID string
|
Title string
|
TriggerTime string
|
InfoIDs string
|
FaceObjectList NotificationFaceList
|
}
|