api

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Addr      = "https://tieba.baidu.com"
	AddrC     = "https://tiebac.baidu.com"
	UserAgent = "" /* 177-byte string literal not displayed */
)
View Source
const (
	CodeHasSigned = "160002"
)

Variables

This section is empty.

Functions

func Exec

func Exec[T iRespRes](r *resty.Request, method, url string) (t T, _ error)

func IsCode

func IsCode(err error, code string) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(account config.Account) *Client

func (*Client) ListForum

func (c *Client) ListForum() ([]*Forum, error)

func (*Client) R

func (c *Client) R() *resty.Request

func (*Client) SignForum

func (c *Client) SignForum(name string) (*SignForumInfo, error)

func (*Client) TBS

func (c *Client) TBS() (string, error)

type Forum

type Forum struct {
	Id        int    `json:"id"`
	Name      string `json:"name"`
	LevelId   int    `json:"level_id"`
	LevelName string `json:"level_name"`
	CurScore  int    `json:"cur_score"`
}

type ListForumData

type ListForumData struct {
	ForumList []*Forum `json:"forum_list"`
	// contains filtered or unexported fields
}

func (*ListForumData) GetCode

func (t *ListForumData) GetCode() string

func (*ListForumData) GetForums

func (t *ListForumData) GetForums() []*Forum

func (*ListForumData) IsSuccess

func (t *ListForumData) IsSuccess() bool

func (*ListForumData) String

func (t *ListForumData) String() string

type SignForumData

type SignForumData struct {
	UserInfo *SignForumInfo `json:"user_info"`
	// contains filtered or unexported fields
}

func (*SignForumData) GetCode

func (t *SignForumData) GetCode() string

func (*SignForumData) GetInfo

func (t *SignForumData) GetInfo() *SignForumInfo

func (*SignForumData) IsSuccess

func (t *SignForumData) IsSuccess() bool

func (*SignForumData) String

func (t *SignForumData) String() string

type SignForumInfo

type SignForumInfo struct {
	UserId   int `json:"user_id"`
	IsSignIn int `json:"is_sign_in"`
}

type TBSData

type TBSData struct {
	TBS     string `json:"tbs"`
	IsLogin int    `json:"is_login"`
}

func (*TBSData) IsSuccess

func (t *TBSData) IsSuccess() bool

func (*TBSData) String

func (t *TBSData) String() string

func (*TBSData) Value

func (t *TBSData) Value() string

Jump to

Keyboard shortcuts

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