fix: offline state version
This commit is contained in:
@@ -139,7 +139,7 @@ type NeState struct {
|
||||
Id int `json:"id" xorm:"pk 'id' autoincr"`
|
||||
NeType string `json:"neType" xorm:"ne_type"`
|
||||
NeId string `json:"neId" xorm:"ne_id"`
|
||||
Version string `json:"version" xorm:"version"`
|
||||
Version string `json:"version" xorm:"column 'version' VARCHAR(16)"`
|
||||
Capability uint32 `json:"capability" xorm:"capability"`
|
||||
SerialNum string `json:"serialNum" xorm:"serial_num"`
|
||||
ExpiryDate string `json:"expiryDate" xorm:"expiry_date"`
|
||||
@@ -157,7 +157,13 @@ func XormInsertNeState(neState *NeState) (int64, error) {
|
||||
session := dbClient.xEngine.NewSession()
|
||||
defer session.Close()
|
||||
affected, err := session.InsertOne(neState)
|
||||
session.Commit()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
err = session.Commit()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return affected, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user