init: init refactor

This commit is contained in:
Blizzard
2026-04-27 00:02:18 +08:00
commit e515f6a287
360 changed files with 30713 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
package handler
import (
"net/http"
file "sundynix-micro-go/app/file/api/internal/handler/file"
"sundynix-micro-go/app/file/api/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
// 获取文件信息
Method: http.MethodGet,
Path: "/:id",
Handler: file.GetFileByIdHandler(serverCtx),
},
{
// 删除文件
Method: http.MethodDelete,
Path: "/delete",
Handler: file.DeleteFileHandler(serverCtx),
},
{
// 文件列表
Method: http.MethodPost,
Path: "/list",
Handler: file.GetFileListHandler(serverCtx),
},
{
// 上传文件
Method: http.MethodPost,
Path: "/upload",
Handler: file.UploadFileHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
rest.WithPrefix("/api/file"),
)
}