models

package
v0.0.0-...-a7c99a5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       int64  `json:"id"`
	Username string `json:"username" valid:"required"`
	Password string `json:"password" valid:"required"`
	Role     int    `json:"role,omitempty"`
	Code     string `json:"code,omitempty"`
	Device   string `json:"device" valid:"required"`
}

Account struct

func (Account) IsEmpty

func (a Account) IsEmpty() bool

IsEmpty func to check entity empty

func (Account) Validate

func (a Account) Validate() (bool, error)

Validate func

type Accounts

type Accounts []Account

Accounts list

type ActorObject

type ActorObject struct {
	*UserObject `json:",omitempty"`
}

ActorObject struct

func (ActorObject) IsEmpty

func (object ActorObject) IsEmpty() bool

IsEmpty func

type Attendance

type Attendance struct {
	Student *StudentObject `json:"student,omitempty"`
	Class   *ClassObject   `json:"class,omitempty"`
	Status  int            `json:"status,omitempty"`
	Message string         `json:"message,omitempty"`
}

Attendance struct

type Channel

type Channel struct {
	ID            int64  `json:"id"`
	Name          string `json:"name"`
	ShortName     string `json:"short_name"`
	Description   string `json:"description,omitempty"`
	Followers     int    `json:"followers,omitempty"`
	Notifications int    `json:"notifications,omitempty"`
	Avatar        string `json:"avatar,omitempty"`
	Cover         string `json:"cover,omitempty"`
	CreatedAt     int64  `json:"created_at,omitempty"`
	UpdatedAt     int64  `json:"updated_at,omitempty"`
	Status        int    `json:"status,omitempty"`
	IsAdmin       bool   `json:"is_admin,omitempty"`
	IsFollowed    bool   `json:"is_followed,omitempty"`
}

Channel struct

func (Channel) IsEmpty

func (channel Channel) IsEmpty() bool

IsEmpty func

type ChannelNotification

type ChannelNotification struct {
	ID        int64          `json:"id"`
	Owner     *ChannelObject `json:"owner,omitempty"`
	Title     string         `json:"title"`
	Message   string         `json:"message"`
	Photo     string         `json:"photo,omitempty"`
	Time      string         `json:"time,omitempty"`
	Place     string         `json:"place,omitempty"`
	UpdatedAt int64          `json:"updated_at,omitempty"`
	CreatedAt int64          `json:"created_at,omitempty"`
	Status    int            `json:"status,omitemtpy"`
	SeenAt    int64          `json:"seen_at,omitempty"`
}

ChannelNotification struct

func (ChannelNotification) IsEmpty

func (channel ChannelNotification) IsEmpty() bool

IsEmpty func

type ChannelObject

