MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / UpdateBalance

Method UpdateBalance

model/channel.go:469–477  ·  view source on GitHub ↗
(balance float64)

Source from the content-addressed store, hash-verified

467}
468
469func (channel *Channel) UpdateBalance(balance float64) {
470 err := DB.Model(channel).Select("balance_updated_time", "balance").Updates(Channel{
471 BalanceUpdatedTime: common.GetTimestamp(),
472 Balance: balance,
473 }).Error
474 if err != nil {
475 common.SysError("failed to update balance: " + err.Error())
476 }
477}
478
479func (channel *Channel) Delete() error {
480 var err error

Calls 3

GetTimestampFunction · 0.92
SysErrorFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected