mirror of
https://gitlab.bertha.cloud/partitio/Nextcloud-Partitio/gonextcloud
synced 2025-06-25 02:52:27 +00:00
57
types/groupfolders.go
Normal file
57
types/groupfolders.go
Normal file
@ -0,0 +1,57 @@
|
||||
package types
|
||||
|
||||
import "strconv"
|
||||
|
||||
type GroupFolderBadFormatIDAndGroups struct {
|
||||
ID string `json:"id"`
|
||||
MountPoint string `json:"mount_point"`
|
||||
Groups map[string]string `json:"groups"`
|
||||
Quota string `json:"quota"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
type GroupFolderBadFormatGroups struct {
|
||||
ID int `json:"id"`
|
||||
MountPoint string `json:"mount_point"`
|
||||
Groups map[string]string `json:"groups"`
|
||||
Quota string `json:"quota"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
type GroupFolder struct {
|
||||
ID int `json:"id"`
|
||||
MountPoint string `json:"mount_point"`
|
||||
Groups map[string]SharePermission `json:"groups"`
|
||||
Quota int `json:"quota"`
|
||||
Size int `json:"size"`
|
||||
}
|
||||
|
||||
func (gf *GroupFolderBadFormatGroups) FormatGroupFolder() GroupFolder {
|
||||
g := GroupFolder{}
|
||||
g.ID = gf.ID
|
||||
g.MountPoint = gf.MountPoint
|
||||
g.Groups = map[string]SharePermission{}
|
||||
for k, v := range gf.Groups {
|
||||
p, _ := strconv.Atoi(v)
|
||||
g.Groups[k] = SharePermission(p)
|
||||
}
|
||||
q, _ := strconv.Atoi(gf.Quota)
|
||||
g.Quota = q
|
||||
g.Size = gf.Size
|
||||
return g
|
||||
}
|
||||
|
||||
func (gf *GroupFolderBadFormatIDAndGroups) FormatGroupFolder() GroupFolder {
|
||||
g := GroupFolder{}
|
||||
g.ID, _ = strconv.Atoi(gf.ID)
|
||||
g.MountPoint = gf.MountPoint
|
||||
g.Groups = map[string]SharePermission{}
|
||||
for k, v := range gf.Groups {
|
||||
p, _ := strconv.Atoi(v)
|
||||
g.Groups[k] = SharePermission(p)
|
||||
}
|
||||
q, _ := strconv.Atoi(gf.Quota)
|
||||
g.Quota = q
|
||||
g.Size = gf.Size
|
||||
return g
|
||||
}
|
@ -108,3 +108,24 @@ type SharesResponse struct {
|
||||
Data Share `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
||||
type GroupFoldersListResponse struct {
|
||||
Ocs struct {
|
||||
Meta Meta `json:"meta"`
|
||||
Data map[string]GroupFolderBadFormatIDAndGroups `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
||||
type GroupFoldersCreateResponse struct {
|
||||
Ocs struct {
|
||||
Meta Meta `json:"meta"`
|
||||
Data GroupFolderBadFormatIDAndGroups `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
||||
type GroupFoldersResponse struct {
|
||||
Ocs struct {
|
||||
Meta Meta `json:"meta"`
|
||||
Data GroupFolderBadFormatGroups `json:"data"`
|
||||
} `json:"ocs"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user