Skip to content

Commit aaec23a

Browse files
committed
feat(serverHandler): add fields for json output
1 parent 9939f13 commit aaec23a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/serverHandler/json.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ type jsonItem struct {
1515
}
1616

1717
type jsonResponseData struct {
18+
IsRoot bool `json:"isRoot"`
19+
Path string `json:"path"`
20+
Paths []*pathEntry `json:"paths"`
21+
SubItemPrefix string `json:"subItemPrefix"`
22+
CanUpload bool `json:"canUpload"`
23+
CanArchive bool `json:"canArchive"`
24+
CanCors bool `json:"canCors"`
25+
NeedAuth bool `json:"needAuth"`
26+
1827
Item *jsonItem `json:"item"`
1928
SubItems []*jsonItem `json:"subItems"`
2029
}
@@ -44,6 +53,15 @@ func getJsonData(data *responseData) *jsonResponseData {
4453
}
4554

4655
return &jsonResponseData{
56+
IsRoot: data.IsRoot,
57+
Path: data.Path,
58+
Paths: data.Paths,
59+
SubItemPrefix: data.SubItemPrefix,
60+
CanUpload: data.CanUpload,
61+
CanArchive: data.CanArchive,
62+
CanCors: data.CanCors,
63+
NeedAuth: data.NeedAuth,
64+
4765
Item: item,
4866
SubItems: subItems,
4967
}

0 commit comments

Comments
 (0)