Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { Id int64 `json:"id"` Title string `json:"title",sql:"size:255"` Url string `json:"url",sql:"size:512"` Content string `json:"content"` UserId int64 `json:"userId"` Author PublicUser `json:"author"` ReferralId int64 `json:"referralId"` ReferralUserId int64 `json:"referralUserId"` CategoryId int `json:"categoryId"` PrevId int64 `json:"prevId"` NextId int64 `json:"nextId"` LikingCount int `json:"likingCount"` CommentCount int `json:"commentCount"` SharingCount int `json:"sharingCount"` ImageName string `json:"imageName",sql:"size:512"` ThumbnailName string `json:"thumbnailName",sql:"size:512"` Activate bool `json:"active"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt time.Time `json:"deletedAt"` Comments []Comment `gorm:"many2many:articles_comments;"` CommentList CommentList `json:"commentList"` Likings []User `gorm:"many2many:articles_users;"` LikingList LikingList `json:"likingList"` }
Article is a article model.
type Comment ¶
type Comment struct { Id int64 `json:"id"` Content string `json:"content"` UserId int64 `json:"userId"` LikingCount int `json:"likingCount"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt time.Time `json:"deletedAt"` User PublicUser `json:"user"` }
Comment is a comment model.
type CommentList ¶
type CommentList struct { HasPrev bool `json:"hasPrev"` HasNext bool `json:"hasNext"` Count int `json:"count"` CurrentPage int `json:"currentPage"` Comments []Comment `json:"comments"` }
CommentList is list that contains comments and meta.
type Connection ¶
type Connection struct { Id int64 `json:"id"` UserId int64 `json:"userId"` ProviderId int64 `gorm:"column:provider_id", json:"providerId"` ProviderUserId string `gorm:"column:provider_user_id", json:"providerUserId"` AccessToken string `json:"accessToken"` ProfileUrl string `gorm:"column:profile_url", json:"profileUrl"` ImageUrl string `gorm:"column:image_url", json:"imageUrl"` }
Connection is a connection model for oauth.
type File ¶
type File struct { Id int64 `json:"id"` UserId int64 `json:"userId"` Name string `json:"name",sql:"size:255"` Size int `json:"size",sql:"size:255"` CreatedAt time.Time `json:"createdAt"` }
File is a file model that contains meta.
type Image ¶
type Image struct { Id int64 `json:"id"` Kind int `json:"kind"` Large string `json:"large"` Medium string `json:"medium"` Thumbnail string `json:"thumbnail"` CreatedAt time.Time `json:"createdAt"` }
Image is a image model.
type LikedList ¶
type LikedList struct { HasPrev bool `json:"hasPrev"` HasNext bool `json:"hasNext"` Count int `json:"count"` CurrentPage int `json:"currentPage"` Liked []*PublicUser `json:"liked"` }
LikedList is list that contains liked and meta.
type LikingList ¶
type LikingList struct { HasPrev bool `json:"hasPrev"` HasNext bool `json:"hasNext"` Count int `json:"count"` CurrentPage int `json:"currentPage"` IsLiked bool `json:"isLiked"` Likings []*PublicUser `json:"likings"` }
LikingList is list that contains likings and meta.
type Link ¶
type Link struct { Id int64 `json:"id"` Kind int `json:"kind"` Name string `json:"title",sql:"size:255"` Url string `json:"url",sql:"size:512"` CreatedAt time.Time `json:"createdAt"` Icon string `json:"icon",sql:"size:255"` }
Link is a link model.
type Location ¶
type Location struct { Id int64 `json:"id"` Name string `json:"name",sql:"size:255"` Url string `json:"url",sql:"size:512"` Content string `json:"content"` Address string `json:"address"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Type string `json:"type"` UserId int64 `json:"userId"` Author PublicUser `json:"author"` ReferralId int64 `json:"referralId"` ReferralUserId int64 `json:"referralUserId"` PrevId int64 `json:"prevId"` NextId int64 `json:"nextId"` LikingCount int `json:"likingCount"` CommentCount int `json:"commentCount"` SharingCount int `json:"sharingCount"` Activate bool `json:"active"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt time.Time `json:"deletedAt"` Comments []Comment `gorm:"many2many:locations_comments;"` CommentList CommentList `json:"commentList"` Likings []User `gorm:"many2many:locations_users;"` LikingList LikingList `json:"likingList"` }
Location is a location model.
type PublicUser ¶
type PublicUser struct { *User Email omit `json:"email,omitempty",sql:"size:255;unique"` Password omit `json:"password,omitempty",sql:"size:255"` Name omit `json:"name,omitempty",sql:"size:255"` Birthday omit `json:"birthday,omitempty"` Gender omit `json:"gender,omitempty"` Token omit `json:"token,omitempty"` TokenExpiration omit `json:"tokenExperiation,omitempty"` // admin Activation omit `json:"activation,omitempty"` PasswordResetToken omit `json:"passwordResetToken,omitempty"` ActivationToken omit `json:"activationToken,omitempty"` PasswordResetUntil omit `json:"passwordResetUntil,omitempty"` ActivateUntil omit `json:"activateUntil,omitempty"` ActivatedAt omit `json:"activatedAt,omitempty"` UpdatedAt omit `json:"updatedAt,omitempty"` DeletedAt omit `json:"deletedAt,omitempty"` LastLoginAt omit `json:"lastLoginAt,omitempty"` CurrentLoginAt omit `json:"currentLoginAt,omitempty"` LastLoginIp omit `json:"lastLoginIp,omitempty",sql:"size:100"` CurrentLoginIp omit `json:"currentLoginIp,omitempty",sql:"size:100"` Connections omit `json:"connections,omitempty"` Languages omit `json:"languages,omitempty"` Roles omit `json:"roles,omitempty"` Articles omit `json:"articles,omitempty"` }
PublicUser is a public user model that contains only a few information for everyone.
type Role ¶
type Role struct { Id int64 `json:"id"` Name string `json:"name",sql:"size:255"` Description string `json:"description",sql:"size:255"` }
Role is a role model for user permission.
type User ¶
type User struct { Id int64 `json:"id"` Email string `json:"email",sql:"size:255;unique"` Password string `json:"password",sql:"size:255"` Name string `json:"name",sql:"size:255"` Username string `json:"username",sql:"size:255;unique"` Birthday time.Time `json:"birthday"` Gender int8 `json:"gender"` Description string `json:"description",sql:"size:100"` Token string `json:"token"` TokenExpiration time.Time `json:"tokenExperiation"` // email md5 for gravatar Md5 string `json:"md5"` // admin Activation bool `json:"activation"` PasswordResetToken string `json:"passwordResetToken"` ActivationToken string `json:"activationToken"` PasswordResetUntil time.Time `json:"passwordResetUntil"` ActivateUntil time.Time `json:"activateUntil"` ActivatedAt time.Time `json:"activatedAt"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt time.Time `json:"deletedAt"` LastLoginAt time.Time `json:"lastLoginAt"` CurrentLoginAt time.Time `json:"currentLoginAt"` LastLoginIp string `json:"lastLoginIp",sql:"size:100"` CurrentLoginIp string `json:"currentLoginIp",sql:"size:100"` // Liking LikingCount int `json:"likingCount"` LikedCount int `json:"likedCount"` Likings []User `gorm:"foreignkey:userId;associationforeignkey:follower_id;many2many:users_followers;"` Liked []User `gorm:"foreignkey:follower_id;associationforeignkey:userId;many2many:users_followers;"` LikingList LikingList `json:"likingList"` LikedList LikedList `json:"likedList"` Connections []Connection Languages []Language `gorm:"many2many:user_languages;"` // Many To Many, user_languages is the join table Roles []Role `gorm:"many2many:users_roles;"` // Many To Many, users_roles }
User is a user model
Click to show internal directories.
Click to hide internal directories.