dao

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dbclient 定义数据库操作的方法, orm 等。

Index

Constants

View Source
const BULK_INSERT_CHUNK_SIZE = 3000

Variables

This section is empty.

Functions

This section is empty.

Types

type DBClient

type DBClient struct {
	*dbengine.DBEngine
}

func Open

func Open() (*DBClient, error)

func (*DBClient) BatchCreateUCSyncRecord

func (client *DBClient) BatchCreateUCSyncRecord(records []*UCSyncRecord) error

BatchCreateUCSyncRecord 批量插入 uc 审计同步记录

func (*DBClient) BulkInsert

func (client *DBClient) BulkInsert(objects interface{}, excludeColumns ...string) error

BulkInsert 批量插入

func (*DBClient) Close

func (db *DBClient) Close() error

func (*DBClient) CreateUCSyncRecord

func (client *DBClient) CreateUCSyncRecord(ucSyncRecord *UCSyncRecord) error

CreateUCSyncRecord 创建同步历史记录

func (*DBClient) DeleteRecordByTime

func (client *DBClient) DeleteRecordByTime(t time.Time) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL