feat(explorer): manage created direct links / option to enable unique redirected direct links

This commit is contained in:
Aaron Liu
2025-06-26 18:45:54 +08:00
parent 2500ebc6a4
commit dc611bcb0d
11 changed files with 103 additions and 16 deletions

View File

@@ -697,10 +697,18 @@ func initMasterRouter(dep dependency.Dep) *gin.Engine {
)
// 取得文件外链
file.PUT("source",
controllers.FromJSON[explorer.GetDirectLinkService](explorer.GetDirectLinkParamCtx{}),
middleware.ValidateBatchFileCount(dep, explorer.GetDirectLinkParamCtx{}),
controllers.GetSource)
source := file.Group("source")
{
source.PUT("",
controllers.FromJSON[explorer.GetDirectLinkService](explorer.GetDirectLinkParamCtx{}),
middleware.ValidateBatchFileCount(dep, explorer.GetDirectLinkParamCtx{}),
controllers.GetSource,
)
source.DELETE(":id",
middleware.HashID(hashid.SourceLinkID),
controllers.DeleteDirectLink,
)
}
// Patch view
file.PATCH("view",
controllers.FromJSON[explorer.PatchViewService](explorer.PatchViewParameterCtx{}),