domain

package
v0.0.0-...-bd79b31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedExtension = []string{
	".pdf",
	".doc",
	".docx",
	".xls",
	".xlsx",
	".ppt",
	".pptx",
}

Functions

func IsValidExtension

func IsValidExtension(ext string) bool

Types

type AddRoomToClassroomRequest

type AddRoomToClassroomRequest struct {
	RoomID int64 `json:"room_id"`
}

type AddStudentToClassroomRequest

type AddStudentToClassroomRequest struct {
	StudentID int64 `json:"student_id"`
}

type ChangePasswordRequest

type ChangePasswordRequest struct {
	OldPassword string `json:"old_password" binding:"required"`
	NewPassword string `json:"new_password" binding:"required"`
}

type ChangeRoleRequest

type ChangeRoleRequest struct {
	Role UserRole `json:"role" binding:"required"`
}

type Classroom

type Classroom struct {
	ID         int64         `json:"id" gorm:"primary_key"`
	Label      string        `json:"label"`
	TeacherID  int64         `json:"teacher_id"`
	StudentIDs pq.Int64Array `json:"student_ids" gorm:"type:BigInt[]"`
	RoomIDs    pq.Int64Array `json:"room_ids" gorm:"type:BigInt[]"`
}

type ClassroomOfUser

type ClassroomOfUser struct {
	ID        int64  `json:"id" gorm:"primary_key"`
	Label     string `json:"label"`
	TeacherID int64  `json:"teacher_id"`
}

type CreateUpdateClassroomRequest

type CreateUpdateClassroomRequest struct {
	Label     string `json:"label"`
	TeacherID int64  `json:"teacher_id"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Name     string   `json:"name" binding:"required"`
	Email    string   `json:"email" binding:"required"`
	Password string   `json:"password" binding:"required"`
	Role     UserRole `json:"role"`
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string   `json:"token"`
	ID    int64    `json:"id"`
	Role  UserRole `json:"role"`
}

type Material

type Material struct {
	ID          int64  `json:"id" gorm:"primary_key"`
	Title       string `json:"title"`
	FileURL     string `json:"file_url"`
	ClassroomID int64  `json:"classroom_id"`
}

type RegisterRequest

type RegisterRequest struct {
	Name     string `json:"name" binding:"required"`
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type Submission

type Submission struct {
	ID        int64  `json:"id" gorm:"primary_key"`
	Title     string `json:"title"`
	FileURL   string `json:"file_url"`
	TaskID    int64  `json:"task_id"`
	StudentID int64  `json:"student_id"`
}

type Task

type Task struct {
	ID          int64  `json:"id" gorm:"primary_key"`
	Title       string `json:"title"`
	FileURL     string `json:"file_url"`
	ClassroomID int64  `json:"classroom_id"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

type User

type User struct {
	ID       int64    `json:"id" gorm:"primary_key"`
	Name     string   `json:"name"`
	Email    string   `json:"email" gorm:"unique_index"`
	Password string   `json:"password"`
	Role     UserRole `json:"role"`
}

type UserResponse

type UserResponse struct {
	ID    int64    `json:"id"`
	Name  string   `json:"name"`
	Email string   `json:"email"`
	Role  UserRole `json:"role"`
}

type UserRole

type UserRole int
const (
	Admin   UserRole = -1
	Teacher UserRole = 1
	Student UserRole = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL