Documentation ¶
Index ¶
- func CreateAnswer(a *Answer)
- func CreateAnswerComment(a *AnswerComment)
- func CreateAnswerGood(g *AnswerGood)
- func CreateBookMark(b *BookMark)
- func CreateNotification(n *Notification)
- func CreateQuestion(q *Question)
- func CreateQuestionComment(q *QuestionComment)
- func CreateQuestionGood(g *QuestionGood)
- func CreateUser(user *User)
- func DeleteAnswer(a *Answer) error
- func DeleteAnswerComment(a *AnswerComment) error
- func DeleteAnswerGood(g *AnswerGood) error
- func DeleteBookMark(b *BookMark) error
- func DeleteNotification(n *Notification) error
- func DeleteQuestion(q *Question) error
- func DeleteQuestionComment(q *QuestionComment) error
- func DeleteQuestionGood(g *QuestionGood) error
- func DeleteUser(u *User) error
- func UpdateAnswer(a *Answer) error
- func UpdateAnswerComment(a *AnswerComment) error
- func UpdateNotification(n *Notification) error
- func UpdateQuestion(q *Question) error
- func UpdateQuestionComment(q *QuestionComment) error
- func UpdateUser(u *User) error
- type Answer
- type AnswerComment
- type AnswerComments
- type AnswerGood
- type AnswerGoods
- type Answers
- type BookMark
- type BookMarks
- type Notification
- type Notifications
- type Question
- type QuestionComment
- type QuestionComments
- type QuestionGood
- type QuestionGoods
- type Questions
- type ReturnUser
- type ReturnUsers
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAnswerGood ¶
func CreateAnswerGood(g *AnswerGood)
func CreateBookMark ¶
func CreateBookMark(b *BookMark)
func CreateUser ¶
func CreateUser(user *User)
func UpdateNotification ¶
func UpdateNotification(n *Notification) error
notification を UPDATE 通知に関して,変更するのは既読フラグだけなのでこれでいい
Types ¶
type Answer ¶
type Answer struct { ID int `json:"id" gorm:"praimary_key"` // Id (インクリメント) UID int `json:"uid"` // User Id QID int `json:"qid"` // Question Id (質問に紐ずける) // 以下, 回答の構成要素たち Body string `json:"body"` Date string `json:"date"` FavoriteCount int `json:"favoriteCount"` }
回答テーブル
type AnswerComment ¶
type AnswerComments ¶
type AnswerComments []AnswerComment
type AnswerGood ¶
type AnswerGoods ¶
type AnswerGoods []AnswerGood
func FindAnswerGoods ¶
func FindAnswerGoods(g *AnswerGood) AnswerGoods
いいねを取得 例えば, UID AID 指定で,存在するかを判定できそう
type Answers ¶
type Answers []Answer
Question の配列として定義
func FindAnswers ¶
おそらくだけども, 引数はわりと自由 例えば, {QID: 3} を渡すと, Question に紐ずいた検索ができそう
type Notification ¶
type Notifications ¶
type Notifications []Notification
type Question ¶
type Question struct { UID int `json:"uid"` // User Id TID int `json:"tid"` // Tag Id ID int `json:"id" gorm:"praimary_key"` // Id (インクリメント) // 以下, 質問の構成要素たち Title string `json:"title"` Body string `json:"body"` Url string `json:"url"` Date string `json:"date"` Completed bool `json:"completed"` AnswerCount int `json:"answerCount"` FavoriteCount int `json:"favoriteCount"` BrowseCount int `json:"browseCount"` }
質問テーブル
type QuestionComment ¶
type QuestionComments ¶
type QuestionComments []QuestionComment
type QuestionGood ¶
type QuestionGoods ¶
type QuestionGoods []QuestionGood
func FindQuestionGoods ¶
func FindQuestionGoods(g *QuestionGood) QuestionGoods
いいねを取得 例えば, UID QID 指定で,存在するかを判定できそう
type Questions ¶
type Questions []Question
Question の配列として定義
func FindQuestions ¶
おそらくだけども, 引数はわりと自由 例えば, {UID: 3} を渡すと, 絞り込みで取得ができるっぽい
type ReturnUser ¶
type ReturnUser struct { ID int `json:"id" gorm:"praimary_key"` Name string `json:"name"` TwitterId string `json:"twitter_id"` FavoriteAnswer int `json:"favorite_answer"` FavoriteQuestion int `json:"favorite_question"` FavoriteSum int `json:"favorite_sum"` NotificationFlag bool `json:"notification_flag"` }
パスワードは json として送る必要がない
type ReturnUsers ¶
type ReturnUsers []ReturnUser
type User ¶
type User struct { ID int `json:"id" gorm:"praimary_key"` Name string `json:"name"` Password string `json:"password"` TwitterId string `json:"twitter_id"` FavoriteAnswer int `json:"favorite_answer"` FavoriteQuestion int `json:"favorite_question"` FavoriteSum int `json:"favorite_sum"` NotificationFlag bool `json:"notification_flag"` }
func (User) IntoReturnUser ¶
func (u User) IntoReturnUser() ReturnUser
type Users ¶
type Users []User
User の配列として定義
func FindUsersWithPage ¶
条件を満たす「質問」を, 固定長取得する page := ページ番号( 1-indexed ), length := 1 ページあたりのアイテム数
func (Users) IntoReturnUsers ¶
func (users Users) IntoReturnUsers() ReturnUsers
Click to show internal directories.
Click to hide internal directories.