Browse Source

File返回json字段开头字母小写

bigcat 2 years ago
parent
commit
d5c967db5e
2 changed files with 6 additions and 3 deletions
  1. 3 0
      .gitignore
  2. 3 3
      model/file.go

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/main
+/main.exe
+/lims-extend.zip

+ 3 - 3
model/file.go

@@ -2,9 +2,9 @@ package model
 
 type File struct {
 	ID        string `json:"id" gorm:"type:varchar(128);primary_key"`
-	Path      string `gorm:"type:varchar(200);not null"`
-	Delete    int    `gorm:"type:tinyint(1);not null"`
-	Category  string `gorm:"type:varchar(20);not null"`
+	Path      string `json:"path" gorm:"type:varchar(200);not null"`
+	Delete    int    `json:"delete" gorm:"type:tinyint(1);not null"`
+	Category  string `json:"category" gorm:"type:varchar(20);not null"`
 	CreatedAt Time   `json:"created_at" gorm:"column:create_time;type:datetime default CURRENT_TIMESTAMP"`
 	UpdatedAt Time   `json:"updated_at" gorm:"column:update_time;type:datetime default CURRENT_TIMESTAMP"`
 }