Documentation ¶
Overview ¶
Package dbclient 定义数据库操作的方法, orm 等。
Index ¶
- Constants
- type DBClient
- func (client *DBClient) BatchCreateUCSyncRecord(records []*UCSyncRecord) error
- func (client *DBClient) BulkInsert(objects interface{}, excludeColumns ...string) error
- func (db *DBClient) Close() error
- func (client *DBClient) CreateUCSyncRecord(ucSyncRecord *UCSyncRecord) error
- func (client *DBClient) DeleteRecordByTime(t time.Time) error
- func (client *DBClient) GetFaieldRecord(size int) ([]UCSyncRecord, error)
- func (client *DBClient) GetLastNRecord(n int) ([]UCSyncRecord, error)
- func (client *DBClient) GetRecordByUCIDs(ucid []int64) ([]UCSyncRecord, error)
- func (client *DBClient) UpdateRecord(record *UCSyncRecord) error
- type UCSyncRecord
Constants ¶
View Source
const BULK_INSERT_CHUNK_SIZE = 3000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBClient ¶
func (*DBClient) BatchCreateUCSyncRecord ¶
func (client *DBClient) BatchCreateUCSyncRecord(records []*UCSyncRecord) error
BatchCreateUCSyncRecord 批量插入 uc 审计同步记录
func (*DBClient) BulkInsert ¶
BulkInsert 批量插入
func (*DBClient) CreateUCSyncRecord ¶
func (client *DBClient) CreateUCSyncRecord(ucSyncRecord *UCSyncRecord) error
CreateUCSyncRecord 创建同步历史记录
func (*DBClient) DeleteRecordByTime ¶
DeleteRecordByTime 根据时间删除同步记录
func (*DBClient) GetFaieldRecord ¶
func (client *DBClient) GetFaieldRecord(size int) ([]UCSyncRecord, error)
GetFaieldRecord 获取发送失败的记录
func (*DBClient) GetLastNRecord ¶
func (client *DBClient) GetLastNRecord(n int) ([]UCSyncRecord, error)
GetLastNRecord 获取最后N条同步记录
func (*DBClient) GetRecordByUCIDs ¶
func (client *DBClient) GetRecordByUCIDs(ucid []int64) ([]UCSyncRecord, error)
GetRecordByUCIDs 根据ucid获取同步记录
func (*DBClient) UpdateRecord ¶
func (client *DBClient) UpdateRecord(record *UCSyncRecord) error
UpdateRecord 更新历史记录
type UCSyncRecord ¶
type UCSyncRecord struct { dbengine.BaseModel UCID int64 `gorm:"column:uc_id"` UCEventTime time.Time `gorm:"column:uc_eventtime"` UnReceiver string `gorm:"un_receiver"` // uc事件同步失败的补偿标记 }
UCSyncRecord uc同步历史记录
func (UCSyncRecord) TableName ¶
func (UCSyncRecord) TableName() string
Click to show internal directories.
Click to hide internal directories.