Documentation ¶
Index ¶
- type BaseRepository
- func (b *BaseRepository) Query(ctx context.Context, cq common.Query, list interface{}, count interface{}, ...) (page *common.Pagination, err error)
- func (b *BaseRepository) ReadById(ctx context.Context, id int64, bean interface{}, cols ...string) (bool, error)
- func (b *BaseRepository) Save(bean interface{}) (int64, error)
- func (b *BaseRepository) Session(ctx context.Context) *xorm.Session
- func (b *BaseRepository) TxSave(tx *xorm.Session, bean interface{}) (int64, error)
- func (b *BaseRepository) TxUpdate(tx *xorm.Session, id int64, bean interface{}, cols ...string) (int64, error)
- func (b *BaseRepository) Update(id int64, bean interface{}, cols ...string) (int64, error)
- func (b *BaseRepository) Xorm() *xorm.Engine
- type Entity
- type IBaseRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseRepository ¶
type BaseRepository struct {
// contains filtered or unexported fields
}
func NewBaseRepository ¶
func (*BaseRepository) Query ¶
func (b *BaseRepository) Query(ctx context.Context, cq common.Query, list interface{}, count interface{}, cols ...string) (page *common.Pagination, err error)
func (*BaseRepository) Save ¶
func (b *BaseRepository) Save(bean interface{}) (int64, error)
func (*BaseRepository) Session ¶
func (b *BaseRepository) Session(ctx context.Context) *xorm.Session
func (*BaseRepository) TxSave ¶
func (b *BaseRepository) TxSave(tx *xorm.Session, bean interface{}) (int64, error)
func (*BaseRepository) Update ¶
func (b *BaseRepository) Update(id int64, bean interface{}, cols ...string) (int64, error)
func (*BaseRepository) Xorm ¶
func (b *BaseRepository) Xorm() *xorm.Engine
type Entity ¶
type Entity struct { Id int64 `xorm:"pk autoincr bigint comment('主键/周进/2020-02-02')" json:"id"` CreateBy int64 `xorm:"bigint not null comment('创建者/周进/2020-02-02')" json:"createBy"` CreateTime int64 `xorm:"bigint not null comment('创建时间/周进/2020-02-02')" json:"createTime"` LastModifyBy int64 `xorm:"bigint null COMMENT('记录最后修改者/黄旭龙/2020-02-02')" json:"lastModifyBy"` LastModifyTime int64 `xorm:"bigint null COMMENT('记录最后修改时间/黄旭龙/2020-02-02')" json:"lastModifyTime"` }
func (*Entity) BeforeInsert ¶
func (t *Entity) BeforeInsert()
func (*Entity) BeforeUpdate ¶
func (t *Entity) BeforeUpdate()
type IBaseRepository ¶
type IBaseRepository interface { Save(bean interface{}) (int64, error) Update(id int64, bean interface{}, cols ...string) (int64, error) ReadById(ctx context.Context, id int64, bean interface{}, cols ...string) (bool, error) Query(ctx context.Context, cq common.Query, list interface{}, count interface{}, cols ...string) (page *common.Pagination, err error) Session(ctx context.Context) *xorm.Session TxSave(tx *xorm.Session, bean interface{}) (int64, error) TxUpdate(tx *xorm.Session, id int64, bean interface{}, cols ...string) (int64, error) }
Click to show internal directories.
Click to hide internal directories.