Documentation ¶
Index ¶
- type Answer
- func (a *Answer) AfterCreate(tx *gorm.DB) (err error)
- func (a *Answer) AfterDelete(tx *gorm.DB) (err error)
- func (a *Answer) Create() (ra int64, err error)
- func (a *Answer) Delete() (ra int64, err error)
- func (a *Answer) Get() (answer Answer, err error)
- func (a *Answer) GetCounts() (counts int, err error)
- func (a *Answer) GetList(limit int, offset int) (answers []Answer, err error)
- func (a *Answer) GetOrderList(limit int, offset int, order string) (answers []Answer, err error)
- func (a *Answer) Update() (ra int64, err error)
- type Comment
- func (co *Comment) AfterCreate(tx *gorm.DB) (err error)
- func (co *Comment) AfterDelete(tx *gorm.DB) (err error)
- func (co *Comment) Create() (ra int64, err error)
- func (co *Comment) Delete() (ra int64, err error)
- func (co *Comment) Get() (comment Comment, err error)
- func (co *Comment) GetCounts() (counts int, err error)
- func (co *Comment) GetList(limit int, offset int) (comments []Comment, err error)
- func (co *Comment) Update() (ra int64, err error)
- type GORMBase
- type Profile
- func (p *Profile) Create() (ra int64, err error)
- func (p *Profile) Delete() (ra int64, err error)
- func (p *Profile) Get() (profile Profile, err error)
- func (p *Profile) GetCounts() (counts int, err error)
- func (p *Profile) GetList(limit int, offset int) (profiles []Profile, err error)
- func (p *Profile) Update() (ra int64, err error)
- type Question
- func (q *Question) AfterDelete(tx *gorm.DB) (err error)
- func (q *Question) Create() (ra int64, err error)
- func (q *Question) Delete() (ra int64, err error)
- func (q *Question) Get() (question Question, err error)
- func (q *Question) GetCounts() (counts int, err error)
- func (q *Question) GetList(limit int, offset int) (questions []Question, err error)
- func (q *Question) GetOrderList(limit int, offset int, order string) (questions []Question, err error)
- func (q *Question) Update() (ra int64, err error)
- type Reply
- func (r *Reply) AfterCreate(tx *gorm.DB) (err error)
- func (r *Reply) AfterDelete(tx *gorm.DB) (err error)
- func (r *Reply) Create() (ra int64, err error)
- func (r *Reply) Delete() (ra int64, err error)
- func (r *Reply) Get() (reply Reply, err error)
- func (r *Reply) GetCounts() (counts int, err error)
- func (r *Reply) GetList(limit int, offset int) (replies []Reply, err error)
- func (r *Reply) Update() (ra int64, err error)
- type Supporter
- type User
- func (u *User) AfterCreate(tx *gorm.DB) (err error)
- func (u *User) BeforeDelete(tx *gorm.DB) (err error)
- func (u *User) Create() (ra int64, err error)
- func (u *User) Delete() (ra int64, err error)
- func (u *User) Get() (user User, err error)
- func (u *User) GetCounts() (counts int, err error)
- func (u *User) GetList(limit int, offset int) (users []User, err error)
- func (u *User) Update() (ra int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer struct { GORMBase Content string `json:"content" gorm:"type:varchar(4000)"` Type int `json:"type"` Question Question `json:"question" gorm:"ForeignKey:QuestionID"` QuestionID int `json:"questionID"` AnswerProfile Profile `json:"answerProfile" gorm:"ForeignKey:AnswerProfileID"` AnswerProfileID int `json:"answerProfileID"` Comments []Comment `json:"-"` CommentsCounts int `json:"commentsCounts"` Supporters []Supporter `json:"-"` SupportersCounts int `json:"supportersCounts"` Supported bool `json:"supported" gorm:"-"` }
Answer struct
func (*Answer) GetOrderList ¶
GetOrderList func
type Comment ¶
type Comment struct { GORMBase Content string `json:"content"` Type int `json:"type"` Answer Answer `json:"-" gorm:"ForeignKey:AnswerID"` AnswerID int `json:"answerID"` CommentProfile Profile `json:"commentProfile" gorm:"ForeignKey:CommentProfileID"` CommentProfileID int `json:"commentProfileID"` Replies []Reply `json:"-"` RepliesCounts int `json:"repliesCounts"` }
Comment struct
func (*Comment) AfterCreate ¶
AfterCreate func
func (*Comment) AfterDelete ¶
AfterDelete func
type GORMBase ¶
type GORMBase struct { ID int `json:"id" gorm:"AUTO_INCREMENT"` CreatedAt int64 `json:"createAt"` UpdatedAt int64 `json:"updateAt"` }
GORMBase struct
func (*GORMBase) BeforeCreate ¶
BeforeCreate func
type Question ¶
type Question struct { GORMBase Title string `json:"title"` Desc string `json:"desc" gorm:"type:varchar(4000)"` Type int `json:"type"` QuestionProfile Profile `json:"questionProfile" gorm:"ForeignKey:QuestionProfileID"` QuestionProfileID int `json:"questionProfileID" gorm:"index"` Answers []Answer `json:"-"` AnswersCounts int `json:"answersCounts"` }
Question struct
func (*Question) AfterDelete ¶
AfterDelete func
type Reply ¶
type Reply struct { GORMBase Content string `json:"content"` Type int `json:"type"` Comment Comment `json:"-" gorm:"ForeignKey:CommentID"` CommentID int `json:"commentID"` ReplyFromProfile Profile `json:"replyFromProfile" gorm:"ForeignKey:ReplyFromProfileID"` ReplyFromProfileID int `json:"replyFromProfileID"` ReplyToProfile Profile `json:"replyToProfile" gorm:"ForeignKey:ReplyToProfileID"` ReplyToProfileID int `json:"replyToProfileID"` }
Reply struct
type Supporter ¶
type Supporter struct { GORMBase Answer Answer `json:"-" gorm:"ForeignKey:AnswerID"` AnswerID int `json:"answerID"` Profile Profile `json:"profile" gorm:"ForeignKey:ProfileID"` ProfileID int `json:"profileID"` }
Supporter struct
func (*Supporter) AfterCreate ¶
AfterCreate func
func (*Supporter) AfterDelete ¶
AfterDelete func
type User ¶
type User struct { GORMBase Mail string `json:"mail" gorm:"type:varchar(100);unique_index"` Password string `json:"password"` Authorized int `json:"authorized"` Type int `json:"type"` Profile Profile `json:"profile" gorm:"ForeignKey:ProfileID"` ProfileID int `json:"profileID"` }
User struct
Click to show internal directories.
Click to hide internal directories.