type ChannelObject struct {
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

ChannelObject struct

type Class

type Class struct {
	Teacher   *TeacherObject  `json:"teacher,omitempty"`
	Subject   *SubjectObject  `json:"subject,omitempty"`
	Room      *RoomObject     `json:"room,omitempty"`
	Semester  *SemesterObject `json:"semester,omitempty"`
	ID        int64           `json:"id"`
	Code      string          `json:"code"`
	Name      string          `json:"name,omitempty"`
	Symbol    string          `json:"symbol,omitempty"`
	Day       string          `json:"day,omitempty"`
	StartAt   string          `json:"start_at,omitempty"`
	FinishAt  string          `json:"finish_at,omitempty"`
	Status    int             `json:"status,omitempty"`
	CreatedAt int64           `json:"created_at,omitempty"`
	UpdatedAt int64           `json:"updated_at,omitempty"`
	Students  int             `json:"students,omitempty"`
}

Class struct

type ClassObject

type ClassObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

ClassObject struct

type Classroom

type Classroom struct {
	ID     int64  `json:"id"`
	Code   string `json:"code"`
	Name   string `json:"name,omitempty"`
	Status int    `json:"status,omitempty"`
}

Classroom struct

type Comment

type Comment struct {
	Owner            *UserObject      `json:"owner,omitempty"`
	Post             *PostObject      `json:"post,omitempty"`
	ID               int64            `json:"id"`
	Message          string           `json:"message"`
	Mentions         []*MentionObject `json:"mentions,omitempty"`
	CreatedAt        int64            `json:"created_at,omitempty"`
	UpdatedAt        int64            `json:"updated_at,omitempty"`
	Status           int              `json:"status,omitempty"`
	CanReportToAdmin bool             `json:"can_report_to_admin,omitempty"`
	CanReport        bool             `json:"can_report"`
	CanEdit          bool             `json:"can_edit"`
	CanDelete        bool             `json:"can_delete"`
}

Comment struct

func (Comment) Validate

func (c Comment) Validate() (bool, error)

Validate to Validate struct

type CommentObject

type CommentObject struct {
	ID       int64            `json:"id"`
	Message  string           `json:"message"`
	Mentions []*MentionObject `json:"mentions,omitempty"`
	Owner    *UserObject      `json:"owner,omitempty"`
	Post     *PostObject      `json:"post,omitempty"`
}

CommentObject struct

type Comments

type Comments []Comment

Comments type is comment list

type ExamSchedule

type ExamSchedule struct {
	Subject   *SubjectObject   `json:"subject,omitempty"`
	Room      *RoomObject      `json:"room,omitempty"`
	Semester  *SemesterObject  `json:"semester,omitempty"`
	Students  []*StudentObject `json:"students,omitempty"`
	ID        int64            `json:"id"`
	Day       string           `json:"day,omitempty"`
	ExamTime  string           `json:"exam_time,omitempty"`
	Status    int              `json:"status,omitempty"`
	CreatedAt int64            `json:"created_at,omitempty"`
	UpdatedAt int64            `json:"updated_at,omitempty"`
}

ExamSchedule struct

type Group

type Group struct {
	ID              int64        `json:"id"`
	Name            string       `json:"name"`
	Description     string       `json:"description,omitempty"`
	Class           *ClassObject `json:"class,omitempty"`
	Type            int          `json:"type,omitempty"`
	PendingRequests int          `json:"pending_requests,omitempty"`
	Members         int          `json:"members,omitempty"`
	Posts           int          `json:"posts,omitempty"`
	Avatar          string       `json:"avatar,omitempty"`
	Cover           string       `json:"cover,omitempty"`
	Privacy         int          `json:"privacy,omitempty"`
	CreatedAt       int64        `json:"created_at,omitempty"`
	UpdatedAt       int64        `json:"updated_at,omitempty"`
	Status          int          `json:"status,omitempty"`
	CanRequest      bool         `json:"can_request,omitempty"`
	CanJoin         bool         `json:"can_join,omitempty"`
	IsPending       bool         `json:"is_pending,omitempty"`
	IsAdmin         bool         `json:"is_admin,omitempty"`
	IsMember        bool         `json:"is_member,omitempty"`
}

Group struct

func (Group) IsEmpty

func (group Group) IsEmpty() bool

IsEmpty func

type GroupJoin

type GroupJoin struct {
	Group
}

GroupJoin struct

type GroupMembership

type GroupMembership struct {
	ID        int64        `json:"id"`
	CreatedAt int64        `json:"created_at,omitempty"`
	UpdatedAt int64        `json:"updated_at,omitempty"`
	User      *UserObject  `json:"user,omitempty"`
	Group     *GroupObject `json:"group,omitempty"`
	Role      int          `json:"role,omitempty"` // 1:member; 2: admin; 3: creator 4: block
	Status    int          `json:"status,omitempty"`
	CanEdit   bool         `json:"can_edit,omitempty"`
	CanDelete bool         `json:"can_delete,omitempty"`
}

GroupMembership struct

func (GroupMembership) IsEmpty

func (membership GroupMembership) IsEmpty() bool

IsEmpty func to check membership is null

type GroupObject

type GroupObject struct {
	ID     int64  `json:"id"`
	Name   string `json:"name"`
	Avatar string `json:"avatar"`
}

GroupObject struct

type GroupPost

type GroupPost struct {
	Post
	Group *GroupObject `json:"group, omitempty"`
}

GroupPost struct

type InfoChannel

type InfoChannel struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	ShortName   string `json:"short_name"`
	Description string `json:"description,omitempty"`
	Avatar      string `json:"avatar,omitempty"`
	Cover       string `json:"cover,omitempty"`
	Status      int    `json:"status,omitempty"`
}

InfoChannel struct

type InfoGroup

type InfoGroup struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Avatar      string `json:"avatar,omitempty"`
	Cover       string `json:"cover,omitempty"`
	Privacy     int    `json:"privacy,omitempty"`
	Status      int    `json:"status,omitempty"`
}

