Documentation ¶
Index ¶
- Variables
- type Answer
- type AnswerRequest
- type ArrStringFilterType
- type Currency
- type GetRecommendationRequest
- type HTTPResponse
- type ImageUploadResult
- type JWTClaim
- type Match
- type MatchCalculationResult
- type MatchProfile
- type OneUserFilter
- type Pagination
- type PaginationReq
- type PaginationResp
- type PassRequest
- type Profile
- type ProfileCreateRequest
- type ProfileFilter
- type ProfileImageDeleteRequest
- type ProfileUpdateRequest
- type Question
- type RecommendationBin
- type RegisterRequest
- type SendVerificationEmailRequest
- type SerializableAnswer
- type SerializableNestedUser
- type SerializableProfile
- type SerializableQuestion
- type SerializableUser
- type SignInRequest
- type SmashRequest
- type TaxRate
- type User
- type UserUpdateRequest
- type VerifyEmailRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPagination = Pagination{
CurrentPage: 1,
PerPage: 10,
}
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer struct { gorm.Model UserID string `gorm:"primaryKey;column:user_id"` QuestionID int `gorm:"primaryKey;column:question_id"` UserAnswer int `gorm:"column:user_answer"` PreferAnswer int `gorm:"column:prefer_answer"` Importance int `gorm:"column:importance"` }
Answer model
func (*Answer) Serialize ¶
func (p *Answer) Serialize() *SerializableAnswer
type AnswerRequest ¶
type ArrStringFilterType ¶
type ArrStringFilterType string
func NewArrStringFilterType ¶
func NewArrStringFilterType(args ...string) *ArrStringFilterType
func (*ArrStringFilterType) Values ¶
func (t *ArrStringFilterType) Values() []string
type HTTPResponse ¶
type HTTPResponse struct { Message string `json:"message,omitempty"` Data interface{} `json:"data,omitempty"` InvalidFields []string `json:"invalid_fields,omitempty"` Pagination *PaginationResp `json:"pagination,omitempty"` }
HTTPResponse represents a boilerplate of HTTP response payload
type ImageUploadResult ¶
type JWTClaim ¶
type JWTClaim struct { UserID string `json:"user_id"` UserEmail string `json:"user_email"` jwt.StandardClaims }
JWTClaim represents the authorized object encrypted in the JWT token
type Match ¶
type MatchCalculationResult ¶
type MatchProfile ¶
type MatchProfile struct { ID string `json:"id"` Name string `json:"name"` Gender string `json:"gender"` Birthday time.Time `json:"birthday"` Height string `json:"height"` Horoscope string `json:"horoscope"` Hobby []string `json:"hobby"` Language []string `json:"language"` Education string `json:"education"` Location string `json:"location"` HomeTown string `json:"home_town"` Distance float64 `json:"distance"` MatchPercentage float64 `json:"match_percentage"` Image1 string `json:"image_1"` Image2 string `json:"image_2"` Image3 string `json:"image_3"` Image4 string `json:"image_4"` Image5 string `json:"image_5"` }
type OneUserFilter ¶
type OneUserFilter struct { ID string `form:"id"` Email string `form:"email"` Joins *ArrStringFilterType `form:"joins"` Fields *ArrStringFilterType `form:"fields"` }
type Pagination ¶
type Pagination struct { CurrentPage int `json:"current_page" form:"current_page"` PerPage int `json:"per_page" form:"per_page"` }
func ParsePagination ¶
func ParsePagination(ctx *gin.Context) (*Pagination, error)
ParsePagination parses pagination from query string
type PaginationReq ¶
type PaginationReq Pagination
type PaginationResp ¶
type PaginationResp struct { Pagination Count int64 `json:"count"` }
type PassRequest ¶
type PassRequest struct {
UserId string `json:"user_id"`
}
type Profile ¶
type Profile struct { gorm.Model ID string `gorm:"primaryKey;column:id"` Name string `gorm:"column:name"` Gender string `gorm:"column:gender"` Birthday time.Time `gorm:"column:birthday"` Height string `gorm:"column:height"` Horoscope string `gorm:"column:horoscope"` Hobby string `gorm:"column:hobby"` Language string `gorm:"column:language"` Education string `gorm:"column:education"` HomeTown string `gorm:"column:home_town"` Coordinates string `gorm:"column:coordinates"` ImageId1 string `gorm:"column:image_id_1"` ImageId2 string `gorm:"column:image_id_2"` ImageId3 string `gorm:"column:image_id_3"` ImageId4 string `gorm:"column:image_id_4"` ImageId5 string `gorm:"column:image_id_5"` ImageUrl1 string `gorm:"column:image_url_1"` ImageUrl2 string `gorm:"column:image_url_2"` ImageUrl3 string `gorm:"column:image_url_3"` ImageUrl4 string `gorm:"column:image_url_4"` ImageUrl5 string `gorm:"column:image_url_5"` }
Profile model
func (*Profile) ConvertToMatchProfile ¶
func (p *Profile) ConvertToMatchProfile() *MatchProfile
func (*Profile) Serialize ¶
func (p *Profile) Serialize() *SerializableProfile
type ProfileCreateRequest ¶
type ProfileCreateRequest struct { Name string `json:"name" validate:"required"` Gender string `json:"gender" validate:"oneof=male female,required"` BirthdayInSeconds int64 `json:"birthday_in_seconds" validate:"required"` Height string `json:"height"` Horoscope string `json:"horoscope"` Hobby []string `json:"hobby"` Language []string `json:"language"` Education string `json:"education"` Location string `json:"location"` HomeTown string `json:"home_town"` Coordinates struct { Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` } `json:"coordinates"` }
type ProfileFilter ¶
type ProfileImageDeleteRequest ¶
type ProfileImageDeleteRequest struct {
Slots []int `json:"slots"`
}
type ProfileUpdateRequest ¶
type ProfileUpdateRequest struct { Name string `json:"name"` Gender string `json:"gender" validate:"oneof=male female"` BirthdayInSeconds int64 `json:"birthday_in_seconds"` Height string `json:"height"` Horoscope string `json:"horoscope"` Hobby []string `json:"hobby"` Language []string `json:"language"` Education string `json:"education"` Location string `json:"location"` HomeTown string `json:"home_town"` Coordinates struct { Longitude float64 `json:"longitude"` Latitude float64 `json:"latitude"` } `json:"coordinates"` ImageId1 string `json:"image_id_1"` ImageId2 string `json:"image_id_2"` ImageId3 string `json:"image_id_3"` ImageId4 string `json:"image_id_4"` ImageId5 string `json:"image_id_5"` ImageUrl1 string `json:"image_url_1"` ImageUrl2 string `json:"image_url_2"` ImageUrl3 string `json:"image_url_3"` ImageUrl4 string `json:"image_url_4"` ImageUrl5 string `json:"image_url_5"` }
type Question ¶
type Question struct { gorm.Model QuestionID int `gorm:"primaryKey;column:question_id"` QuestionContent string `gorm:"column:content"` QuestionAnswer string `gorm:"column:answers"` }
Question model
func (*Question) Serialize ¶
func (q *Question) Serialize() *SerializableQuestion
type RecommendationBin ¶
type RecommendationBin struct { gorm.Model UserID string `gorm:"primaryKey;column:user_id"` RecommendedUserID string `gorm:"primaryKey;column:recommended_user_id"` }
RecommendationBin model
func (*RecommendationBin) TableName ¶
func (p *RecommendationBin) TableName() string
TableName gives table name of model
type RegisterRequest ¶
type SendVerificationEmailRequest ¶
type SendVerificationEmailRequest struct {
Email string `json:"email" validate:"required,email"`
}
type SerializableAnswer ¶
type SerializableNestedUser ¶
type SerializableNestedUser struct {
User *SerializableUser `json:"user,omitempty"`
}
type SerializableProfile ¶
type SerializableProfile struct { ID string `json:"id"` Name string `json:"name"` Gender string `json:"gender"` BirthdayInSeconds int64 `json:"birthday_in_seconds"` Height string `json:"height"` Horoscope string `json:"horoscope"` Hobby []string `json:"hobby"` Language []string `json:"language"` Education string `json:"education"` Location string `json:"location"` HomeTown string `json:"home_town"` Image1 string `json:"image_1"` Image2 string `json:"image_2"` Image3 string `json:"image_3"` Image4 string `json:"image_4"` Image5 string `json:"image_5"` Answered int `json:"answered"` }
type SerializableQuestion ¶
type SerializableUser ¶
type SignInRequest ¶
type SmashRequest ¶
type SmashRequest struct {
UserId string `json:"user_id"`
}
type User ¶
type User struct { gorm.Model ID string `gorm:"primaryKey;column:id"` Email string `gorm:"column:email"` Password string `gorm:"column:password"` VerificationCode string `gorm:"column:verification_code"` VerificationStatus int `gorm:"column:verification_status"` VerificationTime time.Time `gorm:"column:verification_time"` }
User model
func (*User) Serialize ¶
func (u *User) Serialize() *SerializableUser
func (*User) SerializeNested ¶
func (u *User) SerializeNested() *SerializableNestedUser
type UserUpdateRequest ¶
type VerifyEmailRequest ¶
Click to show internal directories.
Click to hide internal directories.