model

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CategoryHomeRecommend = "home_recommend"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Uid      uint64 `json:"uid"`
	Nickname string `json:"nickname"`
	Avatar   string `json:"avatar"`
}

func NewAuthor

func NewAuthor(u *userv1.UserInfo) *Author

type FeedDetailRequest

type FeedDetailRequest struct {
	NoteId uint64 `form:"note_id"`
	Source string `form:"source,optional"`
}

func (*FeedDetailRequest) Validate

func (r *FeedDetailRequest) Validate() error

type FeedNoteItem

type FeedNoteItem struct {
	NoteId   uint64            `json:"note_id"`
	Title    string            `json:"title"`
	Desc     string            `json:"desc"`
	CreateAt int64             `json:"create_at"`
	Images   NoteItemImageList `json:"images"`
	Likes    uint64            `json:"likes"` // 笔记总点赞数

	// 下面这些字段要额外设置
	Author   *Author     `json:"author"`   // 作者信息
	Comments uint64      `json:"comments"` // 笔记总评论数
	Interact Interaction `json:"interact"` // 当前请求的用户与该笔记的交互记录,比如点赞、评论、收藏等动作
}

func NewFeedNoteItemFromPb

func NewFeedNoteItemFromPb(pb *notev1.FeedNoteItem) *FeedNoteItem

type FeedRecommendRequest

type FeedRecommendRequest struct {
	NeedNum  int    `form:"need_num"`
	Platform string `form:"platform,optional"`
	Category string `form:"category,optional"`
}

func (*FeedRecommendRequest) Validate

func (r *FeedRecommendRequest) Validate() error

type Interaction

type Interaction struct {
	Liked     bool `json:"liked"`     // 用户是否点赞过该笔记
	Commented bool `json:"commented"` // 用户是否评论过该笔记
}

包含发起请求的用户和该笔记的交互记录

type NoteItemImage

type NoteItemImage struct {
	Url  string `json:"url"`
	Type int    `json:"type"`
}

type NoteItemImageList

type NoteItemImageList []*NoteItemImage

Jump to

Keyboard shortcuts

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