InfoGroup struct to update method

type InfoPost

type InfoPost struct {
	Message string `json:"message"`
	Photo   string `json:"photo,omitempty"`
	Status  int    `json:"status,omitempty"`
	Privacy int    `json:"privacy,omitempty"` // 1: public; 2: followers; 3: private
}

InfoPost struct to include info of core Post

type InfoUser

type InfoUser struct {
	Password      string `json:"password,omitempty"`
	FullName      string `json:"full_name,omitempty"`
	FirstName     string `json:"first_name,omitempty"`
	MiddleName    string `json:"middle_name,omitempty"`
	LastName      string `json:"last_name,omitempty"`
	Birthday      string `json:"birthday,omitempty"`
	LargeAvatar   string `json:"large_avatar,omitempty"`
	Avatar        string `json:"avatar,omitempty"`
	Cover         string `json:"cover,omitempty"`
	About         string `json:"about,omitempty"`
	Gender        int    `json:"gender,omitempty"`
	Phone         string `json:"phone,omitempty"`
	Email         string `json:"email,omitempty" valid:"email"`
	FacebookID    string `json:"facebook_id,omitempty"`
	FacebookToken string `json:"facebook_token,omitempty"`
	Status        int    `json:"status"`
}

InfoUser struct

type MentionObject

type MentionObject struct {
	ID     int64 `json:"id"`
	Length int64 `json:"length"`
	Offset int64 `json:"offset"`
}

MentionObject struct

type Notification

type Notification struct {
	ID          int64          `json:"id"`
	Actor       *ActorObject   `json:"actor,omitempty"`
	Action      int            `json:"action,omitempty"` //liked/commented/posted/mentioned/followed
	TotalAction int            `json:"total_action,omitempty"`
	LastPost    *PostObject    `json:"last_post,omitempty"`
	LastComment *CommentObject `json:"last_comment,omitempty"`
	LastMention *MentionObject `json:"last_mention,omitempty"`
	LastUser    *UserObject    `json:"last_user,omitempty"`
	Group       *GroupObject   `json:"group,omitempty"`
	Title       string         `json:"title,omitempty"`
	Message     string         `json:"message,omitempty"`
	UpdatedAt   int64          `json:"updated_at,omitempty"`
	CreatedAt   int64          `json:"created_at,omitempty"`
	SeenAt      int64          `json:"seen_at,omitempty"`
}

Notification struct

type PendingUser

type PendingUser struct {
	UserObject
	JoinedAt int64      `json:"joined_at"`
	JoinedBy UserObject `json:"joined_by,omitempty"`
}

PendingUser struct for a user request group

type PlaceObject

type PlaceObject struct {
	GroupObject
}

PlaceObject struct

func (PlaceObject) IsEmpty

func (object PlaceObject) IsEmpty() bool

IsEmpty func

type Post

type Post struct {
	Owner            *UserObject  `json:"owner"`
	Place            *GroupObject `json:"place,omitempty"`
	ID               int64        `json:"id"` //Id
	Message          string       `json:"message"`
	Summary          bool         `json:"summary,omitempty"` // true, if message length more than 250
	Photo            string       `json:"photo,omitempty"`
	UpdatedAt        int64        `json:"updated_at,omitempty"`
	CreatedAt        int64        `json:"created_at,omitempty"`
	Status           int          `json:"status,omitempty"`
	Privacy          int          `json:"privacy,omitempty"` // 1: public; 2: followers; 3: private
	Likes            int          `json:"likes,omitempty"`
	Comments         int          `json:"comments,omitempty"`
	Shares           int          `json:"shares,omitempty"`
	IsFollowing      bool         `json:"is_following,omitempty"`
	IsLiked          bool         `json:"is_liked,omitempty"`
	IsReported       bool         `json:"is_reported,omitempty"`
	CanEdit          bool         `json:"can_edit,omitempty"`
	CanDelete        bool         `json:"can_delete,omitempty"`
	CanReportToAdmin bool         `json:"can_report_to_admin,omitempty"`
}

Post struct to include info of core Post

func (Post) IsEmpty

func (p Post) IsEmpty() bool

IsEmpty func to check entity empty

type PostObject

