|
@@ -2,7 +2,7 @@
|
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
|
|
|
|
|
-package query
|
|
|
|
|
|
|
+package query_fwh_pro
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"context"
|
|
"context"
|
|
@@ -17,14 +17,14 @@ import (
|
|
|
|
|
|
|
|
"gorm.io/plugin/dbresolver"
|
|
"gorm.io/plugin/dbresolver"
|
|
|
|
|
|
|
|
- "fwh-toolbox-server/models/fwh_pro/model"
|
|
|
|
|
|
|
+ "fwh-toolbox-server/models/fwh_pro/model_fwh_pro"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func newIotGateway(db *gorm.DB, opts ...gen.DOOption) iotGateway {
|
|
func newIotGateway(db *gorm.DB, opts ...gen.DOOption) iotGateway {
|
|
|
_iotGateway := iotGateway{}
|
|
_iotGateway := iotGateway{}
|
|
|
|
|
|
|
|
_iotGateway.iotGatewayDo.UseDB(db, opts...)
|
|
_iotGateway.iotGatewayDo.UseDB(db, opts...)
|
|
|
- _iotGateway.iotGatewayDo.UseModel(&model.IotGateway{})
|
|
|
|
|
|
|
+ _iotGateway.iotGatewayDo.UseModel(&model_fwh_pro.IotGateway{})
|
|
|
|
|
|
|
|
tableName := _iotGateway.iotGatewayDo.TableName()
|
|
tableName := _iotGateway.iotGatewayDo.TableName()
|
|
|
_iotGateway.ALL = field.NewAsterisk(tableName)
|
|
_iotGateway.ALL = field.NewAsterisk(tableName)
|
|
@@ -445,17 +445,17 @@ type IIotGatewayDo interface {
|
|
|
Count() (count int64, err error)
|
|
Count() (count int64, err error)
|
|
|
Scopes(funcs ...func(gen.Dao) gen.Dao) IIotGatewayDo
|
|
Scopes(funcs ...func(gen.Dao) gen.Dao) IIotGatewayDo
|
|
|
Unscoped() IIotGatewayDo
|
|
Unscoped() IIotGatewayDo
|
|
|
- Create(values ...*model.IotGateway) error
|
|
|
|
|
- CreateInBatches(values []*model.IotGateway, batchSize int) error
|
|
|
|
|
- Save(values ...*model.IotGateway) error
|
|
|
|
|
- First() (*model.IotGateway, error)
|
|
|
|
|
- Take() (*model.IotGateway, error)
|
|
|
|
|
- Last() (*model.IotGateway, error)
|
|
|
|
|
- Find() ([]*model.IotGateway, error)
|
|
|
|
|
- FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.IotGateway, err error)
|
|
|
|
|
- FindInBatches(result *[]*model.IotGateway, batchSize int, fc func(tx gen.Dao, batch int) error) error
|
|
|
|
|
|
|
+ Create(values ...*model_fwh_pro.IotGateway) error
|
|
|
|
|
+ CreateInBatches(values []*model_fwh_pro.IotGateway, batchSize int) error
|
|
|
|
|
+ Save(values ...*model_fwh_pro.IotGateway) error
|
|
|
|
|
+ First() (*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ Take() (*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ Last() (*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ Find() ([]*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model_fwh_pro.IotGateway, err error)
|
|
|
|
|
+ FindInBatches(result *[]*model_fwh_pro.IotGateway, batchSize int, fc func(tx gen.Dao, batch int) error) error
|
|
|
Pluck(column field.Expr, dest interface{}) error
|
|
Pluck(column field.Expr, dest interface{}) error
|
|
|
- Delete(...*model.IotGateway) (info gen.ResultInfo, err error)
|
|
|
|
|
|
|
+ Delete(...*model_fwh_pro.IotGateway) (info gen.ResultInfo, err error)
|
|
|
Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
|
Update(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
|
|
|
UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
|
UpdateSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
|
|
|
Updates(value interface{}) (info gen.ResultInfo, err error)
|
|
Updates(value interface{}) (info gen.ResultInfo, err error)
|
|
@@ -467,9 +467,9 @@ type IIotGatewayDo interface {
|
|
|
Assign(attrs ...field.AssignExpr) IIotGatewayDo
|
|
Assign(attrs ...field.AssignExpr) IIotGatewayDo
|
|
|
Joins(fields ...field.RelationField) IIotGatewayDo
|
|
Joins(fields ...field.RelationField) IIotGatewayDo
|
|
|
Preload(fields ...field.RelationField) IIotGatewayDo
|
|
Preload(fields ...field.RelationField) IIotGatewayDo
|
|
|
- FirstOrInit() (*model.IotGateway, error)
|
|
|
|
|
- FirstOrCreate() (*model.IotGateway, error)
|
|
|
|
|
- FindByPage(offset int, limit int) (result []*model.IotGateway, count int64, err error)
|
|
|
|
|
|
|
+ FirstOrInit() (*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ FirstOrCreate() (*model_fwh_pro.IotGateway, error)
|
|
|
|
|
+ FindByPage(offset int, limit int) (result []*model_fwh_pro.IotGateway, count int64, err error)
|
|
|
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
|
|
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
|
|
|
Rows() (*sql.Rows, error)
|
|
Rows() (*sql.Rows, error)
|
|
|
Row() *sql.Row
|
|
Row() *sql.Row
|
|
@@ -571,57 +571,57 @@ func (i iotGatewayDo) Unscoped() IIotGatewayDo {
|
|
|
return i.withDO(i.DO.Unscoped())
|
|
return i.withDO(i.DO.Unscoped())
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) Create(values ...*model.IotGateway) error {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Create(values ...*model_fwh_pro.IotGateway) error {
|
|
|
if len(values) == 0 {
|
|
if len(values) == 0 {
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
return i.DO.Create(values)
|
|
return i.DO.Create(values)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) CreateInBatches(values []*model.IotGateway, batchSize int) error {
|
|
|
|
|
|
|
+func (i iotGatewayDo) CreateInBatches(values []*model_fwh_pro.IotGateway, batchSize int) error {
|
|
|
return i.DO.CreateInBatches(values, batchSize)
|
|
return i.DO.CreateInBatches(values, batchSize)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Save : !!! underlying implementation is different with GORM
|
|
// Save : !!! underlying implementation is different with GORM
|
|
|
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
|
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
|
|
|
-func (i iotGatewayDo) Save(values ...*model.IotGateway) error {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Save(values ...*model_fwh_pro.IotGateway) error {
|
|
|
if len(values) == 0 {
|
|
if len(values) == 0 {
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
return i.DO.Save(values)
|
|
return i.DO.Save(values)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) First() (*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) First() (*model_fwh_pro.IotGateway, error) {
|
|
|
if result, err := i.DO.First(); err != nil {
|
|
if result, err := i.DO.First(); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
} else {
|
|
} else {
|
|
|
- return result.(*model.IotGateway), nil
|
|
|
|
|
|
|
+ return result.(*model_fwh_pro.IotGateway), nil
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) Take() (*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Take() (*model_fwh_pro.IotGateway, error) {
|
|
|
if result, err := i.DO.Take(); err != nil {
|
|
if result, err := i.DO.Take(); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
} else {
|
|
} else {
|
|
|
- return result.(*model.IotGateway), nil
|
|
|
|
|
|
|
+ return result.(*model_fwh_pro.IotGateway), nil
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) Last() (*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Last() (*model_fwh_pro.IotGateway, error) {
|
|
|
if result, err := i.DO.Last(); err != nil {
|
|
if result, err := i.DO.Last(); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
} else {
|
|
} else {
|
|
|
- return result.(*model.IotGateway), nil
|
|
|
|
|
|
|
+ return result.(*model_fwh_pro.IotGateway), nil
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) Find() ([]*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Find() ([]*model_fwh_pro.IotGateway, error) {
|
|
|
result, err := i.DO.Find()
|
|
result, err := i.DO.Find()
|
|
|
- return result.([]*model.IotGateway), err
|
|
|
|
|
|
|
+ return result.([]*model_fwh_pro.IotGateway), err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.IotGateway, err error) {
|
|
|
|
|
- buf := make([]*model.IotGateway, 0, batchSize)
|
|
|
|
|
|
|
+func (i iotGatewayDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model_fwh_pro.IotGateway, err error) {
|
|
|
|
|
+ buf := make([]*model_fwh_pro.IotGateway, 0, batchSize)
|
|
|
err = i.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
|
err = i.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
|
|
|
defer func() { results = append(results, buf...) }()
|
|
defer func() { results = append(results, buf...) }()
|
|
|
return fc(tx, batch)
|
|
return fc(tx, batch)
|
|
@@ -629,7 +629,7 @@ func (i iotGatewayDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int)
|
|
|
return results, err
|
|
return results, err
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) FindInBatches(result *[]*model.IotGateway, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
|
|
|
|
|
|
+func (i iotGatewayDo) FindInBatches(result *[]*model_fwh_pro.IotGateway, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
|
|
return i.DO.FindInBatches(result, batchSize, fc)
|
|
return i.DO.FindInBatches(result, batchSize, fc)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -655,23 +655,23 @@ func (i iotGatewayDo) Preload(fields ...field.RelationField) IIotGatewayDo {
|
|
|
return &i
|
|
return &i
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) FirstOrInit() (*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) FirstOrInit() (*model_fwh_pro.IotGateway, error) {
|
|
|
if result, err := i.DO.FirstOrInit(); err != nil {
|
|
if result, err := i.DO.FirstOrInit(); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
} else {
|
|
} else {
|
|
|
- return result.(*model.IotGateway), nil
|
|
|
|
|
|
|
+ return result.(*model_fwh_pro.IotGateway), nil
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) FirstOrCreate() (*model.IotGateway, error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) FirstOrCreate() (*model_fwh_pro.IotGateway, error) {
|
|
|
if result, err := i.DO.FirstOrCreate(); err != nil {
|
|
if result, err := i.DO.FirstOrCreate(); err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
} else {
|
|
} else {
|
|
|
- return result.(*model.IotGateway), nil
|
|
|
|
|
|
|
+ return result.(*model_fwh_pro.IotGateway), nil
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) FindByPage(offset int, limit int) (result []*model.IotGateway, count int64, err error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) FindByPage(offset int, limit int) (result []*model_fwh_pro.IotGateway, count int64, err error) {
|
|
|
result, err = i.Offset(offset).Limit(limit).Find()
|
|
result, err = i.Offset(offset).Limit(limit).Find()
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return
|
|
return
|
|
@@ -700,7 +700,7 @@ func (i iotGatewayDo) Scan(result interface{}) (err error) {
|
|
|
return i.DO.Scan(result)
|
|
return i.DO.Scan(result)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (i iotGatewayDo) Delete(models ...*model.IotGateway) (result gen.ResultInfo, err error) {
|
|
|
|
|
|
|
+func (i iotGatewayDo) Delete(models ...*model_fwh_pro.IotGateway) (result gen.ResultInfo, err error) {
|
|
|
return i.DO.Delete(models)
|
|
return i.DO.Delete(models)
|
|
|
}
|
|
}
|
|
|
|
|
|