shijima

package module
v0.0.0-...-9d1f950 Latest Latest
Warning

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

Go to latest
Published: May 29, 2025 License: Unlicense Imports: 25 Imported by: 0

README

cd ./main/
go build .

很多是ai代码。

有的地方是硬编码,一个人写不要有什么整理做得很好的期待。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReactionsBatchHandler

func GetReactionsBatchHandler(c *gin.Context)

GetReactionsBatchHandler 处理获取多个帖子 reactions 的 HTTP 请求 GET /reactions_batch?id=1&id=2&id=3 或 /reactions_batch?id=1,2,3

func GetReactionsHandler

func GetReactionsHandler(c *gin.Context)

GetReactionsHandler 处理获取帖子 reactions 的 HTTP 请求 GET /reactions/:tid

func GetReactionsHandlerAlt

func GetReactionsHandlerAlt(c *gin.Context)

GetReactionsHandler 处理获取帖子 reactions 的 HTTP 请求 GET /reactions/:tid

func Run

func Run(addr string) error

func SetReactionHandler

func SetReactionHandler(c *gin.Context)

SetReactionHandler 处理设置/更新/取消用户 reaction 的 HTTP 请求 POST /reactions/:tid

func SetReactionHandlerAlt

func SetReactionHandlerAlt(c *gin.Context)

SetReactionHandler 处理设置/更新/取消用户 reaction 的 HTTP 请求 POST /reactions/:tid

Types

type Board

type Board struct {
	TID      uint `db:"tid" json:"tid,omitempty"`
	BID      uint `db:"bid" json:"bid,omitempty"`
	ReplyNum uint `db:"num"`
}

表结构对应的结构体(根据图片中的列定义)

type ReactionResult

type ReactionResult struct {
	TID        int
	Counts     *orderedmap.OrderedMap
	MyReaction string
	Error      error
}

定义一个结构体来封装每个帖子 reactions 的结果,用于并发处理

type Thread

type Thread struct {
	T    string    `db:"t" json:"t,omitempty"`  // title (无标题)
	N    string    `db:"n" json:"n,omitempty"`  // name (无名氏)
	Ts   string    `db:"ts" json:"ts"`          // timestamp
	ID   string    `db:"id" json:"id"`          // user identity
	No   uint      `db:"no" json:"no"`          // number
	P    string    `db:"p"  json:"p,omitempty"` // picture src
	Txt  string    `db:"txt" json:"txt"`        // content
	R    uint      `db:"r" json:"r,omitempty"`  // reply to
	Del  int8      `db:"del" json:"-"`          // is deleted?
	C    string    `db:"c" json:"-"`            // country
	IP   string    `db:"ip" json:"-"`           // ip address
	Num  int       `json:"num,omitempty"`       // from board
	List []*Thread `json:"list,omitempty"`      // replies
}

表结构对应的结构体(根据图片中的列定义)

Directories

Path Synopsis
my_fetch/my_if
封装,直接得到一个包含了ipv6地址的http.Client
封装,直接得到一个包含了ipv6地址的http.Client

Jump to

Keyboard shortcuts

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