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

Function updateUserRequestCount

model/user.go:774–779  ·  view source on GitHub ↗
(id int, count int)

Source from the content-addressed store, hash-verified

772}
773
774func updateUserRequestCount(id int, count int) {
775 err := DB.Model(&User{}).Where("id = ?", id).Update("request_count", gorm.Expr("request_count + ?", count)).Error
776 if err != nil {
777 common.SysError("failed to update user request count: " + err.Error())
778 }
779}
780
781// GetUsernameById gets username from Redis first, falls back to DB if needed
782func GetUsernameById(id int, fromDB bool) (username string, err error) {

Callers 1

batchUpdateFunction · 0.85

Calls 3

SysErrorFunction · 0.92
ErrorMethod · 0.80
UpdateMethod · 0.45

Tested by

no test coverage detected