mirror of
https://github.com/cloudreve/cloudreve.git
synced 2026-03-03 02:57:01 +00:00
feat(explorer): save user's view setting to server / optionally share view setting via share link (#2232)
This commit is contained in:
@@ -388,3 +388,15 @@ func DeleteVersion(c *gin.Context) {
|
||||
|
||||
c.JSON(200, serializer.Response{})
|
||||
}
|
||||
|
||||
func PatchView(c *gin.Context) {
|
||||
service := ParametersFromContext[*explorer.PatchViewService](c, explorer.PatchViewParameterCtx{})
|
||||
err := service.Patch(c)
|
||||
if err != nil {
|
||||
c.JSON(200, serializer.Err(c, err))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, serializer.Response{})
|
||||
}
|
||||
|
||||
@@ -701,6 +701,11 @@ func initMasterRouter(dep dependency.Dep) *gin.Engine {
|
||||
controllers.FromJSON[explorer.GetDirectLinkService](explorer.GetDirectLinkParamCtx{}),
|
||||
middleware.ValidateBatchFileCount(dep, explorer.GetDirectLinkParamCtx{}),
|
||||
controllers.GetSource)
|
||||
// Patch view
|
||||
file.PATCH("view",
|
||||
controllers.FromJSON[explorer.PatchViewService](explorer.PatchViewParameterCtx{}),
|
||||
controllers.PatchView,
|
||||
)
|
||||
}
|
||||
|
||||
// 分享相关
|
||||
|
||||
Reference in New Issue
Block a user