mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-04 22:35:48 +08:00
优化代码
This commit is contained in:
@@ -1 +0,0 @@
|
||||
package models
|
||||
@@ -1 +0,0 @@
|
||||
package models
|
||||
@@ -1,6 +1,7 @@
|
||||
package models
|
||||
package clients
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/goman"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils/ttlcache"
|
||||
@@ -130,7 +131,7 @@ func (this *ClientBrowserDAO) CreateBrowserIfNotExists(tx *dbs.Tx, browserName s
|
||||
op.CreatedDay = timeutil.Format("Ymd")
|
||||
op.State = ClientBrowserStateEnabled
|
||||
browserId, err = this.SaveInt64(tx, op)
|
||||
if err != nil && CheckSQLErrCode(err, 1062 /** duplicate entry **/) {
|
||||
if err != nil && models.CheckSQLErrCode(err, 1062 /** duplicate entry **/) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package models_test
|
||||
package clients_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
@@ -1,4 +1,4 @@
|
||||
package models
|
||||
package clients
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
1
internal/db/models/clients/client_browser_model_ext.go
Normal file
1
internal/db/models/clients/client_browser_model_ext.go
Normal file
@@ -0,0 +1 @@
|
||||
package clients
|
||||
@@ -1,6 +1,7 @@
|
||||
package models
|
||||
package clients
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/goman"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils/ttlcache"
|
||||
@@ -129,7 +130,7 @@ func (this *ClientSystemDAO) CreateSystemIfNotExists(tx *dbs.Tx, systemName stri
|
||||
op.CreatedDay = timeutil.Format("Ymd")
|
||||
op.State = ClientSystemStateEnabled
|
||||
systemId, err = this.SaveInt64(tx, op)
|
||||
if err != nil && CheckSQLErrCode(err, 1062 /** duplicate entry **/) {
|
||||
if err != nil && models.CheckSQLErrCode(err, 1062 /** duplicate entry **/) {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package models_test
|
||||
package clients_test
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
||||
@@ -1,4 +1,4 @@
|
||||
package models
|
||||
package clients
|
||||
|
||||
import "github.com/iwind/TeaGo/dbs"
|
||||
|
||||
1
internal/db/models/clients/client_system_model_ext.go
Normal file
1
internal/db/models/clients/client_system_model_ext.go
Normal file
@@ -0,0 +1 @@
|
||||
package clients
|
||||
Reference in New Issue
Block a user