Initial commit: 网络验证平台

This commit is contained in:
Admin
2026-04-27 17:22:56 +08:00
commit afe67d704e
780 changed files with 88960 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package main
import (
"fmt"
"verification-platform-backend/internal/database"
"verification-platform-backend/internal/model"
)
func main() {
database.Init()
models := []struct {
name string
query interface{}
}{
{"User", &[]model.User{}},
{"AppUser", &[]model.AppUser{}},
{"DynamicCode", &[]model.DynamicCode{}},
{"Application", &[]model.Application{}},
{"Card", &[]model.Card{}},
{"Order", &[]model.Order{}},
{"RechargeRecord", &[]model.RechargeRecord{}},
{"ConsumptionRecord", &[]model.ConsumptionRecord{}},
{"DocCategory", &[]model.DocCategory{}},
{"Doc", &[]model.Doc{}},
{"Setting", &[]model.Setting{}},
}
for _, m := range models {
var allCount int64
var activeCount int64
database.DB.Unscoped().Model(m.query).Count(&allCount)
database.DB.Model(m.query).Count(&activeCount)
deletedCount := allCount - activeCount
if deletedCount > 0 {
fmt.Printf("%s: 总数=%d, 活跃=%d, 已删除=%d\n", m.name, allCount, activeCount, deletedCount)
}
}
}