Documentation ¶
Index ¶
- type Audit
- type Profile
- type ProfileAudit
- type ProfileCover
- type ProfileInfo
- type ProfileInfoAddress
- type ProfileInfoBasic
- type ProfileInfoBirth
- type ProfileInfoContact
- type ProfileInfoEducation
- type ProfileInfoIntroduction
- type ProfileInfoProfession
- type ProfileProof
- type ProfileProofCompany
- type ProfileProofEducation
- type ProfileProofIdentityCard
- type ProfileProofProfession
- type ProfileProofStudent
- type ProfileQuestion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audit ¶
type Audit struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id" map:"_id"` Type int `bson:"type" json:"type" map:"type"` //类型,如profile的头像等 Fields []string `bson:"fields" json:"fields" map:"fields"` //需要审核的字段 Enable bool `bson:"enable" json:"enable" map:"enable"` //是否启用此审核条件 CreateTime time.Time `bson:"create_time" json:"create_time" map:"create_time"` //创建时间 UpdateTime time.Time `bson:"update_time" json:"update_time" map:"update_time"` //更新时间 }
审核,需要经过审核的,在此选择类型并添加需审核的字段, 相关集合写入前会被拦截,并添加到相应的审核记录集合里面进行审核, 审核通过了,才能正式入库
type Profile ¶
type Profile struct { UserID primitive.ObjectID `json:"user_id" bson:"_id" map:"_id"` Proof ProfileProof `json:"proof" bson:"proof" map:"proof"` Info ProfileInfo `json:"info" bson:"info" map:"info"` Questions []ProfileQuestion `json:"questions" bson:"questions,omitempty" map:"questions,omitempty"` Enable bool `json:"enable" bson:"enable" map:"enable"` CreateTime time.Time `json:"create_time" bson:"create_time" map:"create_time"` UpdateTime time.Time `json:"update_time" bson:"update_time" map:"update_time"` }
type ProfileAudit ¶
type ProfileAudit struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"_id" map:"_id"` Type int `bson:"type" json:"type" map:"type"` //类型,如profile的头像等 Content []map[string]string `bson:"content" json:"content" map:"content"` //key=>相关集合的字段,values=>相关集合的内容 Status int `bson:"status" json:"status" map:"status"` //只有状态为predefined.AuditStatusPass时,才会真正存入相关集合的相关字段 CreateTime time.Time `bson:"create_time" json:"create_time" map:"create_time"` //创建时间 UpdateTime time.Time `bson:"update_time" json:"update_time" map:"update_time"` //更新时间 }
type ProfileCover ¶
type ProfileInfo ¶
type ProfileInfo struct { Avatar string `json:"avatar" bson:"avatar" map:"avatar"` NickName string `json:"nickname" bson:"nickname" map:"nickname"` Cover ProfileCover `json:"cover" bson:"cover" map:"cover"` Basic ProfileInfoBasic `json:"basic" bson:"basic" map:"basic"` Photos []string `json:"photos" bson:"photos,omitempty" map:"photos,omitempty"` Introduction []ProfileInfoIntroduction `json:"introduction" bson:"introduction,omitempty" map:"introduction,omitempty"` Education ProfileInfoEducation `json:"education" bson:"education" map:"education"` Profession ProfileInfoProfession `json:"profession" bson:"profession" map:"profession"` Contact ProfileInfoContact `json:"contact" bson:"contact" map:"contact"` Address []ProfileInfoAddress `json:"address" bson:"address,omitempty" map:"address,omitempty"` Tags []string `json:"tags" bson:"tags,omitempty" map:"tags,omitempty"` }
type ProfileInfoAddress ¶
type ProfileInfoAddress struct { Type int `json:"type" bson:"type" map:"type" form:"type" validate:"oneof=0 1"` Nation string `json:"nation" bson:"nation" map:"nation" form:"nation" validate:"required"` Province string `json:"province" bson:"province" map:"province" form:"province" validate:"required"` City string `json:"city" bson:"city" map:"city" form:"city" validate:"required"` District string `json:"district" bson:"district" map:"district" form:"district" validate:"required"` Address string `json:"address" bson:"address" map:"address" form:"address" validate:"required"` }
type ProfileInfoBasic ¶
type ProfileInfoBasic struct { Sex int `json:"sex" bson:"sex" map:"sex" form:"sex" validate:"oneof=0 1 2"` Birth ProfileInfoBirth `json:"birth" bson:"birth" map:"birth" form:"birth" validate:"required,dive"` Height int `json:"height" bson:"height" map:"height" form:"height" validate:"required,gte=140,lte=250"` Weight int `json:"weight" bson:"weight" map:"weight" form:"weight" validate:"required,gte=50,lte=250"` Marriage int `json:"marriage" bson:"marriage" map:"marriage" form:"marriage" validate:"oneof=0 1 2"` Constellation int `json:"constellation" bson:"constellation" map:"constellation" form:"constellation" validate:"gte=0,lte=11"` }
type ProfileInfoBirth ¶
type ProfileInfoContact ¶
type ProfileInfoEducation ¶
type ProfileInfoEducation struct { HighestDegree string `json:"highest_degree" bson:"highest_degree" map:"highest_degree" form:"highest_degree" validate:"required"` GraduatedCollege string `json:"graduated_college" bson:"graduated_college" map:"graduated_college" form:"graduated_college" validate:"required"` }
type ProfileInfoIntroduction ¶
type ProfileInfoIntroduction struct { Type int `json:"type" bson:"type" map:"type" form:"type" validate:"oneof=0 1 2"` Introduction string `json:"introduction" bson:"introduction" map:"introduction" form:"introduction" validate:"required"` Photos []string `json:"photos" bson:"photos,omitempty" map:"photos,omitempty" form:"photos" validate:"gt=0,dive,required"` }
type ProfileInfoProfession ¶
type ProfileInfoProfession struct { Company string `json:"company" bson:"company" map:"company" form:"company" validate:"required"` Position string `json:"position" bson:"position" map:"position" form:"position" validate:"required"` AnnualIncome int `json:"annual_income" bson:"annual_income" map:"annual_income" form:"annual_income" validate:"oneof=0 1 2 3 4 5"` }
type ProfileProof ¶
type ProfileProof struct { IdentityCard ProfileProofIdentityCard `json:"identity_card" bson:"identity_card" map:"identity_card"` Profession ProfileProofProfession `json:"profession" bson:"profession" map:"profession"` Education ProfileProofEducation `json:"education" bson:"education" map:"education"` }
type ProfileProofCompany ¶
type ProfileProofCompany struct { CompanyName string `json:"company_name" bson:"company_name" map:"company_name" form:"company_name" validate:"required"` ShowName string `json:"show_name" bson:"show_name" map:"show_name" form:"degree" show_name:"required"` Images []string `json:"images" bson:"images,omitempty" map:"images,omitempty" form:"images" validate:"gt=0,dive,required"` }
type ProfileProofEducation ¶
type ProfileProofEducation struct { Type int `json:"type" bson:"type" map:"type" form:"type" validate:"oneof=0 1 2 3 4"` ID string `json:"id" bson:"id" map:"id" form:"id" validate:"required"` CollegeName string `json:"college_name" bson:"college_name" map:"college_name" form:"college_name" validate:"required"` Degree string `json:"degree" bson:"degree" map:"degree" form:"degree" validate:"required"` Place string `json:"place" bson:"place" map:"place" form:"place" validate:"required_if=type 4"` Year string `json:"year" bson:"year" map:"year" form:"year" validate:"required_if=type 4"` Images []string `json:"images" bson:"images,omitempty" map:"images,omitempty" form:"images" validate:"required_if=type 1,gt=0,dive,required"` Verified bool `json:"verified" bson:"verified" map:"verified"` }
type ProfileProofIdentityCard ¶
type ProfileProofIdentityCard struct { ID string `json:"id" bson:"id" map:"id" form:"id" validate:"required"` RealName string `json:"real_name" bson:"real_name" map:"real_name" form:"real_name" validate:"required"` Images []string `json:"images" bson:"images,omitempty" map:"images,omitempty" form:"images" validate:"gt=0,dive,required"` Verified bool `json:"verified" bson:"verified" map:"verified"` }
type ProfileProofProfession ¶
type ProfileProofProfession struct { Type int `json:"type" bson:"type" map:"type" form:"type" validate:"oneof=0 1 2 3 4 5 6"` Company ProfileProofCompany `json:"company" bson:"company" map:"company" form:"company" validate:"required_without=Student,dive"` Student ProfileProofStudent `json:"student" bson:"student" map:"student" form:"student" validate:"required_if=type 6,required_without=Company,dive"` Verified bool `json:"verified" bson:"verified" map:"verified"` }
type ProfileProofStudent ¶
type ProfileProofStudent struct { SchoolName string `json:"school_name" bson:"school_name" map:"school_name" form:"school_name" validate:"required"` Degree string `json:"degree" bson:"degree" map:"degree" form:"degree" validate:"required"` Images []string `json:"images" bson:"images,omitempty" map:"images,omitempty" form:"images" validate:"gt=0,dive,required"` }
type ProfileQuestion ¶
Click to show internal directories.
Click to hide internal directories.