PracowniaProgramowania/backend/models.go

35 lines
898 B
Go
Raw Normal View History

2018-11-20 00:32:55 +01:00
package main
2019-01-07 00:44:47 +01:00
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`
}
2018-11-20 00:32:55 +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
}