post

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Cancel context.CancelFunc
)

Functions

func Bookmark added in v0.0.12

func Bookmark(c echo.Context) error

@Title toggle a bookmark for a post @Summary add or remove a personal bookmark for a post. @Description @Tags Post @Accept json @Produce json @Param id path string true "Post ID (event id) for toggling a bookmark" @Success 200 "OK - toggled bookmark successfully" @Failure 500 "Fail - internal error" @Router /api/post/bookmark/{id} [patch] @Security ApiKeyAuth

func BookmarkStatus added in v0.0.12

func BookmarkStatus(c echo.Context) error

@Title get current user's bookmark status for a post @Summary get current login user's bookmark status for a post. @Description @Tags Post @Accept json @Produce json @Param id path string true "Post ID (event id) for checking bookmark status" @Success 200 "OK - get bookmark status successfully" @Failure 500 "Fail - internal error" @Router /api/post/bookmark/status/{id} [get] @Security ApiKeyAuth

func BookmarkedPosts added in v0.0.12

func BookmarkedPosts(c echo.Context) error

@Title get bookmarked Posts @Summary get all bookmarked Post ids. @Description @Tags Post @Accept json @Produce json @Param order query string false "order[desc asc] to get Post ids ordered by event time" @Success 200 "OK - get successfully" @Failure 500 "Fail - internal error" @Router /api/post/bookmark/bookmarked [get] @Security ApiKeyAuth

func DelOne added in v0.0.10

func DelOne(c echo.Context) error

@Title delete one Post content @Summary delete one Post content. @Description @Tags Post @Accept json @Produce json @Param id query string true "Post ID for deleting" @Success 200 "OK - delete successfully" @Failure 400 "Fail - incorrect query param id" @Failure 404 "Fail - not found" @Failure 500 "Fail - internal error" @Router /api/post/del/one [delete] @Security ApiKeyAuth

func EraseOne added in v0.0.10

func EraseOne(c echo.Context) error

@Title erase one Post content @Summary erase one Post content permanently. @Description @Tags Post @Accept json @Produce json @Param id query string true "Post ID for erasing" @Success 200 "OK - erase successfully" @Failure 400 "Fail - incorrect query param id" @Failure 404 "Fail - not found" @Failure 500 "Fail - internal error" @Router /api/post/erase/one [delete] @Security ApiKeyAuth

func Followers added in v0.0.9

func Followers(c echo.Context) error

@Title get a Post follower-Post ids @Summary get a specified Post follower-Post id group. @Description @Tags Post @Accept json @Produce json @Param followee query string true "followee Post ID" @Success 200 "OK - get successfully" @Failure 404 "Fail - empty follower ids" @Failure 500 "Fail - internal error" @Router /api/post/follower/ids [get] @Security ApiKeyAuth

func GetOne

func GetOne(c echo.Context) error

@Title get one Post content @Summary get one Post content. @Description @Tags Post @Accept json @Produce json @Param id query string true "Post ID for its content" @Param remote query boolean true "remote ip for media src?" @Success 200 "OK - get Post event successfully" @Failure 400 "Fail - incorrect query param id" @Failure 404 "Fail - not found" @Failure 500 "Fail - internal error" @Router /api/post/one [get] @Security ApiKeyAuth

func IdAll added in v0.0.6

func IdAll(c echo.Context) error

@Title get all Post id group @Summary get all Post id group. @Description @Tags Post @Accept json @Produce json @Success 200 "OK - get successfully" @Failure 404 "Fail - empty event ids" @Failure 500 "Fail - internal error" @Router /api/post/ids-all [get] @Security ApiKeyAuth

func IdBatch

func IdBatch(c echo.Context) error

@Title get a batch of Post id group @Summary get a batch of Post id group. @Description @Tags Post @Accept json @Produce json @Param fetchby query string true "time or count" @Param value query string true "recent [value] minutes for time OR most recent [value] count" @Success 200 "OK - get successfully" @Failure 400 "Fail - incorrect query param type" @Failure 404 "Fail - not found" @Failure 500 "Fail - internal error" @Router /api/post/ids [get] @Security ApiKeyAuth

func OwnPosts added in v0.0.12

func OwnPosts(c echo.Context) error

@Title get own Post id group in a specific period @Summary get own Post id group in one specific time period. @Description @Tags Post @Accept json @Produce json @Param period query string false "time period for query, format is 'yyyymm', e.g. '202206'. if missing, current yyyymm applies" @Success 200 "OK - get successfully" @Failure 400 "Fail - incorrect query param type" @Failure 404 "Fail - empty event ids" @Failure 500 "Fail - internal error" @Router /api/post/own/ids [get] @Security ApiKeyAuth

func Template

func Template(c echo.Context) error

@Title Post template @Summary get Post template for dev reference. @Description @Tags Post @Accept json @Produce json @Success 200 "OK - upload successfully" @Router /api/post/template [get] @Security ApiKeyAuth

func ThumbsUp added in v0.0.10

func ThumbsUp(c echo.Context) error

@Title add or remove a thumbsup for a post @Summary add or remove a personal thumbsup for a post. @Description @Tags Post @Accept json @Produce json @Param id path string true "Post ID (event id) for adding or removing thumbs-up" @Success 200 "OK - added or removed thumb successfully" @Failure 500 "Fail - internal error" @Router /api/post/thumbsup/{id} [patch] @Security ApiKeyAuth

func ThumbsUpStatus added in v0.0.10

func ThumbsUpStatus(c echo.Context) error

@Title get current user's thumbsup status for a post @Summary get current login user's thumbsup status for a post. @Description @Tags Post @Accept json @Produce json @Param id path string true "Post ID (event id) for checking thumbs-up status" @Success 200 "OK - get thumbs-up status successfully" @Failure 500 "Fail - internal error" @Router /api/post/thumbsup/status/{id} [get] @Security ApiKeyAuth

func Upload

func Upload(c echo.Context) error

@Title upload a Post @Summary upload a Post by filling a Post template. @Description @Tags Post @Accept json @Produce json @Param data body string true "filled Post template json file" @Param followee query string false "followee Post ID (empty when doing a new post)" @Success 200 "OK - upload successfully" @Failure 400 "Fail - incorrect Post format" @Failure 500 "Fail - internal error" @Router /api/post/upload post @Security ApiKeyAuth

Types

type Attachment added in v0.0.11

type Attachment struct {
	Path string `json:"path"`
	Type string `json:"type"`
	Size string `json:"size"` // real dimension "width,height"
}

type Element added in v0.0.14

type Element struct {
	Video string `json:"html-video"` // <video>
	Image string `json:"html-image"` // <image>
	Audio string `json:"html-audio"` // <audio>
	HP    string `json:"html-hp"`    // <h1-h6> or <p>
}

type Paragraph added in v0.0.6

type Paragraph struct {
	Text     string     `json:"text"`
	RichText string     `json:"richtext"`
	Atch     Attachment `json:"atch"`
	Ele      Element    `json:"ele"`
}

type Post

type Post struct {
	Category string      `json:"category"`
	Topic    string      `json:"topic"`
	Keywords string      `json:"keywords"`
	Content  []Paragraph `json:"content"`
}

func (*Post) GenVFX added in v0.0.14

func (p *Post) GenVFX(uname string, remoteMode bool)

func (Post) String

func (p Post) String() string

Jump to

Keyboard shortcuts

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