feat: 重构前后端架构,添加Go后端和Python Agent服务
- 新增 Go 语言后端服务(server/),包含用户认证、Agent管理、数据库连接等API - 新增 Python Agent 服务(agent/),实现Agent核心逻辑和工具集 - 前端从原生HTML迁移到Vue.js框架(web/src/) - 添加 Docker Compose 支持(docker-compose.yml) - 添加项目架构文档(docs/ARCHITECTURE.md) - 添加环境变量示例(.env.example)和本地启动脚本(start-local.ps1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
27
server/temp_check.go
Normal file
27
server/temp_check.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gorm.io/driver/mysql"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func main() {
|
||||
dsn := "root:881116142@tcp(10.10.10.189:3306)/mysql?charset=utf8mb4&parseTime=True&loc=Local"
|
||||
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
|
||||
if err != nil {
|
||||
panic("连接失败: " + err.Error())
|
||||
}
|
||||
|
||||
type User struct {
|
||||
User string
|
||||
Host string
|
||||
}
|
||||
|
||||
var users []User
|
||||
db.Raw("SELECT User, Host FROM mysql.user WHERE User='root'").Scan(&users)
|
||||
|
||||
println("Root 用户列表:")
|
||||
for _, u := range users {
|
||||
println("- User: " + u.User + ", Host: " + u.Host)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user