engineerper 1 년 전
부모
커밋
b5d8a66153
2개의 변경된 파일14개의 추가작업 그리고 14개의 파일을 삭제
  1. 7 7
      model/app/event.go
  2. 7 7
      model/app/picture.go

+ 7 - 7
model/app/event.go

@@ -3,13 +3,13 @@ package app
 import "time"
 
 type Event struct {
-	ID         int       `json:"id" gorm:"column:id"`
-	EventType  string    `json:"eventType" gorm:"column:event_type"`
-	EventCode  string    `json:"eventCode" gorm:"column:event_code"`
-	MacAddress string    `json:"macAddress" gorm:"column:mac_address"`
-	CreatedAt  time.Time `json:"startTime" gorm:"column:start_time"`
-	HandleTime time.Time `json:"handleTime" gorm:"column:handle_time"`
-	HandleBy   int       `json:"handleBy" gorm:"column:handle_by"`
+	ID         int       `json:"id" gorm:"column:id;comment:id"`
+	EventType  string    `json:"eventType" gorm:"column:event_type;comment:事件类型"`
+	EventCode  string    `json:"eventCode" gorm:"column:event_code;comment:事件编码"`
+	MacAddress string    `json:"macAddress" gorm:"column:mac_address;comment:地址"`
+	CreatedAt  time.Time `json:"startTime" gorm:"column:start_time;comment:开始时间"`
+	HandleTime time.Time `json:"handleTime" gorm:"column:handle_time;comment:处理时间"`
+	HandleBy   int       `json:"handleBy" gorm:"column:handle_by;comment:handle_by"`
 }
 
 // TableName Event 表名

+ 7 - 7
model/app/picture.go

@@ -3,13 +3,13 @@ package app
 import "time"
 
 type Picture struct {
-	ID      int       `json:"id" gorm:"id"`
-	EventId int       `json:"eventId" gorm:"event_id"`
-	Name    string    `json:"name" gorm:"name"`
-	Time    time.Time `json:"time" gorm:"time"`
-	Mime    string    `json:"mime" gorm:"mime"`
-	Size    int       `json:"size" gorm:"size"`
-	DataId  int       `json:"dataId" gorm:"data_id"`
+	ID      int       `json:"id" gorm:"id;comment:id"`
+	EventId int       `json:"eventId" gorm:"event_id;comment:事件id"`
+	Name    string    `json:"name" gorm:"name;comment:名称"`
+	Time    time.Time `json:"time" gorm:"time;comment:时间"`
+	Mime    string    `json:"mime" gorm:"mime;comment:协议"`
+	Size    int       `json:"size" gorm:"size;comment:尺寸"`
+	DataId  int       `json:"dataId" gorm:"data_id;comment:数据id"`
 }
 
 func (Picture) TableName() string {