Documentation ¶
Index ¶
- type Dao
- func (d *Dao) CreateNote(ctx context.Context, note *Note, assets []*NoteAsset) (uint64, error)
- func (d *Dao) DB() sqlx.SqlConn
- func (d *Dao) DeleteNote(ctx context.Context, noteId uint64) error
- func (d *Dao) TransactCtx(ctx context.Context, fns ...xsql.TransactFunc) error
- func (d *Dao) UpdateNote(ctx context.Context, note *Note, assets []*NoteAsset) error
- type Note
- type NoteAsset
- type NoteAssetDao
- func (r *NoteAssetDao) BatchInsert(ctx context.Context, assets []*NoteAsset) error
- func (r *NoteAssetDao) BatchInsertTx(ctx context.Context, tx sqlx.Session, assets []*NoteAsset) error
- func (r *NoteAssetDao) DeleteByNoteId(ctx context.Context, noteId uint64) error
- func (r *NoteAssetDao) DeleteByNoteIdTx(ctx context.Context, tx sqlx.Session, noteId uint64) error
- func (r *NoteAssetDao) ExcludeDeleteByNoteId(ctx context.Context, noteId uint64, assetKeys []string) error
- func (r *NoteAssetDao) ExcludeDeleteByNoteIdTx(ctx context.Context, tx sqlx.Session, noteId uint64, assetKeys []string) error
- func (r *NoteAssetDao) FindByNoteId(ctx context.Context, noteId uint64) ([]*NoteAsset, error)
- func (r *NoteAssetDao) FindByNoteIdTx(ctx context.Context, tx sqlx.Session, noteId uint64) ([]*NoteAsset, error)
- func (r *NoteAssetDao) FindByNoteIds(ctx context.Context, noteIds []uint64) ([]*NoteAsset, error)
- func (r *NoteAssetDao) FindOne(ctx context.Context, id uint64) (*NoteAsset, error)
- func (r *NoteAssetDao) Insert(ctx context.Context, asset *NoteAsset) error
- func (r *NoteAssetDao) InsertTx(ctx context.Context, tx sqlx.Session, asset *NoteAsset) error
- type NoteDao
- func (d *NoteDao) CacheDelNote(ctx context.Context, nid uint64) error
- func (d *NoteDao) CacheGetNote(ctx context.Context, nid uint64) (*Note, error)
- func (d *NoteDao) CacheSetNote(ctx context.Context, model *Note) error
- func (r *NoteDao) Delete(ctx context.Context, id uint64) error
- func (r *NoteDao) DeleteTx(ctx context.Context, tx sqlx.Session, id uint64) error
- func (r *NoteDao) FindOne(ctx context.Context, id uint64) (*Note, error)
- func (r *NoteDao) GetPrivateAll(ctx context.Context) ([]*Note, error)
- func (r *NoteDao) GetPrivateByCursor(ctx context.Context, id uint64, count int) ([]*Note, error)
- func (r *NoteDao) GetPrivateCount(ctx context.Context) (uint64, error)
- func (r *NoteDao) GetPrivateLastId(ctx context.Context) (uint64, error)
- func (r *NoteDao) GetPublicAll(ctx context.Context) ([]*Note, error)
- func (r *NoteDao) GetPublicByCursor(ctx context.Context, id uint64, count int) ([]*Note, error)
- func (r *NoteDao) GetPublicCount(ctx context.Context) (uint64, error)
- func (r *NoteDao) GetPublicLastId(ctx context.Context) (uint64, error)
- func (r *NoteDao) Insert(ctx context.Context, note *Note) (uint64, error)
- func (r *NoteDao) InsertTx(ctx context.Context, tx sqlx.Session, note *Note) (uint64, error)
- func (r *NoteDao) ListByOwner(ctx context.Context, uid uint64) ([]*Note, error)
- func (r *NoteDao) Update(ctx context.Context, note *Note) error
- func (r *NoteDao) UpdateTx(ctx context.Context, tx sqlx.Session, note *Note) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct { NoteDao *NoteDao NoteAssetRepo *NoteAssetDao // contains filtered or unexported fields }
func (*Dao) CreateNote ¶
事务插入
func (*Dao) TransactCtx ¶
事务中执行
type NoteAssetDao ¶
type NoteAssetDao struct {
// contains filtered or unexported fields
}
func NewNoteAssetDao ¶
func NewNoteAssetDao(db sqlx.SqlConn) *NoteAssetDao
func (*NoteAssetDao) BatchInsert ¶
func (r *NoteAssetDao) BatchInsert(ctx context.Context, assets []*NoteAsset) error
func (*NoteAssetDao) BatchInsertTx ¶
func (*NoteAssetDao) DeleteByNoteId ¶
func (r *NoteAssetDao) DeleteByNoteId(ctx context.Context, noteId uint64) error
func (*NoteAssetDao) DeleteByNoteIdTx ¶
func (*NoteAssetDao) ExcludeDeleteByNoteId ¶
func (*NoteAssetDao) ExcludeDeleteByNoteIdTx ¶
func (*NoteAssetDao) FindByNoteId ¶
func (*NoteAssetDao) FindByNoteIdTx ¶
func (*NoteAssetDao) FindByNoteIds ¶
type NoteDao ¶
type NoteDao struct {
// contains filtered or unexported fields
}
func (*NoteDao) CacheDelNote ¶
func (*NoteDao) CacheGetNote ¶
func (*NoteDao) CacheSetNote ¶
func (*NoteDao) GetPrivateAll ¶
func (*NoteDao) GetPrivateByCursor ¶
func (*NoteDao) GetPrivateCount ¶
func (*NoteDao) GetPrivateLastId ¶
func (*NoteDao) GetPublicByCursor ¶
func (*NoteDao) GetPublicCount ¶
func (*NoteDao) GetPublicLastId ¶
func (*NoteDao) ListByOwner ¶
Click to show internal directories.
Click to hide internal directories.