mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 23:51:15 +00:00
Add statistic api
This commit is contained in:
@@ -461,3 +461,11 @@ func BatchGetResources(ids []uint) ([]model.Resource, error) {
|
||||
|
||||
return resources, nil
|
||||
}
|
||||
|
||||
func CountResources() (int64, error) {
|
||||
var count int64
|
||||
if err := db.Model(&model.Resource{}).Count(&count).Error; err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user