优化代码结构,修复查询逻辑,添加构建脚本
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package actions
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"zzman/model"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func FindConfigsByGateway(tx *gorm.DB, macaddr string) ([]model.Config, error) {
|
||||
@@ -20,7 +21,7 @@ func CreateConfigs(tx *gorm.DB, configs []model.Config) error {
|
||||
}
|
||||
|
||||
// 使用事务批量插入配置
|
||||
return tx.Create(&configs).Error
|
||||
return tx.Omit("createtime", "updatetime").Create(&configs).Error
|
||||
}
|
||||
|
||||
func UpdateConfigs(tx *gorm.DB, configs []model.ConfigUpdate) error {
|
||||
|
||||
Reference in New Issue
Block a user