diff --git a/README.md b/README.md index 9954129a3e53d2399c4bf37d5a2477d71d64aea4..a35c8bd8580fc830746b8c2e5ecca8b17cbb1fca 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ |---|---| | id | Integer (auto) | | questionText | String | +| lab | Int | | answer1 | String | | answer2 | String | | answer3 | String | @@ -29,6 +30,7 @@ Returned data: `200 OK` "data": [ { "id": 1, + "lab": 1, "questionText": "1.kerdes szövege", "answer1": "Elso valaszlegetoseg", "answer2": "Masodik valaszlegetoseg", @@ -53,6 +55,7 @@ Returned data: `200 OK` { "data": { "id": 1, + "lab": 1, "questionText": "1.kerdes szövege", "answer1": "Elso valaszlegetoseg", "answer2": "Masodik valaszlegetoseg", @@ -73,6 +76,7 @@ Sent data in body: { "data": { "id": 1, + "lab": 1, "questionText": "1.kerdes szövege", "answer1": "Elso valaszlegetoseg", "answer2": "Masodik valaszlegetoseg", @@ -101,6 +105,7 @@ Sent data in body: ```json { "questionText": "x.kerdes szövege", + "lab": 1, "answer1": "Elso valaszlegetoseg", "answer2": "Masodik valaszlegetoseg", "answer3": "Harmadik valaszlegetoseg", diff --git a/models/models.go b/models/models.go index 4c04104c780866a0af354ea93a3a61d0698dc2bc..d119b9b0deaa672bc5893103adf8123df51efc90 100644 --- a/models/models.go +++ b/models/models.go @@ -3,6 +3,7 @@ package models type Question struct{ //gorm.Model Id uint `gorm:"primaryKey;autoIncrement" json:"questionId"` + Lab uint `gorm:"type:uint" json:"lab"` QuestionText string `gorm:"type:text" json:"questionText"` Answer1 string `gorm:"type:text" json:"answer1"` Answer2 string `gorm:"type:text" json:"answer2"` diff --git a/routes/request.go b/routes/request.go index 99d79b43ea0fd7c3cb7e1094e8660ddb1c2aaad5..5cbc5946e75548155dca4836b843f9dc926c198f 100644 --- a/routes/request.go +++ b/routes/request.go @@ -9,6 +9,7 @@ import ( type QuestionCreateStruct struct { QuestionText string `gorm:"type:text" json:"questionText" binding:"required"` + Lab uint `gorm:"type:uint" json:"lab"` Answer1 string `gorm:"type:text" json:"answer1" binding:"required"` Answer2 string `gorm:"type:text" json:"answer2" binding:"required"` Answer3 string `gorm:"type:text" json:"answer3" binding:"required"` @@ -18,6 +19,7 @@ type QuestionCreateStruct struct { type QuestionUpdateStruct struct { QuestionText string `gorm:"type:text" json:"questionText"` + Lab uint `gorm:"type:uint" json:"lab"` Answer1 string `gorm:"type:text" json:"answer1"` Answer2 string `gorm:"type:text" json:"answer2"` Answer3 string `gorm:"type:text" json:"answer3"`