Add statistic api

This commit is contained in:
2025-10-02 21:34:35 +08:00
parent 17026a74c5
commit aac1992dba
5 changed files with 120 additions and 0 deletions

View File

@@ -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
}