85a0b44ddd
- 后端 /api/releases/latest 代理 gitea Releases(10min 缓存,无发布/不可达时回退 SUNDYNIX_FALLBACK_VERSION) - 前端 use-release hook 就绪(下载区动态接线暂缓) - 仓库链接统一指向 git.sundynix.cn/sundynix/sundynix-agentix,下载按钮 # 占位改为 releases 页 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
529 B
Go
23 lines
529 B
Go
package handler
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"git.sundynix.cn/Blizzard/sundynix-site/server/internal/pkg/resp"
|
|
"git.sundynix.cn/Blizzard/sundynix-site/server/internal/service"
|
|
)
|
|
|
|
// ReleaseHandler 最新版本信息(代理 gitea)。
|
|
type ReleaseHandler struct {
|
|
svc *service.ReleaseService
|
|
}
|
|
|
|
func NewReleaseHandler() *ReleaseHandler {
|
|
return &ReleaseHandler{svc: service.NewReleaseService()}
|
|
}
|
|
|
|
// Latest GET /api/releases/latest
|
|
func (h *ReleaseHandler) Latest(c *gin.Context) {
|
|
resp.OK(c, h.svc.Latest())
|
|
}
|