我正在尝试创建一个 JSON 对象文件,但我不确定如何记录所有可用滑冰课程的列表。目前我有以下内容:
[
{"classname":"FS1","classdays":["monday", "wednesday"]},
{"classname":"FS2","classdays": ["tuesday", "thursday"]}
]
它有效,唯一的问题是每个班级“classname”,每天都有多个班级时间“classdays”。而且我不确定如何添加另一个时间数组并将它们与特定类的特定日期相关联,并将其添加到我当前的 JSON 文件中以创建该结构。
以下是非编程语言的类 - 为清楚起见:
Classname: FS1
Monday classes are 12:00PM and 2:00PM
Wednesday classes are 1:00PM and 3:00PM
Classname: FS2
Tuesday classes are 4:00PM and 6:00PM
Thursday classes are 2:00PM and 8:00PM
Classname: FS3
Monday classes are 2:00PM and 4:00PM
Thursday classes are 2:00PM and 8:00PM
我愿意接受有关如何最好地构建或在需要时进行重组的建议。