35 lines
898 B
Go
35 lines
898 B
Go
package main
|
|
|
|
import "github.com/zemirco/couchdb"
|
|
|
|
//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 {
|
|
UserId int `json:"userId"` // do pobierania z GET
|
|
Login string `json:"login"`
|
|
Password string `json:"password"`
|
|
UserDescription string `json:"userDescription"`
|
|
Points int `json:points`
|
|
}
|
|
|
|
// Structura karty
|
|
/*
|
|
*/
|
|
type Card struct {
|
|
couchdb.Document
|
|
id int `json:"id" binding:"required"`
|
|
isQuestion bool `json:"typ"` //0 karta pytanie, 1 karta odpowiedź
|
|
blank int `json:"puste" binding:"required"` //ile kart odpowiedzi na pytanie
|
|
text string `json:"tekst" binding:"required"` // podłoga to luka
|
|
}
|