type PostObject struct {
	ID      int64        `json:"id"`
	Message string       `json:"message"`
	Photo   string       `json:"photo,omitempty"`
	Owner   *UserObject  `json:"owner,omitempty"`
	Place   *GroupObject `json:"place,omitempty"`
}

PostObject struct

type Posts

type Posts []Post

Posts list

type PublicUser

type PublicUser struct {
	ID          int64  `json:"id,omitempty"`
	Username    string `json:"username,omitempty"`
	FullName    string `json:"full_name,omitempty"`
	FirstName   string `json:"first_name,omitempty"`
	MiddleName  string `json:"middle_name,omitempty"`
	LastName    string `json:"last_name,omitempty"`
	BirthDay    string `json:"birthday,omitempty"`
	LargeAvatar string `json:"large_avatar,omitempty"`
	Avatar      string `json:"avatar,omitempty"`
	Cover       string `json:"cover,omitempty"`
	About       string `json:"about,omitempty"`
	Gender      int    `json:"gender,omitempty"`
	Phone       string `json:"phone,omitempty"`
	Email       string `json:"email,omitempty" valid:"email"`
	FacebookID  string `json:"facebook_id,omitempty"`
	CreatedAt   int64  `json:"created_at,omitempty"`
	UpdatedAt   int64  `json:"updated_at,omitempty"`
	Status      int    `json:"status"`
	Posts       int    `json:"posts"`
	Followers   int    `json:"followers"`
	Followings  int    `json:"followings"`
}

PublicUser struct

func (PublicUser) IsEmpty

func (u PublicUser) IsEmpty() bool

IsEmpty func to check entity empty

func (PublicUser) Validate

func (u PublicUser) Validate() (bool, error)

Validate to Validate struct

type PublicUsers

type PublicUsers []PublicUser

PublicUsers list

type RequestLinkCode

type RequestLinkCode struct {
	ID               int64          `json:"id"`
	CreatedAt        int64          `json:"created_at,omitempty"`
	UpdatedAt        int64          `json:"updated_at,omitempty"`
	User             *UserObject    `json:"user,omitempty"`
	Student          *StudentObject `json:"student,omitempty"`
	Status           int            `json:"status,omitempty"`
	Type             int            `json:"type,omitempty"`
	Email            string         `json:"email,omitempty"`
	VerificationCode string         `json:"verification_code,omitempty"`
	Code             string         `json:"code,omitempty"`
	FullName         string         `json:"full_name,omitempty"`
	Photo            string         `json:"photo,omitempty"`
	CanEdit          bool           `json:"can_edit,omitempty"`
	CanDelete        bool           `json:"can_delete,omitempty"`
}

RequestLinkCode struct

func (RequestLinkCode) IsEmpty

func (requestLinkCode RequestLinkCode) IsEmpty() bool

IsEmpty func to check RequestLinkCode is null

type RoomObject

type RoomObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
}

RoomObject struct

type Schedule

type Schedule struct {
	Student  *Student  `json:"student,omitempty"`
	Classes  []*Class  `json:"classes,omitempty"`
	Status   int       `json:"status,omitempty"`
	Semester *Semester `json:"semester,omitempty"`
}

Schedule struct

type Semester

