refactor: Gitea 式目录改组,移除本分支 SPA 与杂项产物

将 model/service/handler/middleware 迁至 models/services/routers/api/modules/auth,并删除 frontend、embed_static、scripts 及误入库缓存/二进制。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-29 03:54:56 +08:00
parent 1414c71dec
commit 9fe299a45f
449 changed files with 0 additions and 52779 deletions

34
models/level.go Normal file
View File

@@ -0,0 +1,34 @@
package model
// LevelThresholds 各等级所需最低 Exp下标 0 对应 Lv1
var LevelThresholds = []int{0, 20, 50, 100, 200, 400, 800, 1500, 3000, 5000}
// LevelFromExp 由经验推导等级110
func LevelFromExp(exp int) int {
if exp < 0 {
exp = 0
}
level := 1
for i, th := range LevelThresholds {
if exp >= th {
level = i + 1
}
}
return level
}
// ExpForLevel 某等级的门槛 Exp超出范围则钳制
func ExpForLevel(level int) int {
if level < 1 {
level = 1
}
if level > len(LevelThresholds) {
level = len(LevelThresholds)
}
return LevelThresholds[level-1]
}
// MaxLevel 最高等级
func MaxLevel() int {
return len(LevelThresholds)
}