Closed Lit-innosence closed 1 month ago
json形式案1(フォーム)
{ "data": { "student1": { "student_id": "4622999", "name": "山田 太郎", }, "student2": { "student_id": "4623000", "name": "山田 次郎", } } }
概要
- 利用者2人のオブジェクトにそれぞれ学籍番号、名前をプロパティとして格納する。
- フォームの入力内容とは別の情報を併記するためにフォームの入力内容をdataオブジェクトのプロパティとする。
timestampはここで取得せずにバックエンドで追加するという認識であってる?
timestampを取得することは考えてなかった。 timestampの用途としては
前者はロッカー予約をどこで入力させるかによるし、後者もバックエンドで追加する形で問題ないと思うのでjsonから取得する理由は現状ないと思う。
同意見です。timestampはjsonに追加しなくていいかも。
あと、nameの姓と名を別にした方がいいと思うんだけどどう? 名前の間のスペースの処理 (全角、半角、スペースなし) が面倒くさいって感じてしまう。
あと、上にコード修正の要望を記述しておいたので修正よろしくお願いします。 ざっとの記述になってるから、わからないところがあれば質問してくれると助かります。
あと、nameの姓と名を別にした方がいいと思うんだけどどう? 名前の間のスペースの処理 (全角、半角、スペースなし) が面倒くさいって感じてしまう。
同意。改善した形式を以下載せます。
{
"data": {
"student1": {
"student_id": "4622999",
"last_name": "山田",
"first_name": "太郎",
},
"student2": {
"student_id": "4623000",
"last_name": "山田",
"first_name": "次郎",
}
}
}
{
"text": "hello world from json!"
}
{
"data": {
"main_user": {
"student_id": "4622999",
"family_name": "山田",
"given_name": "太郎",
},
"co_user": {
"student_id": "4623000",
"family_name": "山田",
"given_name": "次郎",
}
}
}
json形式案1(フォーム)
概要