Skip to content
Snippets Groups Projects
Unverified Commit 19832f18 authored by Cseh Viktor's avatar Cseh Viktor
Browse files

Lab number added

parent 8427abcd
No related branches found
No related tags found
No related merge requests found
......@@ -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",
......
......@@ -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"`
......
......@@ -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"`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment