feat: support refreshing hash
This commit is contained in:
parent
f8bb187c89
commit
ec1bb36c21
11 changed files with 99 additions and 36 deletions
|
@ -903,12 +903,12 @@ func (h *FileHandlers) ListSharings(c *gin.Context) {
|
|||
c.JSON(200, &SharingResp{SharingDirs: dirs})
|
||||
}
|
||||
|
||||
type HashBody struct {
|
||||
type GenerateHashReq struct {
|
||||
FilePath string `json:"filePath"`
|
||||
}
|
||||
|
||||
func (h *FileHandlers) GenerateHash(c *gin.Context) {
|
||||
req := &HashBody{}
|
||||
req := &GenerateHashReq{}
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
c.JSON(q.ErrResp(c, 400, err))
|
||||
return
|
||||
|
|
|
@ -69,7 +69,7 @@ func NewMultiUsersSvc(cfg gocfg.ICfg, deps *depidx.Deps) (*MultiUsersSvc, error)
|
|||
apiRuleCname(userstore.AdminRole, "DELETE", "/v1/fs/sharings"): true,
|
||||
apiRuleCname(userstore.AdminRole, "GET", "/v1/fs/sharings"): true,
|
||||
apiRuleCname(userstore.AdminRole, "GET", "/v1/fs/sharings/exist"): true,
|
||||
apiRuleCname(userstore.AdminRole, "GET", "/hashes/sha1"): true,
|
||||
apiRuleCname(userstore.AdminRole, "POST", "/v1/fs/hashes/sha1"): true,
|
||||
|
||||
// user rules
|
||||
apiRuleCname(userstore.UserRole, "GET", "/"): true,
|
||||
|
@ -99,7 +99,7 @@ func NewMultiUsersSvc(cfg gocfg.ICfg, deps *depidx.Deps) (*MultiUsersSvc, error)
|
|||
apiRuleCname(userstore.UserRole, "DELETE", "/v1/fs/sharings"): true,
|
||||
apiRuleCname(userstore.UserRole, "GET", "/v1/fs/sharings"): true,
|
||||
apiRuleCname(userstore.UserRole, "GET", "/v1/fs/sharings/exist"): true,
|
||||
apiRuleCname(userstore.AdminRole, "GET", "/hashes/sha1"): true,
|
||||
apiRuleCname(userstore.AdminRole, "POST", "/v1/fs/hashes/sha1"): true,
|
||||
// visitor rules
|
||||
apiRuleCname(userstore.VisitorRole, "GET", "/"): true,
|
||||
apiRuleCname(userstore.VisitorRole, "GET", publicPath): true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue