Documentation
¶
Index ¶
- type DbBackendImpl
- func (b *DbBackendImpl) CreateAccount(data *models.Account) error
- func (b *DbBackendImpl) CreateAddresses(tx *gorm.DB, data []*models.Address) error
- func (b *DbBackendImpl) CreateFunds(tx *gorm.DB, data *models.PubFunds) error
- func (b *DbBackendImpl) CreateImages(tx *gorm.DB, data []*models.Image) error
- func (b *DbBackendImpl) CreateOrganization(data *models.DonationStat) error
- func (b *DbBackendImpl) CreateSupplies(tx *gorm.DB, data []*models.PubSupplies) error
- func (db *DbBackendImpl) DBTransactionCommit(tx *gorm.DB)
- func (db *DbBackendImpl) DBTransactionRollback(tx *gorm.DB)
- func (db *DbBackendImpl) GetDBTransaction() *gorm.DB
- func (b *DbBackendImpl) QueryAccount(openID, uid string) (*models.Account, error)
- func (b *DbBackendImpl) QueryFunds(uid, targetUID, userType, pubType string, params *structs.QueryParams) ([]*models.PubFunds, error)
- func (b *DbBackendImpl) QueryFundsDetail(id string) (*models.FundsDetail, error)
- func (b *DbBackendImpl) QueryOrgCharities(params *structs.QueryParams) ([]*structs.OrgCharitiesItems, error)
- func (b *DbBackendImpl) QueryOrgCharitiesDetail(uid string) (*structs.OrgCharitiesDetailItem, error)
- func (b *DbBackendImpl) QueryPubByUser(uid, userType, targetUID, pubType string, params *structs.QueryParams) ([]*structs.PubUserItem, error)
- func (b *DbBackendImpl) QueryPubByUserType(userType, targetUID, pubType string, params *structs.QueryParams) ([]*structs.PubUserItem, error)
- func (b *DbBackendImpl) QuerySupplies(uid, targetUID, userType, pubType string, params *structs.QueryParams) ([]*models.PubSupplies, error)
- func (b *DbBackendImpl) QuerySuppliesDetail(id string) (*models.SuppliesDetail, error)
- func (b *DbBackendImpl) UpdateFunds(tx *gorm.DB, fundsID, blockID string) error
- func (b *DbBackendImpl) UpdateFundsBC(tx *gorm.DB, blockID string, funds *models.PubFunds) error
- func (b *DbBackendImpl) UpdateSuppliesBC(tx *gorm.DB, blockID string, supplies *models.PubSupplies) error
- func (b *DbBackendImpl) UpdateSuppliesList(tx *gorm.DB, ps []*models.PubSupplies, data []*structs.PubResp) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbBackendImpl ¶
type DbBackendImpl struct {
database.GormClient
}
DbBackendImpl ...
func NewDBBackend ¶
func NewDBBackend(cfg *database.DBConnectCfg) (*DbBackendImpl, error)
NewDBBackend ...
func (*DbBackendImpl) CreateAccount ¶
func (b *DbBackendImpl) CreateAccount(data *models.Account) error
CreateAccount implement create user account
func (*DbBackendImpl) CreateAddresses ¶
CreateAddresses implement create addresses
func (*DbBackendImpl) CreateFunds ¶
CreateFunds implement receive funds interface
func (*DbBackendImpl) CreateImages ¶
CreateImages implement create images interface
func (*DbBackendImpl) CreateOrganization ¶
func (b *DbBackendImpl) CreateOrganization(data *models.DonationStat) error
CreateOrganization implement create the donation statistics of organization interface
func (*DbBackendImpl) CreateSupplies ¶
func (b *DbBackendImpl) CreateSupplies(tx *gorm.DB, data []*models.PubSupplies) error
CreateSupplies defines the created supplies
func (*DbBackendImpl) DBTransactionCommit ¶
func (db *DbBackendImpl) DBTransactionCommit(tx *gorm.DB)
DBTransactionCommit ...
func (*DbBackendImpl) DBTransactionRollback ¶
func (db *DbBackendImpl) DBTransactionRollback(tx *gorm.DB)
DBTransactionRollback ...
func (*DbBackendImpl) GetDBTransaction ¶
func (db *DbBackendImpl) GetDBTransaction() *gorm.DB
GetDBTransaction ...
func (*DbBackendImpl) QueryAccount ¶
func (b *DbBackendImpl) QueryAccount(openID, uid string) (*models.Account, error)
QueryAccount implement check user account exist or not
func (*DbBackendImpl) QueryFunds ¶
func (b *DbBackendImpl) QueryFunds(uid, targetUID, userType, pubType string, params *structs.QueryParams) ([]*models.PubFunds, error)
QueryFunds implement query funds interface
func (*DbBackendImpl) QueryFundsDetail ¶
func (b *DbBackendImpl) QueryFundsDetail(id string) (*models.FundsDetail, error)
QueryFundsDetail defines query publicity funds detail
func (*DbBackendImpl) QueryOrgCharities ¶
func (b *DbBackendImpl) QueryOrgCharities(params *structs.QueryParams) ([]*structs.OrgCharitiesItems, error)
QueryOrgCharities implement query the donation statistics of organization charity interface
func (*DbBackendImpl) QueryOrgCharitiesDetail ¶
func (b *DbBackendImpl) QueryOrgCharitiesDetail(uid string) (*structs.OrgCharitiesDetailItem, error)
QueryOrgCharitiesDetail implement query detail the donation statistics of charities interface
func (*DbBackendImpl) QueryPubByUser ¶
func (b *DbBackendImpl) QueryPubByUser(uid, userType, targetUID, pubType string, params *structs.QueryParams) ([]*structs.PubUserItem, error)
QueryPubByUser defines the query of publicity by user
func (*DbBackendImpl) QueryPubByUserType ¶
func (b *DbBackendImpl) QueryPubByUserType(userType, targetUID, pubType string, params *structs.QueryParams) ([]*structs.PubUserItem, error)
QueryPubByUserType defines the query of publicity by user type
func (*DbBackendImpl) QuerySupplies ¶
func (b *DbBackendImpl) QuerySupplies(uid, targetUID, userType, pubType string, params *structs.QueryParams) ([]*models.PubSupplies, error)
QuerySupplies defines the query supplies
func (*DbBackendImpl) QuerySuppliesDetail ¶
func (b *DbBackendImpl) QuerySuppliesDetail(id string) (*models.SuppliesDetail, error)
QuerySuppliesDetail defines query publicity funds detail
func (*DbBackendImpl) UpdateFunds ¶
func (b *DbBackendImpl) UpdateFunds(tx *gorm.DB, fundsID, blockID string) error
UpdateFunds update funds information
func (*DbBackendImpl) UpdateFundsBC ¶
UpdateFundsBC implement update funds block chain call back
func (*DbBackendImpl) UpdateSuppliesBC ¶
func (b *DbBackendImpl) UpdateSuppliesBC(tx *gorm.DB, blockID string, supplies *models.PubSupplies) error
UpdateSuppliesBC implement update supplies block chain call back
func (*DbBackendImpl) UpdateSuppliesList ¶
func (b *DbBackendImpl) UpdateSuppliesList(tx *gorm.DB, ps []*models.PubSupplies, data []*structs.PubResp) error
UpdateSuppliesList update supplies information