|
|
// 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 dao
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
|
|
|
"gorm.io/gorm"
|
|
|
"gorm.io/gorm/clause"
|
|
|
"gorm.io/gorm/schema"
|
|
|
|
|
|
"gorm.io/gen"
|
|
|
"gorm.io/gen/field"
|
|
|
|
|
|
"gorm.io/plugin/dbresolver"
|
|
|
|
|
|
"joybuywork/internal/repository/model"
|
|
|
)
|
|
|
|
|
|
func newFissionNotifyResp(db *gorm.DB, opts ...gen.DOOption) fissionNotifyResp {
|
|
|
_fissionNotifyResp := fissionNotifyResp{}
|
|
|
|
|
|
_fissionNotifyResp.fissionNotifyRespDo.UseDB(db, opts...)
|
|
|
_fissionNotifyResp.fissionNotifyRespDo.UseModel(&model.FissionNotifyResp{})
|
|
|
|
|
|
tableName := _fissionNotifyResp.fissionNotifyRespDo.TableName()
|
|
|
_fissionNotifyResp.ALL = field.NewAsterisk(tableName)
|
|
|
_fissionNotifyResp.ID = field.NewInt64(tableName, "id")
|
|
|
_fissionNotifyResp.CreatedAt = field.NewInt64(tableName, "created_at")
|
|
|
_fissionNotifyResp.UpdatedAt = field.NewInt64(tableName, "updated_at")
|
|
|
_fissionNotifyResp.NotifyID = field.NewInt64(tableName, "notify_id")
|
|
|
_fissionNotifyResp.Resp = field.NewString(tableName, "resp")
|
|
|
|
|
|
_fissionNotifyResp.fillFieldMap()
|
|
|
|
|
|
return _fissionNotifyResp
|
|
|
}
|
|
|
|
|
|
type fissionNotifyResp struct {
|
|
|
fissionNotifyRespDo fissionNotifyRespDo
|
|
|
|
|
|
ALL field.Asterisk
|
|
|
ID field.Int64
|
|
|
CreatedAt field.Int64
|
|
|
UpdatedAt field.Int64
|
|
|
NotifyID field.Int64 // 回调记录id(fission_notify表)
|
|
|
Resp field.String // 回调结果
|
|
|
|
|
|
fieldMap map[string]field.Expr
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyResp) Table(newTableName string) *fissionNotifyResp {
|
|
|
f.fissionNotifyRespDo.UseTable(newTableName)
|
|
|
return f.updateTableName(newTableName)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyResp) As(alias string) *fissionNotifyResp {
|
|
|
f.fissionNotifyRespDo.DO = *(f.fissionNotifyRespDo.As(alias).(*gen.DO))
|
|
|
return f.updateTableName(alias)
|
|
|
}
|
|
|
|
|
|
func (f *fissionNotifyResp) updateTableName(table string) *fissionNotifyResp {
|
|
|
f.ALL = field.NewAsterisk(table)
|
|
|
f.ID = field.NewInt64(table, "id")
|
|
|
f.CreatedAt = field.NewInt64(table, "created_at")
|
|
|
f.UpdatedAt = field.NewInt64(table, "updated_at")
|
|
|
f.NotifyID = field.NewInt64(table, "notify_id")
|
|
|
f.Resp = field.NewString(table, "resp")
|
|
|
|
|
|
f.fillFieldMap()
|
|
|
|
|
|
return f
|
|
|
}
|
|
|
|
|
|
func (f *fissionNotifyResp) WithContext(ctx context.Context) *fissionNotifyRespDo {
|
|
|
return f.fissionNotifyRespDo.WithContext(ctx)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyResp) TableName() string { return f.fissionNotifyRespDo.TableName() }
|
|
|
|
|
|
func (f fissionNotifyResp) Alias() string { return f.fissionNotifyRespDo.Alias() }
|
|
|
|
|
|
func (f *fissionNotifyResp) GetFieldByName(fieldName string) (field.OrderExpr, bool) {
|
|
|
_f, ok := f.fieldMap[fieldName]
|
|
|
if !ok || _f == nil {
|
|
|
return nil, false
|
|
|
}
|
|
|
_oe, ok := _f.(field.OrderExpr)
|
|
|
return _oe, ok
|
|
|
}
|
|
|
|
|
|
func (f *fissionNotifyResp) fillFieldMap() {
|
|
|
f.fieldMap = make(map[string]field.Expr, 5)
|
|
|
f.fieldMap["id"] = f.ID
|
|
|
f.fieldMap["created_at"] = f.CreatedAt
|
|
|
f.fieldMap["updated_at"] = f.UpdatedAt
|
|
|
f.fieldMap["notify_id"] = f.NotifyID
|
|
|
f.fieldMap["resp"] = f.Resp
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyResp) clone(db *gorm.DB) fissionNotifyResp {
|
|
|
f.fissionNotifyRespDo.ReplaceConnPool(db.Statement.ConnPool)
|
|
|
return f
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyResp) replaceDB(db *gorm.DB) fissionNotifyResp {
|
|
|
f.fissionNotifyRespDo.ReplaceDB(db)
|
|
|
return f
|
|
|
}
|
|
|
|
|
|
type fissionNotifyRespDo struct{ gen.DO }
|
|
|
|
|
|
func (f fissionNotifyRespDo) Debug() *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Debug())
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) WithContext(ctx context.Context) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.WithContext(ctx))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) ReadDB() *fissionNotifyRespDo {
|
|
|
return f.Clauses(dbresolver.Read)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) WriteDB() *fissionNotifyRespDo {
|
|
|
return f.Clauses(dbresolver.Write)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Session(config *gorm.Session) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Session(config))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Clauses(conds ...clause.Expression) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Clauses(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Returning(value interface{}, columns ...string) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Returning(value, columns...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Not(conds ...gen.Condition) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Not(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Or(conds ...gen.Condition) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Or(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Select(conds ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Select(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Where(conds ...gen.Condition) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Where(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Exists(subquery interface{ UnderlyingDB() *gorm.DB }) *fissionNotifyRespDo {
|
|
|
return f.Where(field.CompareSubQuery(field.ExistsOp, nil, subquery.UnderlyingDB()))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Order(conds ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Order(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Distinct(cols ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Distinct(cols...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Omit(cols ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Omit(cols...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Join(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Join(table, on...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) LeftJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.LeftJoin(table, on...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) RightJoin(table schema.Tabler, on ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.RightJoin(table, on...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Group(cols ...field.Expr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Group(cols...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Having(conds ...gen.Condition) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Having(conds...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Limit(limit int) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Limit(limit))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Offset(offset int) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Offset(offset))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Scopes(funcs ...func(gen.Dao) gen.Dao) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Scopes(funcs...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Unscoped() *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Unscoped())
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Create(values ...*model.FissionNotifyResp) error {
|
|
|
if len(values) == 0 {
|
|
|
return nil
|
|
|
}
|
|
|
return f.DO.Create(values)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) CreateInBatches(values []*model.FissionNotifyResp, batchSize int) error {
|
|
|
return f.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 (f fissionNotifyRespDo) Save(values ...*model.FissionNotifyResp) error {
|
|
|
if len(values) == 0 {
|
|
|
return nil
|
|
|
}
|
|
|
return f.DO.Save(values)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) First() (*model.FissionNotifyResp, error) {
|
|
|
if result, err := f.DO.First(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
return result.(*model.FissionNotifyResp), nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Take() (*model.FissionNotifyResp, error) {
|
|
|
if result, err := f.DO.Take(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
return result.(*model.FissionNotifyResp), nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Last() (*model.FissionNotifyResp, error) {
|
|
|
if result, err := f.DO.Last(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
return result.(*model.FissionNotifyResp), nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Find() ([]*model.FissionNotifyResp, error) {
|
|
|
result, err := f.DO.Find()
|
|
|
return result.([]*model.FissionNotifyResp), err
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) FindInBatch(batchSize int, fc func(tx gen.Dao, batch int) error) (results []*model.FissionNotifyResp, err error) {
|
|
|
buf := make([]*model.FissionNotifyResp, 0, batchSize)
|
|
|
err = f.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 (f fissionNotifyRespDo) FindInBatches(result *[]*model.FissionNotifyResp, batchSize int, fc func(tx gen.Dao, batch int) error) error {
|
|
|
return f.DO.FindInBatches(result, batchSize, fc)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Attrs(attrs ...field.AssignExpr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Attrs(attrs...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Assign(attrs ...field.AssignExpr) *fissionNotifyRespDo {
|
|
|
return f.withDO(f.DO.Assign(attrs...))
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Joins(fields ...field.RelationField) *fissionNotifyRespDo {
|
|
|
for _, _f := range fields {
|
|
|
f = *f.withDO(f.DO.Joins(_f))
|
|
|
}
|
|
|
return &f
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Preload(fields ...field.RelationField) *fissionNotifyRespDo {
|
|
|
for _, _f := range fields {
|
|
|
f = *f.withDO(f.DO.Preload(_f))
|
|
|
}
|
|
|
return &f
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) FirstOrInit() (*model.FissionNotifyResp, error) {
|
|
|
if result, err := f.DO.FirstOrInit(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
return result.(*model.FissionNotifyResp), nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) FirstOrCreate() (*model.FissionNotifyResp, error) {
|
|
|
if result, err := f.DO.FirstOrCreate(); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
return result.(*model.FissionNotifyResp), nil
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) FindByPage(offset int, limit int) (result []*model.FissionNotifyResp, count int64, err error) {
|
|
|
result, err = f.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 = f.Offset(-1).Limit(-1).Count()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) ScanByPage(result interface{}, offset int, limit int) (count int64, err error) {
|
|
|
count, err = f.Count()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
err = f.Offset(offset).Limit(limit).Scan(result)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Scan(result interface{}) (err error) {
|
|
|
return f.DO.Scan(result)
|
|
|
}
|
|
|
|
|
|
func (f fissionNotifyRespDo) Delete(models ...*model.FissionNotifyResp) (result gen.ResultInfo, err error) {
|
|
|
return f.DO.Delete(models)
|
|
|
}
|
|
|
|
|
|
func (f *fissionNotifyRespDo) withDO(do gen.Dao) *fissionNotifyRespDo {
|
|
|
f.DO = *do.(*gen.DO)
|
|
|
return f
|
|
|
}
|