审查视图

pkg/domain/received_message.go 606 字节
tangxvhui authored
1 2
package domain
tangxvhui authored
3 4 5 6
import (
	"encoding/json"
	"time"
)
tangxvhui authored
7 8

type ReceivedMessage struct {
tangxvhui authored
9 10 11 12
	MessageId   int64     `json:"MessageId"`
	MessageType string    `json:"MessageType"`
	MessageBody string    `json:"MessageBody"`
	OccurredOn  time.Time `json:"OccurredOn"`
庄敏学 authored
13
	CreatedAt   time.Time `json:"-"`
tangxvhui authored
14 15
}
tangxvhui authored
16 17 18
type MessageBody struct {
	Module string          `json:"module"`
	Action string          `json:"action"`
庄敏学 authored
19
	Data   json.RawMessage `json:"data"` // 具体的对象JSON数据
tangxvhui authored
20 21
}
tangxvhui authored
22 23 24 25
type ReceivedMessageRepository interface {
	SaveMessage(param *ReceivedMessage) error
	FindMessage(id int64) (*ReceivedMessage, error)
}