feat: refact id column define

This commit is contained in:
engigu
2026-03-03 17:25:38 +08:00
parent 117ae126f7
commit 4589c64923
62 changed files with 881 additions and 454 deletions
+19
View File
@@ -0,0 +1,19 @@
package utils
import (
"github.com/rs/xid"
)
// GenerateID 生成一个新的 ID (使用 xid,20位字符)
func GenerateID() string {
return xid.New().String()
}
// IsNumeric 检查字符串是否全为数字
func IsNumeric(s string) bool {
for _, c := range s {
if c < '0' || c > '9' {
return false
}
}
return s != ""
}