ea8ffb6c74
- 修复订阅模式登录时错误检查余额的问题 - 区分无限余额和永久订阅两种永久会员类型 - 修复动态代码HTTP请求返回值在JS中无法正确访问的问题 - 添加侧边栏滚动位置保持功能 - 移除developer角色相关代码,统一使用admin - 添加缺失的i18n翻译key
44 lines
996 B
Go
44 lines
996 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"strings"
|
|
|
|
"verification-platform-backend/internal/database"
|
|
"verification-platform-backend/internal/model"
|
|
)
|
|
|
|
func main() {
|
|
database.Init()
|
|
|
|
var code model.DynamicCode
|
|
if err := database.DB.Where("key = ?", "test_push").First(&code).Error; err != nil {
|
|
log.Fatal("查询失败:", err)
|
|
}
|
|
|
|
fmt.Printf("ID: %d\n", code.ID)
|
|
fmt.Printf("Name: %s\n", code.Name)
|
|
fmt.Printf("Code length: %d\n", len(code.Code))
|
|
fmt.Printf("Contains newline: %v\n", strings.Contains(code.Code, "\n"))
|
|
fmt.Printf("Contains \\n literal: %v\n", strings.Contains(code.Code, "\\n"))
|
|
fmt.Printf("\n=== Raw Code ===\n")
|
|
fmt.Printf("%s\n", code.Code)
|
|
fmt.Printf("\n=== Code bytes (first 100) ===\n")
|
|
for i, b := range []byte(code.Code) {
|
|
if i >= 100 {
|
|
break
|
|
}
|
|
if b == '\n' {
|
|
fmt.Printf("[\\n]")
|
|
} else if b == '\r' {
|
|
fmt.Printf("[\\r]")
|
|
} else if b >= 32 && b < 127 {
|
|
fmt.Printf("%c", b)
|
|
} else {
|
|
fmt.Printf("[%d]", b)
|
|
}
|
|
}
|
|
fmt.Println()
|
|
}
|