Documentation ¶
Index ¶
- Constants
- type Admin
- type AdminAuth
- type AdminCreateInput
- type AdminLoginInput
- type AdminPaginate
- type AdminToken
- type AdminUpdateInput
- type Post
- type PostCategory
- type PostCategoryInput
- type PostCategoryPaginate
- type PostCreateInput
- type PostDeleteInput
- type PostPaginate
- type PostShow
- type PostStatus
- type PostUpdateInput
- type Role
- type User
- type UserAuth
- type UserCreateInput
- type UserLoginInput
- type UserPaginate
- type UserRegisterInput
- type UserToken
- type UserUpdateInput
- type UserUpdateMeInput
Constants ¶
View Source
const ( SUPER_ADMIN Role = "SUPER_ADMIN" ADMIN = "ADMIN" EDITOR = "EDITOR" SUPPORT = "SUPPORT" )
View Source
const ( PostStatusOpen PostStatus = "OPEN" PostStatusInProgress = "IN_PROGRESS" PostStatusDone = "DONE" PostStatusClose = "CLOSE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type Admin struct { ID string `gorm:"primaryKey" json:"id"` Username string `gorm:"unique;not null" json:"username"` Password string `gorm:"unique;not null" json:"-"` Email string `gorm:"unique;not null" json:"email"` FirstName string `gorm:"not null" json:"firstName"` LastName string `gorm:"not null" json:"lastName"` IsActive *bool `gorm:"not null" json:"isActive"` Role Role `gorm:"not null" json:"role"` LastLogin *time.Time `json:"lastLogin"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `gorm:"index"` }
Admin model
type AdminCreateInput ¶
type AdminCreateInput struct { Username string `validate:"required" json:"username"` Password string `validate:"required" json:"password"` Email string `validate:"required" json:"email"` FirstName string `validate:"required" json:"firstName"` LastName string `validate:"required" json:"lastName"` Role Role `validate:"required" json:"role"` IsActive *bool `validate:"required" json:"isActive"` }
AdminCreateInput
type AdminLoginInput ¶
type AdminLoginInput struct { Username string `validate:"required" json:"username"` Password string `validate:"required" json:"password"` }
AdminLoginInput
type AdminPaginate ¶
type AdminPaginate struct { Total int64 `json:"total"` PerPage int `json:"perPage"` Page int `json:"page"` LastPage int `json:"lastPage"` Admins []*Admin `json:"admins"` }
AdminPaginate
type AdminToken ¶
AdminToken jwt token
type AdminUpdateInput ¶
type AdminUpdateInput struct { Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Role Role `json:"role"` IsActive *bool `json:"isActive"` }
AdminUpdateInput
type Post ¶
type Post struct { ID string `gorm:"primaryKey" json:"id"` CategoryID string `gorm:"not null"` Category PostCategory `gorm:"foreignKey:CategoryID" json:"category"` Title string `gorm:"not null" json:"title"` Description string `json:"description"` Longitude *float64 `json:"longitude"` Latitude *float64 `json:"latitude"` Status PostStatus `gorm:"not null" json:"status"` CreatedBy string `gorm:"not null"` User User `gorm:"foreignKey:CreatedBy" json:"createdBy"` IsAnonymous *bool `gorm:"default:true; not null" json:"isAnonymous"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `gorm:"index"` }
Post model
type PostCategory ¶
type PostCategoryInput ¶
type PostCategoryInput struct {
CategoryName string `validate:"required" json:"categoryName"`
}
type PostCategoryPaginate ¶
type PostCategoryPaginate struct { Total int64 `json:"total"` PerPage int `json:"perPage"` Page int `json:"page"` LastPage int `json:"lastPage"` PostCategories []*PostCategory `json:"postCategories"` }
PostCategoryPaginate pagination
type PostCreateInput ¶
type PostCreateInput struct { CategoryID string `validate:"required" json:"categoryId"` Title string `validate:"required" json:"title"` Description string `validate:"required" json:"description"` Latitude *float64 `json:"latitude"` Longitude *float64 `json:"longitude"` IsAnonymous *bool `validate:"required" json:"isAnonymous"` }
PostCreateInput input
type PostPaginate ¶
type PostPaginate struct { Total int64 `json:"total"` PerPage int `json:"perPage"` Page int `json:"page"` LastPage int `json:"lastPage"` Posts []*PostShow `json:"posts"` }
PostPaginate
type PostShow ¶
type PostShow struct { ID string `json:"id"` Category PostCategory `json:"category"` Title string `json:"title"` Description string `json:"description"` Latitude *float64 `json:"latitude"` Longitude *float64 `json:"longitude"` Status PostStatus `json:"status"` CreatedBy *User `json:"createdBy"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
PostShow
type PostStatus ¶
type PostStatus string
type PostUpdateInput ¶
type PostUpdateInput struct { CategoryID string `json:"categoryId"` Title string `json:"title"` Description string `json:"description"` Latitude *float64 `json:"latitude"` Longitude *float64 `json:"longitude"` Status PostStatus `json:"status"` IsAnonymous *bool `json:"isAnonymous"` }
PostUpdateInput input
type User ¶
type User struct { ID string `gorm:"primaryKey" json:"id"` Username string `gorm:"unique;not null" json:"username"` Password string `gorm:"unique;not null" json:"-"` Email string `gorm:"unique;not null" json:"email"` FirstName string `gorm:"not null" json:"firstName"` LastName string `gorm:"not null" json:"lastName"` IsActive *bool `gorm:"not null" json:"isActive"` LastLogin time.Time `json:"lastLogin"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `gorm:"index"` Posts []*Post `gorm:"foreignKey:created_by" json:"posts"` }
User model
type UserCreateInput ¶
type UserCreateInput struct { Username string `validate:"required" json:"username"` Password string `validate:"required" json:"password"` Email string `validate:"required" json:"email"` FirstName string `validate:"required" json:"firstName"` LastName string `validate:"required" json:"lastName"` IsActive *bool `json:"isActive"` }
UserCreateInput create user
type UserLoginInput ¶
type UserLoginInput struct { Username string `validate:"required" json:"username"` Password string `validate:"required" json:"password"` }
UserLoginInput
type UserPaginate ¶
type UserPaginate struct { Total int64 `json:"total"` PerPage int `json:"perPage"` Page int `json:"page"` LastPage int `json:"lastPage"` Users []*User `json:"users"` }
UserPaginate pagination
type UserRegisterInput ¶
type UserRegisterInput struct { Username string `validate:"required" json:"username"` Password string `validate:"required" json:"password"` Email string `validate:"required" json:"email"` FirstName string `validate:"required" json:"firstName"` LastName string `validate:"required" json:"lastName"` }
UserRegisterInput register user
type UserUpdateInput ¶
type UserUpdateInput struct { Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` IsActive *bool `json:"isActive"` }
UserUpdateInput update input
type UserUpdateMeInput ¶
type UserUpdateMeInput struct { Email string `json:"email"` FirstName string `json:"firstName"` LastName string `json:"lastName"` }
UserUpdateMeInput update input
Click to show internal directories.
Click to hide internal directories.