Documentation ¶
Index ¶
- type AddCommentReq
- type AddNoteReq
- type CommentView
- type DelNoteReq
- type GetCommentListReq
- type GetCommentListResp
- type GetNoteDetailReq
- type GetNoteDetailResp
- type GetNoteListReq
- type GetNoteListResp
- type GetUserNotesReq
- type GetUserNotesResp
- type LikeNoteReq
- type LoginReq
- type LoginResp
- type NoteView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddCommentReq ¶
type AddNoteReq ¶
type AddNoteReq struct { Content string `json:"content" binding:"required"` IsPublic *int8 `json:"is_public" binding:"required"` }
AddNoteReq 用指针可以判断是否传入,go里int8默认值为0,不使用指针无法判断是否传入
type CommentView ¶
type CommentView struct { ID int64 `json:"id"` Openid string `json:"openid"` // 小程序用户唯一标识符 CreateTime int64 `json:"create_time"` UpdateTime int64 `json:"update_time"` NoteId int64 `json:"note_id"` // 笔记id Content string `json:"content"` // 留言内容 }
func BuildCommentView ¶
func BuildCommentView(note *do.Comment) *CommentView
type DelNoteReq ¶
type DelNoteReq struct {
NoteId int64 `json:"note_id" binding:"required"`
}
type GetCommentListReq ¶
type GetCommentListResp ¶
type GetCommentListResp struct { List []*CommentView `json:"list"` Offset int64 `json:"offset"` Limit int64 `json:"limit"` }
type GetNoteDetailReq ¶
type GetNoteDetailReq struct {
NoteId int64 `form:"note_id" binding:"required"`
}
type GetNoteDetailResp ¶
type GetNoteDetailResp NoteView
type GetNoteListReq ¶
type GetNoteListResp ¶
type GetUserNotesReq ¶
type GetUserNotesReq struct { Offset int64 `form:"offset" binding:"-"` Limit int64 `form:"limit" binding:"-"` }
GetUserNotesReq 用form可以获取url中的参数,用json可以获取body中的参数
type GetUserNotesResp ¶
type LikeNoteReq ¶
type NoteView ¶
type NoteView struct { ID int64 `json:"id"` Openid string `json:"openid"` // 小程序用户唯一标识符 CreateTime int64 `json:"create_time"` UpdateTime int64 `json:"update_time"` Content string `json:"content"` // 笔记内容 LikeNum int64 `json:"like_num"` IsPublic int8 `json:"is_public"` // 是否公开 Liked bool `json:"liked"` }
Click to show internal directories.
Click to hide internal directories.