type Semester struct {
	ID        int64  `json:"id"`
	Code      string `json:"code"`
	Symbol    string `json:"symbol,omitempty"`
	Name      string `json:"name,omitempty"`
	Group     int    `json:"group,omitempty"`
	Year      string `json:"year,omitempty"`
	StartAt   string `json:"start_at,omitempty"`
	FinishAt  string `json:"finish_at,omitempty"`
	Status    int    `json:"status,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
}

Semester struct

type SemesterObject

type SemesterObject struct {
	ID     int64  `json:"id"`
	Code   string `json:"code"`
	Symbol string `json:"symbol,omitempty"`
	Name   string `json:"name,omitempty"`
}

SemesterObject struct

type Student

type Student struct {
	ID        int64  `json:"id"`
	Code      string `json:"code"`
	FirstName string `json:"first_name,omitempty"`
	Birthday  string `json:"birthday,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	Email     string `json:"email,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Status    int    `json:"status,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
}

Student struct

type StudentObject

type StudentObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

StudentObject struct

type Subject

type Subject struct {
	ID        int64   `json:"id"`
	Code      string  `json:"code"`
	Name      string  `json:"name,omitempty"`
	Credits   int     `json:"credits,omitempty"`
	Factor    float32 `json:"factor,omitempty"`
	Status    int     `json:"status,omitempty"`
	CreatedAt int64   `json:"created_at,omitempty"`
	UpdatedAt int64   `json:"updated_at,omitempty"`
}

Subject struct

type SubjectObject

type SubjectObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

SubjectObject struct

type Subscription

type Subscription struct {
	SubscriberID int64 `json:"id"`
	UserID       int64 `json:"user_id"`
	ObjectID     int64 `json:"object_id"`
	CreatedAt    int64 `json:"created_at"`
}

Subscription struct

type SupervisiorObject

type SupervisiorObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

SupervisiorObject struct

type Teacher

type Teacher struct {
	ID        int64  `json:"id"`
	Code      string `json:"code"`
	FirstName string `json:"first_name,omitempty"`
	LastName  string `json:"last_name,omitempty"`
	Photo     string `json:"photo,omitempty"`
	Email     string `json:"email,omitempty"`
	Phone     string `json:"phone,omitempty"`
	Status    int    `json:"status,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	UpdatedAt int64  `json:"updated_at,omitempty"`
}

Teacher struct

type TeacherObject

type TeacherObject struct {
	ID   int64  `json:"id"`
	Code string `json:"code"`
	Name string `json:"name"`
}

TeacherObject struct

type User

type User struct {
	ID            int64  `json:"id,omitempty"`
	Username      string `json:"username,omitempty" valid:"required"`
	Password      string `json:"password,omitempty" valid:"required"`
	FullName      string `json:"full_name,omitempty"`
	FirstName     string `json:"first_name,omitempty"`
	MiddleName    string `json:"middle_name,omitempty"`
	LastName      string `json:"last_name,omitempty"`
	Birthday      string `json:"birthday,omitempty"`
	LargeAvatar   string `json:"large_avatar,omitempty"`
	Avatar        string `json:"avatar,omitempty"`
	Cover         string `json:"cover,omitempty"`
	About         string `json:"about,omitempty"`
	Gender        int    `json:"gender,omitempty"`
	Phone         string `json:"phone,omitempty"`
	Email         string `json:"email,omitempty" valid:"email"`
	FacebookID    string `json:"facebook_id,omitempty"`
	FacebookToken string `json:"facebook_token,omitempty"`
	CreatedAt     int64  `json:"created_at,omitempty"`
	UpdatedAt     int64  `json:"updated_at,omitempty"`
	IsVertified   bool   `json:"is_vertified,omitempty"`
	Status        int    `json:"status"`
	Posts         int    `json:"posts"`
	Followers     int    `json:"followers"`
	Followings    int    `json:"followings" `
}

User struct

func (User) IsEmpty

func (u User) IsEmpty() bool

IsEmpty func to check entity empty

func (User) Validate

func (u User) Validate() (bool, error)

Validate to Validate struct

type UserFollowObject

type UserFollowObject struct {
	UserObject
	IsFollowed bool `json:"is_followed"`
}

UserFollowObject struct for a sub user for get all user; search user, list user any where

type UserLikedObject

type UserLikedObject struct {
	UserObject
	LikedAt int64 `json:"liked_at"`
}

UserLikedObject struct for a user liked things

type UserObject

type UserObject struct {
	ID       int64  `json:"id"`
	Username string `json:"username,omitempty"`
	FullName string `json:"full_name,omitempty"`
	Avatar   string `json:"avatar,omitempty"`
}

UserObject struct

type Users

type Users []User

Users list

type Violation

type Violation struct {
	ID        int64              `json:"id"`
	Owner     *StudentObject     `json:"owner,omitempty"`
	Catcher   *SupervisiorObject `json:"catcher,omitempty"`
	Message   string             `json:"message"`
	Photo     string             `json:"photo,omitempty"`
	TimeAt    int64              `json:"time_at,omitempty"`
	Place     string             `json:"place,omitempty"`
	UpdatedAt int64              `json:"updated_at,omitempty"`
	CreatedAt int64              `json:"created_at,omitempty"`
	Status    int                `json:"status,omitemtpy"`
}

Violation struct

func (Violation) IsEmpty

func (violation Violation) IsEmpty() bool

IsEmpty func

Jump to

Keyboard shortcuts

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