Skip to content

Commit

Permalink
updatec
Browse files Browse the repository at this point in the history
  • Loading branch information
SliverHorn committed Oct 15, 2020
1 parent 34cbc2e commit b676667
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
21 changes: 0 additions & 21 deletions data/datas/datas.go

This file was deleted.

22 changes: 22 additions & 0 deletions data/datas/files.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package datas

import (
"time"

"github.com/flipped-aurora/gva/data/model"
"gorm.io/gorm"
)

var Files = []model.ExaFileUploadAndDownload{
{gorm.Model{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "10.png", "http://qmplusimg.henrongyi.top/gvalogo.png", "png", "158787308910.png"},
{gorm.Model{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "logo.png", "http://qmplusimg.henrongyi.top/1576554439myAvatar.png", "png", "1587973709logo.png"},
}

func InitExaFileUploadAndDownload(db *gorm.DB) (err error) {
return db.Transaction(func(tx *gorm.DB) error {
if tx.Create(&Files).Error != nil { // 遇到错误时回滚事务
return err
}
return nil
})
}

0 comments on commit b676667

Please sign in to comment.