2018-11-20 00:32:55 +01:00
|
|
|
package main
|
|
|
|
|
2019-01-07 00:44:47 +01:00
|
|
|
import "github.com/zemirco/couchdb"
|
|
|
|
|
2019-01-06 01:53:33 +01:00
|
|
|
//struktura użytkownika
|
|
|
|
/*
|
|
|
|
CREATE TABLE users (
|
|
|
|
userId INT NOT NULL AUTO_INCREMENT,
|
|
|
|
login varchar(50) NOT NULL UNIQUE,
|
|
|
|
password varchar(30) NOT NULL,
|
|
|
|
userDescription varchar(300),
|
|
|
|
points int,
|
|
|
|
|
|
|
|
PRIMARY KEY (userId)
|
|
|
|
);
|
|
|
|
*/
|
|
|
|
type User struct {
|
2019-01-09 03:55:36 +01:00
|
|
|
UserId int `json:"userId"` // do pobierania z GET
|
|
|
|
Login string `json:"login"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
UserDescription string `json:"userDescription"`
|
|
|
|
Points int `json:points`
|
2019-01-10 18:57:21 +01:00
|
|
|
Token string
|
2019-01-13 01:26:13 +01:00
|
|
|
IsLogged bool
|
2019-01-06 01:53:33 +01:00
|
|
|
}
|
2018-11-20 00:32:55 +01:00
|
|
|
|
2019-01-06 01:53:33 +01:00
|
|
|
// Structura karty
|
|
|
|
/*
|
|
|
|
*/
|
2019-01-07 00:44:47 +01:00
|
|
|
type Card struct {
|
|
|
|
couchdb.Document
|
2019-01-09 07:26:21 +01:00
|
|
|
Id int `json:"id" binding:"required"`
|
|
|
|
IsQuestion bool `json:"isQuestion"` //0 karta pytanie, 1 karta odpowiedź
|
|
|
|
Blank int `json:"blank" binding:"required"` //ile kart odpowiedzi na pytanie
|
|
|
|
Text string `json:"text" binding:"required"` // podłoga to luka
|
2019-01-07 00:44:47 +01:00
|
|
|
}
|