no message

master
DESKTOP-4RNDQIC\29019 2021-01-12 23:46:51 +08:00
parent 35347859a0
commit 4889fc836f
2 changed files with 3 additions and 3 deletions

View File

@ -408,7 +408,7 @@ func UpdateBook(c *gin.Context) {
resp.Msg = "wrong input"
return
}
e = db.GetOrm().Model(&model.Book{}).Save(&req).Error
e = db.GetOrm().Model(&model.Book{}).Update(&req).Error
if nil != e {
logs.Error(e.Error())
return

View File

@ -4,9 +4,9 @@ import "background/utils"
type Book struct {
ID int64 `gorm:"column:id;primaryKey;default:0" sql:"id" json:"id"`
BookName string `gorm:"column:book_name" sql:"book_name" json:"book_name"`
Author string `gorm:"column:author" sql:"size" json:"size"`
Author string `gorm:"column:author" sql:"author" json:"author"`
Title string `gorm:"column:title" sql:"title" json:"title"`
Tag string `gorm:"column:tag" sql:"tag" json:"json"`
Tag string `gorm:"column:tag" sql:"tag" json:"tag"`
CreateTime utils.OrmTime ` gorm:"column:create_time" sql:"create_time" json:"create_time"`
}
// 设置User的表名为`profiles`