chore: add remaining files and cleanup
This commit is contained in:
18
check_gitea.sh
Normal file
18
check_gitea.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Gitea 上传配置修复
|
||||
|
||||
echo "检查 Gitea 配置..."
|
||||
|
||||
# 1. 检查当前运行配置
|
||||
docker exec gitea gitea admin list-users 2>/dev/null || echo "Gitea 访问正常"
|
||||
|
||||
# 2. 检查 Docker 网络
|
||||
docker network inspect gitea_gitea-network 2>/dev/null || echo "网络正常"
|
||||
|
||||
echo ""
|
||||
echo "需要检查 Gitea 管理后台设置:"
|
||||
echo "1. 管理员设置 → 应用设置 → 最大附件大小"
|
||||
echo "2. 管理员设置 → SSH 密钥"
|
||||
echo ""
|
||||
echo "Docker 容器状态:"
|
||||
docker ps | grep gitea
|
||||
18
ininternal/api/handler/log_handler.go
Normal file
18
ininternal/api/handler/log_handler.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// LogHandler handles log requests
|
||||
type LogHandler struct{}
|
||||
|
||||
// NewLogHandler creates a new LogHandler
|
||||
func NewLogHandler() *LogHandler {
|
||||
return &LogHandler{}
|
||||
}
|
||||
|
||||
func (h *LogHandler) GetMyLoginLogs(c *gin.Context) {}
|
||||
func (h *LogHandler) GetMyOperationLogs(c *gin.Context) {}
|
||||
func (h *LogHandler) GetLoginLogs(c *gin.Context) {}
|
||||
func (h *LogHandler) GetOperationLogs(c *gin.Context) {}
|
||||
61
quick_check.ps1
Normal file
61
quick_check.ps1
Normal file
@@ -0,0 +1,61 @@
|
||||
# 项目迁移快速检查脚本
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host "项目迁移快速检查" -ForegroundColor Cyan
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# 1. 检查关键文件
|
||||
Write-Host "1. 检查关键文件..." -ForegroundColor Yellow
|
||||
$files = @("go.mod", "README.md", "cmd\server\main.go", "configs\config.yaml")
|
||||
foreach ($file in $files) {
|
||||
$path = "D:\project\$file"
|
||||
$status = if (Test-Path $path) { "✅" } else { "❌" }
|
||||
Write-Host " $status $file"
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# 2. 检查Go环境
|
||||
Write-Host "2. 检查Go环境..." -ForegroundColor Yellow
|
||||
try {
|
||||
$goVersion = go version 2>&1
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host " ✅ Go已安装: $goVersion"
|
||||
} else {
|
||||
Write-Host " ❌ Go未安装"
|
||||
}
|
||||
} catch {
|
||||
Write-Host " ❌ Go未安装"
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# 3. 统计文件
|
||||
Write-Host "3. 统计文件..." -ForegroundColor Yellow
|
||||
$fileCount = (Get-ChildItem -Path D:\project -Recurse -File -ErrorAction SilentlyContinue | Measure-Object).Count
|
||||
Write-Host " 文件数: $fileCount"
|
||||
Write-Host ""
|
||||
|
||||
# 4. 计算大小
|
||||
Write-Host "4. 计算大小..." -ForegroundColor Yellow
|
||||
$size = [math]::Round((Get-ChildItem -Path D:\project -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB, 2)
|
||||
Write-Host " 总大小: ${size} MB"
|
||||
Write-Host ""
|
||||
|
||||
# 5. 检查目录结构
|
||||
Write-Host "5. 检查目录结构..." -ForegroundColor Yellow
|
||||
$dirs = @("cmd", "internal", "configs", "docs", "migrations", "deployment")
|
||||
foreach ($dir in $dirs) {
|
||||
$path = "D:\project\$dir"
|
||||
$status = if (Test-Path $path -PathType Container) { "✅" } else { "❌" }
|
||||
Write-Host " $status $dir\"
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host "快速检查完成!" -ForegroundColor Green
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "下一步:" -ForegroundColor Yellow
|
||||
Write-Host "1. 查看完整检查清单: docs\\migration\\MIGRATION_CHECKLIST.md" -ForegroundColor White
|
||||
Write-Host "2. 查看下一步操作: docs\\plans\\NEXT_STEPS.md" -ForegroundColor White
|
||||
Write-Host "3. 如果Go已安装,运行: go build ./cmd/server" -ForegroundColor White
|
||||
Write-Host ""
|
||||
1
runtime/backend.pid
Normal file
1
runtime/backend.pid
Normal file
@@ -0,0 +1 @@
|
||||
55648
|
||||
1
runtime/frontend.pid
Normal file
1
runtime/frontend.pid
Normal file
@@ -0,0 +1 @@
|
||||
55512
|
||||
2
runtime/wscript-launch-test.vbs
Normal file
2
runtime/wscript-launch-test.vbs
Normal file
@@ -0,0 +1,2 @@
|
||||
Set shell = CreateObject("WScript.Shell")
|
||||
shell.Run "cmd.exe /c echo wscript-ok > D:\project\logs\wscript-launch-test.out.log", 0, False
|
||||
1
upload.json
Normal file
1
upload.json
Normal file
@@ -0,0 +1 @@
|
||||
{"message":"Initial commit","content":"IyDnlKjmiLfns7vnu58KCueUqOaIt+euoeeQhuezu+e7nw=="}
|
||||
44
verify_fix.ps1
Normal file
44
verify_fix.ps1
Normal file
@@ -0,0 +1,44 @@
|
||||
$account = $env:UMS_ADMIN_ACCOUNT
|
||||
$password = $env:UMS_ADMIN_PASSWORD
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($account) -or [string]::IsNullOrWhiteSpace($password)) {
|
||||
throw "UMS_ADMIN_ACCOUNT and UMS_ADMIN_PASSWORD must be set before running this script."
|
||||
}
|
||||
|
||||
$headers = @{ "Content-Type" = "application/json" }
|
||||
$body = (@{ account = $account; password = $password } | ConvertTo-Json -Compress)
|
||||
|
||||
Write-Host "=== Verification ===" -ForegroundColor Cyan
|
||||
|
||||
$resp = Invoke-RestMethod -Uri 'http://localhost:8080/api/v1/auth/login' -Method POST -Headers $headers -Body $body
|
||||
Write-Host "`n[1] Login Response:" -ForegroundColor Yellow
|
||||
Write-Host " User ID: $($resp.data.user.id)"
|
||||
Write-Host " Username: $($resp.data.user.username)"
|
||||
Write-Host " Nickname: $($resp.data.user.nickname)" -ForegroundColor Green
|
||||
Write-Host " Email: $($resp.data.user.email)"
|
||||
|
||||
$token = $resp.data.access_token
|
||||
|
||||
$csrf = Invoke-RestMethod -Uri 'http://localhost:8080/api/v1/auth/csrf-token' -Method GET -Headers $headers
|
||||
Write-Host "`n[2] CSRF Token:" -ForegroundColor Yellow
|
||||
Write-Host " Token: $($csrf.data.csrf_token)"
|
||||
|
||||
$me = Invoke-RestMethod -Uri 'http://localhost:8080/api/v1/auth/userinfo' -Method GET -Headers @{ Authorization = "Bearer $token" }
|
||||
Write-Host "`n[3] Current User Info:" -ForegroundColor Yellow
|
||||
Write-Host " ID: $($me.data.id)"
|
||||
Write-Host " Nickname: $($me.data.nickname)" -ForegroundColor Green
|
||||
|
||||
$logs = Invoke-RestMethod -Uri 'http://localhost:8080/api/v1/logs/login?page=1&page_size=3' -Method GET -Headers @{ Authorization = "Bearer $token" }
|
||||
Write-Host "`n[4] Login Logs:" -ForegroundColor Yellow
|
||||
Write-Host " Total: $($logs.data.total)"
|
||||
foreach ($log in $logs.data.items) {
|
||||
Write-Host " - UserID: $($log.user_id), Status: $($log.status), Time: $($log.created_at)" -ForegroundColor Gray
|
||||
}
|
||||
|
||||
$perms = Invoke-RestMethod -Uri 'http://localhost:8080/api/v1/permissions?page=1&page_size=5' -Method GET -Headers @{ Authorization = "Bearer $token" }
|
||||
Write-Host "`n[5] Permissions:" -ForegroundColor Yellow
|
||||
foreach ($perm in $perms.data.items) {
|
||||
Write-Host " - $($perm.name) ($($perm.code))" -ForegroundColor Gray
|
||||
}
|
||||
|
||||
Write-Host "`nVerification complete." -ForegroundColor Green
|
||||
84
verify_migration.ps1
Normal file
84
verify_migration.ps1
Normal file
@@ -0,0 +1,84 @@
|
||||
# 项目迁移验证脚本
|
||||
Write-Host "======================================"
|
||||
Write-Host "项目迁移验证"
|
||||
Write-Host "======================================"
|
||||
Write-Host ""
|
||||
|
||||
# 统计文件数
|
||||
Write-Host "1. 文件数量统计..."
|
||||
$srcFiles = (Get-ChildItem -Path "c:/Users/Admin/WorkBuddy/20260310215221" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object).Count
|
||||
$dstFiles = (Get-ChildItem -Path "D:\project" -Recurse -File -ErrorAction SilentlyContinue | Measure-Object).Count
|
||||
Write-Host " 源目录: $srcFiles 个文件"
|
||||
Write-Host " 目标目录: $dstFiles 个文件"
|
||||
if ($srcFiles -eq $dstFiles) {
|
||||
Write-Host " [OK] 文件数量匹配" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [WARNING] 文件数量不匹配" -ForegroundColor Yellow
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# 计算大小
|
||||
Write-Host "2. 文件大小统计..."
|
||||
$srcSize = (Get-ChildItem -Path "c:/Users/Admin/WorkBuddy/20260310215221" -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB
|
||||
$dstSize = (Get-ChildItem -Path "D:\project" -Recurse -ErrorAction SilentlyContinue | Measure-Object -Property Length -Sum).Sum / 1MB
|
||||
Write-Host " 源目录: $([math]::Round($srcSize, 2)) MB"
|
||||
Write-Host " 目标目录: $([math]::Round($dstSize, 2)) MB"
|
||||
if ([math]::Abs($srcSize - $dstSize) -lt 1) {
|
||||
Write-Host " [OK] 文件大小匹配" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [WARNING] 文件大小不匹配" -ForegroundColor Yellow
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# 验证关键文件
|
||||
Write-Host "3. 关键文件验证..."
|
||||
$criticalFiles = @(
|
||||
"go.mod",
|
||||
"README.md",
|
||||
"cmd\server\main.go",
|
||||
"configs\config.yaml",
|
||||
"docker-compose.yml"
|
||||
)
|
||||
|
||||
foreach ($file in $criticalFiles) {
|
||||
$path = "D:\project\$file"
|
||||
if (Test-Path $path) {
|
||||
Write-Host " [OK] $file" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [ERROR] $file - 缺失!" -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
# 检查目录结构
|
||||
Write-Host "4. 目录结构验证..."
|
||||
$directories = @(
|
||||
"cmd",
|
||||
"internal",
|
||||
"configs",
|
||||
"docs",
|
||||
"deployment",
|
||||
"migrations"
|
||||
)
|
||||
|
||||
foreach ($dir in $directories) {
|
||||
$path = "D:\project\$dir"
|
||||
if (Test-Path $path -PathType Container) {
|
||||
Write-Host " [OK] $dir\" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [WARNING] $dir\ - 缺失" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "======================================"
|
||||
Write-Host "验证完成"
|
||||
Write-Host "======================================"
|
||||
Write-Host ""
|
||||
Write-Host "下一步操作:"
|
||||
Write-Host "1. cd D:\project"
|
||||
Write-Host "2. go mod verify"
|
||||
Write-Host "3. go build ./cmd/server"
|
||||
Write-Host ""
|
||||
Write-Host "确认无误后,可以删除C盘旧文件:"
|
||||
Write-Host "Remove-Item -Path 'c:/Users/Admin/WorkBuddy/20260310215221' -Recurse -Force"
|
||||
Reference in New Issue
Block a user