dto

package
v0.0.0-...-fff97c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCommentReq

type AddCommentReq struct {
	Content string `json:"content" binding:"required"`
	NoteId  int64  `json:"note_id" binding:"required"`
}

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 GetCommentListReq struct {
	NoteId int64 `form:"note_id" binding:"required"`
	Offset int64 `form:"offset" binding:"-"`
	Limit  int64 `form:"limit" binding:"-"`
}

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 GetNoteListReq struct {
	Openid string `form:"openid" binding:"required"`
	Offset int64  `form:"offset" binding:"-"`
	Limit  int64  `form:"limit" binding:"-"`
}

type GetNoteListResp

type GetNoteListResp struct {
	List   []*NoteView `json:"list"`
	Offset int64       `json:"offset"`
	Limit  int64       `json:"limit"`
}

type GetUserNotesReq

type GetUserNotesReq struct {
	Offset int64 `form:"offset" binding:"-"`
	Limit  int64 `form:"limit" binding:"-"`
}

GetUserNotesReq 用form可以获取url中的参数,用json可以获取body中的参数

type GetUserNotesResp

type GetUserNotesResp struct {
	List   []*NoteView `json:"list"`
	Offset int64       `json:"offset"`
	Limit  int64       `json:"limit"`
}

type LikeNoteReq

type LikeNoteReq struct {
	NoteId int64 `json:"note_id" binding:"required"`
	Like   *int8 `json:"like" binding:"required"`
}

type LoginReq

type LoginReq struct {
	Code  string `form:"code"`
	AppId string `form:"app_id"`
}

LoginReq 为了兼容测试时没有app id,这里不做校验

type LoginResp

type LoginResp struct {
	Openid string `json:"openid"`
	Token  string `json:"token"`
}

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"`
}

func BuildNoteView

func BuildNoteView(note *do.Note, liked bool) *NoteView

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL