rts-sim-testing-service/db/dbquery/auth_role_api_path.gen.go

389 lines
12 KiB
Go

// 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 dbquery
import (
"context"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/schema"
"gorm.io/gen"
"gorm.io/gen/field"
"gorm.io/plugin/dbresolver"
"joylink.club/bj-rtsts-server/db/model"
)
func newAuthRoleAPIPath(db *gorm.DB, opts ...gen.DOOption) authRoleAPIPath {
_authRoleAPIPath := authRoleAPIPath{}
_authRoleAPIPath.authRoleAPIPathDo.UseDB(db, opts...)
_authRoleAPIPath.authRoleAPIPathDo.UseModel(&model.AuthRoleAPIPath{})
tableName := _authRoleAPIPath.authRoleAPIPathDo.TableName()
_authRoleAPIPath.ALL = field.NewAsterisk(tableName)
_authRoleAPIPath.ID = field.NewInt32(tableName, "id")
_authRoleAPIPath.Rid = field.NewInt32(tableName, "rid")
_authRoleAPIPath.Pid = field.NewInt32(tableName, "pid")
_authRoleAPIPath.fillFieldMap()
return _authRoleAPIPath
}
type authRoleAPIPath struct {
authRoleAPIPathDo
ALL field.Asterisk
ID field.Int32 // 主键
Rid field.Int32 // 角色ID
Pid field.Int32 // 路径ID
fieldMap map[string]field.Expr
}
func (a authRoleAPIPath) Table(newTableName string) *authRoleAPIPath {
a.authRoleAPIPathDo.UseTable(newTableName)
return a.updateTableName(newTableName)
}
func (a authRoleAPIPath) As(alias string) *authRoleAPIPath {
a.authRoleAPIPathDo.DO = *(a.authRoleAPIPathDo.As(alias).(*gen.DO))
return a.updateTableName(alias)
}
func (a *authRoleAPIPath) updateTableName(table string) *authRoleAPIPath {
a.ALL = field.NewAsterisk(table)
a.ID = field.NewInt32(table, "id")
a.Rid = field.NewInt32(table, "rid")
a.Pid = field.NewInt32(table, "pid")
a.fillFieldMap()
return a
}
func (a *authRoleAPIPath) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
_f, ok := a.fieldMap[fieldName]
if !ok || _f == nil {
return nil, false
}
_oe, ok := _f.(field.OrderExpr)
return _oe, ok
}
func (a *authRoleAPIPath) fillFieldMap() {
a.fieldMap = make(map[string]field.Expr, 3)
a.fieldMap["id"] = a.ID
a.fieldMap["rid"] = a.Rid
a.fieldMap["pid"] = a.Pid
}
func (a authRoleAPIPath) clone(db *gorm.DB) authRoleAPIPath {
a.authRoleAPIPathDo.ReplaceConnPool(db.Statement.ConnPool)
return a
}
func (a authRoleAPIPath) replaceDB(db *gorm.DB) authRoleAPIPath {
a.authRoleAPIPathDo.ReplaceDB(db)
return a
}
type authRoleAPIPathDo struct{ gen.DO }
type IAuthRoleAPIPathDo interface {
gen.SubQuery
Debug() IAuthRoleAPIPathDo
WithContext(ctx context.Context) IAuthRoleAPIPathDo
WithResult(fc func(tx gen.Dao)) gen.ResultInfo
ReplaceDB(db *gorm.DB)
ReadDB() IAuthRoleAPIPathDo
WriteDB() IAuthRoleAPIPathDo
As(alias string) gen.Dao
Session(config *gorm.Session) IAuthRoleAPIPathDo
Columns(cols ...field.Expr) gen.Columns
Clauses(conds ...clause.Expression) IAuthRoleAPIPathDo
Not(conds ...gen.Condition) IAuthRoleAPIPathDo
Or(conds ...gen.Condition) IAuthRoleAPIPathDo
Select(conds ...field.Expr) IAuthRoleAPIPathDo
Where(conds ...gen.Condition) IAuthRoleAPIPathDo
Order(conds ...field.Expr) IAuthRoleAPIPathDo
Distinct(cols ...field.Expr) IAuthRoleAPIPathDo
Omit(cols ...field.Expr) IAuthRoleAPIPathDo
Join(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo
LeftJoin(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo
RightJoin(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo
Group(cols ...field.Expr) IAuthRoleAPIPathDo
Having(conds ...gen.Condition) IAuthRoleAPIPathDo
Limit(limit int) IAuthRoleAPIPathDo
Offset(offset int) IAuthRoleAPIPathDo
Count() (count int64, err error)
Scopes(funcs ...func(gen.Dao) gen.Dao) IAuthRoleAPIPathDo
Unscoped() IAuthRoleAPIPathDo
Create(values ...*model.AuthRoleAPIPath) error
CreateInBatches(values []*model.AuthRoleAPIPath, batchSize int) error
Save(values ...*model.AuthRoleAPIPath) error
First() (*model.AuthRoleAPIPath, error)
Take() (*model.AuthRoleAPIPath, error)
Last() (*model.AuthRoleAPIPath, error)
Find() ([]*model.AuthRoleAPIPath, error)
FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.AuthRoleAPIPath, err error)
FindInBatches(result *[]*model.AuthRoleAPIPath, batchSize int, fc func(tx gen.Dao, batch int) error) error
Pluck(column field.Expr, dest interface{}) error
Delete(...*model.AuthRoleAPIPath) (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)
Updates(value interface{}) (info gen.ResultInfo, err error)
UpdateColumn(column field.Expr, value interface{}) (info gen.ResultInfo, err error)
UpdateColumnSimple(columns ...field.AssignExpr) (info gen.ResultInfo, err error)
UpdateColumns(value interface{}) (info gen.ResultInfo, err error)
UpdateFrom(q gen.SubQuery) gen.Dao
Attrs(attrs ...field.AssignExpr) IAuthRoleAPIPathDo
Assign(attrs ...field.AssignExpr) IAuthRoleAPIPathDo
Joins(fields ...field.RelationField) IAuthRoleAPIPathDo
Preload(fields ...field.RelationField) IAuthRoleAPIPathDo
FirstOrInit() (*model.AuthRoleAPIPath, error)
FirstOrCreate() (*model.AuthRoleAPIPath, error)
FindByPage(offset int, limit int) (result []*model.AuthRoleAPIPath, count int64, err error)
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
Scan(result interface{}) (err error)
Returning(value interface{}, columns ...string) IAuthRoleAPIPathDo
UnderlyingDB() *gorm.DB
schema.Tabler
}
func (a authRoleAPIPathDo) Debug() IAuthRoleAPIPathDo {
return a.withDO(a.DO.Debug())
}
func (a authRoleAPIPathDo) WithContext(ctx context.Context) IAuthRoleAPIPathDo {
return a.withDO(a.DO.WithContext(ctx))
}
func (a authRoleAPIPathDo) ReadDB() IAuthRoleAPIPathDo {
return a.Clauses(dbresolver.Read)
}
func (a authRoleAPIPathDo) WriteDB() IAuthRoleAPIPathDo {
return a.Clauses(dbresolver.Write)
}
func (a authRoleAPIPathDo) Session(config *gorm.Session) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Session(config))
}
func (a authRoleAPIPathDo) Clauses(conds ...clause.Expression) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Clauses(conds...))
}
func (a authRoleAPIPathDo) Returning(value interface{}, columns ...string) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Returning(value, columns...))
}
func (a authRoleAPIPathDo) Not(conds ...gen.Condition) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Not(conds...))
}
func (a authRoleAPIPathDo) Or(conds ...gen.Condition) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Or(conds...))
}
func (a authRoleAPIPathDo) Select(conds ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Select(conds...))
}
func (a authRoleAPIPathDo) Where(conds ...gen.Condition) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Where(conds...))
}
func (a authRoleAPIPathDo) Order(conds ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Order(conds...))
}
func (a authRoleAPIPathDo) Distinct(cols ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Distinct(cols...))
}
func (a authRoleAPIPathDo) Omit(cols ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Omit(cols...))
}
func (a authRoleAPIPathDo) Join(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Join(table, on...))
}
func (a authRoleAPIPathDo) LeftJoin(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.LeftJoin(table, on...))
}
func (a authRoleAPIPathDo) RightJoin(table schema.Tabler, on ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.RightJoin(table, on...))
}
func (a authRoleAPIPathDo) Group(cols ...field.Expr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Group(cols...))
}
func (a authRoleAPIPathDo) Having(conds ...gen.Condition) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Having(conds...))
}
func (a authRoleAPIPathDo) Limit(limit int) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Limit(limit))
}
func (a authRoleAPIPathDo) Offset(offset int) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Offset(offset))
}
func (a authRoleAPIPathDo) Scopes(funcs ...func(gen.Dao) gen.Dao) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Scopes(funcs...))
}
func (a authRoleAPIPathDo) Unscoped() IAuthRoleAPIPathDo {
return a.withDO(a.DO.Unscoped())
}
func (a authRoleAPIPathDo) Create(values ...*model.AuthRoleAPIPath) error {
if len(values) == 0 {
return nil
}
return a.DO.Create(values)
}
func (a authRoleAPIPathDo) CreateInBatches(values []*model.AuthRoleAPIPath, batchSize int) error {
return a.DO.CreateInBatches(values, batchSize)
}
// Save : !!! underlying implementation is different with GORM
// The method is equivalent to executing the statement: db.Clauses(clause.OnConflict{UpdateAll: true}).Create(values)
func (a authRoleAPIPathDo) Save(values ...*model.AuthRoleAPIPath) error {
if len(values) == 0 {
return nil
}
return a.DO.Save(values)
}
func (a authRoleAPIPathDo) First() (*model.AuthRoleAPIPath, error) {
if result, err := a.DO.First(); err != nil {
return nil, err
} else {
return result.(*model.AuthRoleAPIPath), nil
}
}
func (a authRoleAPIPathDo) Take() (*model.AuthRoleAPIPath, error) {
if result, err := a.DO.Take(); err != nil {
return nil, err
} else {
return result.(*model.AuthRoleAPIPath), nil
}
}
func (a authRoleAPIPathDo) Last() (*model.AuthRoleAPIPath, error) {
if result, err := a.DO.Last(); err != nil {
return nil, err
} else {
return result.(*model.AuthRoleAPIPath), nil
}
}
func (a authRoleAPIPathDo) Find() ([]*model.AuthRoleAPIPath, error) {
result, err := a.DO.Find()
return result.([]*model.AuthRoleAPIPath), err
}
func (a authRoleAPIPathDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.AuthRoleAPIPath, err error) {
buf := make([]*model.AuthRoleAPIPath, 0, batchSize)
err = a.DO.FindInBatches(&buf, batchSize, func(tx gen.Dao, batch int) error {
defer func() { results = append(results, buf...) }()
return fc(tx, batch)
})
return results, err
}
func (a authRoleAPIPathDo) FindInBatches(result *[]*model.AuthRoleAPIPath, batchSize int, fc func(tx gen.Dao, batch int) error) error {
return a.DO.FindInBatches(result, batchSize, fc)
}
func (a authRoleAPIPathDo) Attrs(attrs ...field.AssignExpr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Attrs(attrs...))
}
func (a authRoleAPIPathDo) Assign(attrs ...field.AssignExpr) IAuthRoleAPIPathDo {
return a.withDO(a.DO.Assign(attrs...))
}
func (a authRoleAPIPathDo) Joins(fields ...field.RelationField) IAuthRoleAPIPathDo {
for _, _f := range fields {
a = *a.withDO(a.DO.Joins(_f))
}
return &a
}
func (a authRoleAPIPathDo) Preload(fields ...field.RelationField) IAuthRoleAPIPathDo {
for _, _f := range fields {
a = *a.withDO(a.DO.Preload(_f))
}
return &a
}
func (a authRoleAPIPathDo) FirstOrInit() (*model.AuthRoleAPIPath, error) {
if result, err := a.DO.FirstOrInit(); err != nil {
return nil, err
} else {
return result.(*model.AuthRoleAPIPath), nil
}
}
func (a authRoleAPIPathDo) FirstOrCreate() (*model.AuthRoleAPIPath, error) {
if result, err := a.DO.FirstOrCreate(); err != nil {
return nil, err
} else {
return result.(*model.AuthRoleAPIPath), nil
}
}
func (a authRoleAPIPathDo) FindByPage(offset int, limit int) (result []*model.AuthRoleAPIPath, count int64, err error) {
result, err = a.Offset(offset).Limit(limit).Find()
if err != nil {
return
}
if size := len(result); 0 < limit && 0 < size && size < limit {
count = int64(size + offset)
return
}
count, err = a.Offset(-1).Limit(-1).Count()
return
}
func (a authRoleAPIPathDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
count, err = a.Count()
if err != nil {
return
}
err = a.Offset(offset).Limit(limit).Scan(result)
return
}
func (a authRoleAPIPathDo) Scan(result interface{}) (err error) {
return a.DO.Scan(result)
}
func (a authRoleAPIPathDo) Delete(models ...*model.AuthRoleAPIPath) (result gen.ResultInfo, err error) {
return a.DO.Delete(models)
}
func (a *authRoleAPIPathDo) withDO(do gen.Dao) *authRoleAPIPathDo {
a.DO = *do.(*gen.DO)
return a
}