(id int, count int)
| 772 | } |
| 773 | |
| 774 | func 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 |
| 782 | func GetUsernameById(id int, fromDB bool) (username string, err error) { |
no test coverage detected