_api

package
v0.0.0-...-19d1247 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PreCheckWhiteListWithFE = []string{
	"/api/passport/login",
	"/api/passport/signup",
	"/api/passport/reset/password",

	"/api/config/page/login",
}
View Source
var PreCheckWhiteListWithoutFE = []string{
	"/",
	"/*",
	"/favicon.ico",
	"/robots.txt",
	"/passport/login",
	"/passport/signup",
	"/passport/reset/password",

	"/config/page/login",
}
View Source
var RoleList = []string{"deleted", "banned", "user", "vip", "admin"}

Functions

func AddTieba

func AddTieba(c echo.Context) error

func AddTiebaAccount

func AddTiebaAccount(c echo.Context) error

func AdminDeleteAccountToken

func AdminDeleteAccountToken(c echo.Context) error

func AdminDeleteTiebaAccountList

func AdminDeleteTiebaAccountList(c echo.Context) error

func AdminModifyAccountInfo

func AdminModifyAccountInfo(c echo.Context) error

func AdminResetPassword

func AdminResetPassword(c echo.Context) error

func AdminResetTiebaList

func AdminResetTiebaList(c echo.Context) error

func Api

func Api(address string, args ...any)

func CheckIsManager

func CheckIsManager(c echo.Context) error

func CheckTiebaAccount

func CheckTiebaAccount(c echo.Context) error

func CleanTiebaList

func CleanTiebaList(c echo.Context) error

func DeleteAccount

func DeleteAccount(c echo.Context) error

func ExportAccountData

func ExportAccountData(c echo.Context) error

func GetAccountInfo

func GetAccountInfo(c echo.Context) error

func GetAccountsList

func GetAccountsList(c echo.Context) error

func GetAdminSettings

func GetAdminSettings(c echo.Context) error

func GetBDUSS

func GetBDUSS(c echo.Context) error

func GetFidByFname

func GetFidByFname(c echo.Context) error

func GetLoginPageConfig

func GetLoginPageConfig(c echo.Context) error

func GetLoginQRCode

func GetLoginQRCode(c echo.Context) error

func GetNotifications

func GetNotifications(c echo.Context) error

func GetPluginsList

func GetPluginsList(c echo.Context) error

func GetServerStatus

func GetServerStatus(c echo.Context) error

func GetSettings

func GetSettings(c echo.Context) error

func GetTiebaAccountItem

func GetTiebaAccountItem(c echo.Context) error

func GetTiebaAccountList

func GetTiebaAccountList(c echo.Context) error

func GetTiebaList

func GetTiebaList(c echo.Context) error

func GetUserByTiebaUID

func GetUserByTiebaUID(c echo.Context) error

func GetUserByUsernameOrPortrait

func GetUserByUsernameOrPortrait(c echo.Context) error

func IgnoreTieba

func IgnoreTieba(c echo.Context) error

func ImportAccountData

func ImportAccountData(c echo.Context) error

func Login

func Login(c echo.Context) error

func Logout

func Logout(c echo.Context) error

func PluginPathPrecheck

func PluginPathPrecheck(next echo.HandlerFunc) echo.HandlerFunc

func PluginSwitch

func PluginSwitch(c echo.Context) error

func PluginUninstall

func PluginUninstall(c echo.Context) error

func PreCheck

func PreCheck(next echo.HandlerFunc) echo.HandlerFunc

func PreCheckWhiteListExists

func PreCheckWhiteListExists(path string) bool

func RefreshTiebaList

func RefreshTiebaList(c echo.Context) error

func RemoveTieba

func RemoveTieba(c echo.Context) error

func RemoveTiebaAccount

func RemoveTiebaAccount(c echo.Context) error

func ResetMessageBuilder

func ResetMessageBuilder(uid int32, forceMode bool) *_function.ResetPwdStruct

func ResetPassword

func ResetPassword(c echo.Context) error

func ResetTieba

func ResetTieba(c echo.Context) error

func SendResetMessage

func SendResetMessage(uid int32, pushType string, forceMode bool) (string, error)

func SendTestMessage

func SendTestMessage(c echo.Context) error

func SetHeaders

func SetHeaders(next echo.HandlerFunc) echo.HandlerFunc

func ShutdownSystem

func ShutdownSystem(c echo.Context) error

func Signup

func Signup(c echo.Context) error

func UpdateAccountInfo

func UpdateAccountInfo(c echo.Context) error

func UpdateAdminSettings

func UpdateAdminSettings(c echo.Context) error

func UpdatePassword

func UpdatePassword(c echo.Context) error

func UpdateSettings

func UpdateSettings(c echo.Context) error

TODO verify password

func UpgradeSystem

func UpgradeSystem(c echo.Context) error

Types

type PluginListContent

type PluginListContent struct {
	Name   string `json:"name"`
	Ver    string `json:"ver"`
	Status bool   `json:"status"`

	PluginNameCN      string `json:"plugin_name_cn"`
	PluginNameCNShort string `json:"plugin_name_cn_short"`
	PluginNameFE      string `json:"plugin_name_fe"`

	SettingOptions []PluginListSettingOption `json:"setting_options,omitempty"`
}

type PluginListSettingOption

type PluginListSettingOption struct {
	OptionName   string `json:"option_name"`
	OptionNameCN string `json:"option_name_cn"`
}

type SiteAccountsResponse

type SiteAccountsResponse struct {
	ID    int32  `json:"id"`
	Name  string `json:"name"`
	Email string `json:"email"`
	Role  string `json:"role"`
	T     string `json:"t"`

	BaiduAccountCount int `json:"baidu_account_count"`
	ForumCount        int `json:"forum_count"`

	// checkin status
	CheckinSuccess int `json:"checkin_success"`
	CheckinFailed  int `json:"checkin_failed"`
	CheckinWaiting int `json:"checkin_waiting"`
	CheckinIgnore  int `json:"checkin_ignore"`
}

type TcBackupUploadStruct

type TcBackupUploadStruct struct {
	TcBaiduid []TcBackupUploadStructTcBaiduid `json:"tc_baiduid,omitempty"`
	TcTieba   []TcBackupUploadStructTcTieba   `json:"tc_tieba,omitempty"`
}

type TcBackupUploadStructTcBaiduid

type TcBackupUploadStructTcBaiduid struct {
	Label    int    `json:"label"`
	Bduss    string `json:"bduss"`
	Stoken   string `json:"stoken"`
	Name     string `json:"name"`
	Portrait string `json:"portrait"`
}

type TcBackupUploadStructTcTieba

type TcBackupUploadStructTcTieba struct {
	Label     int    `json:"label"`
	Fid       int    `json:"fid"`
	Tieba     string `json:"tieba"`
	No        bool   `json:"no"`
	Status    int    `json:"status"`
	Latest    int    `json:"latest"`
	LastError string `json:"last_error"`
}

Jump to

Keyboard shortcuts

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