webapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Finance

func Finance(transType string) (string, error)

汇率请求

func HoyoBBS

func HoyoBBS() ([]string, error)

func IsSameDay added in v1.0.0

func IsSameDay(latestTime, nowTime, offset int64) bool

判断两个时间戳是否为同一天, 请确保输入时间的时区是一样的

offset: 每天的分割点, 默认为 00:00:00 即 0s, 00:01:01 -> 61s

func MihoyoBBSGoodsForQuery added in v1.0.0

func MihoyoBBSGoodsForQuery(uid string) ([]interface{}, error)

func MihoyoBBSGoodsUpdate added in v1.0.0

func MihoyoBBSGoodsUpdate() error

func MihoyoLiveCode added in v1.0.0

func MihoyoLiveCode() string

func MihoyoLiveCodeStringFormat added in v1.0.0

func MihoyoLiveCodeStringFormat(s string) string

func RranslateByYouDao

func RranslateByYouDao(word string) (string, error)

func StringToTimeStamp added in v1.0.0

func StringToTimeStamp(dateStr string) int64

func TimeStampToString added in v1.0.0

func TimeStampToString(timeStamp int64) string

Types

type BBSGoodsType added in v1.0.0

type BBSGoodsType struct {
	GoodsID   string `json:"goods_id" bson:"goods_id"`
	GoodsName string `json:"goods_name" bson:"goods_name"`
	Type      int    `json:"type" bson:"type"`
	Price     int    `json:"price" bson:"price"`
	Icon      string `json:"icon" bson:"icon"`
	NextTime  int    `json:"next_time" bson:"next_time"`
	NowTime   int    `json:"now_time" bson:"now_time"`
}

func GetMihoyoGoods added in v1.0.0

func GetMihoyoGoods() ([]BBSGoodsType, error)

type CosApi

type CosApi struct {
	Retcode int    `json:"retcode"`
	Message string `json:"message"`
	Data    struct {
		List []struct {
			Post struct {
				GameID     int      `json:"game_id"`
				PostID     string   `json:"post_id"`
				FForumID   int      `json:"f_forum_id"`
				UID        string   `json:"uid"`
				Subject    string   `json:"subject"`
				Content    string   `json:"content"`
				Cover      string   `json:"cover"`
				ViewType   int      `json:"view_type"`
				CreatedAt  int      `json:"created_at"`
				Images     []string `json:"images"`
				PostStatus struct {
					IsTop      bool `json:"is_top"`
					IsGood     bool `json:"is_good"`
					IsOfficial bool `json:"is_official"`
				} `json:"post_status"`
				TopicIds               []int         `json:"topic_ids"`
				ViewStatus             int           `json:"view_status"`
				MaxFloor               int           `json:"max_floor"`
				IsOriginal             int           `json:"is_original"`
				RepublishAuthorization int           `json:"republish_authorization"`
				ReplyTime              string        `json:"reply_time"`
				IsDeleted              int           `json:"is_deleted"`
				IsInteractive          bool          `json:"is_interactive"`
				StructuredContent      string        `json:"structured_content"`
				StructuredContentRows  []interface{} `json:"structured_content_rows"`
				ReviewID               int           `json:"review_id"`
				IsProfit               bool          `json:"is_profit"`
				IsInProfit             bool          `json:"is_in_profit"`
				UpdatedAt              int           `json:"updated_at"`
				DeletedAt              int           `json:"deleted_at"`
				PrePubStatus           int           `json:"pre_pub_status"`
				CateID                 int           `json:"cate_id"`
				ProfitPostStatus       int           `json:"profit_post_status"`
			} `json:"post"`
			Forum struct {
				ID        int         `json:"id"`
				Name      string      `json:"name"`
				Icon      string      `json:"icon"`
				GameID    int         `json:"game_id"`
				ForumCate interface{} `json:"forum_cate"`
			} `json:"forum"`
			Topics []struct {
				ID            int    `json:"id"`
				Name          string `json:"name"`
				Cover         string `json:"cover"`
				IsTop         bool   `json:"is_top"`
				IsGood        bool   `json:"is_good"`
				IsInteractive bool   `json:"is_interactive"`
				GameID        int    `json:"game_id"`
				ContentType   int    `json:"content_type"`
			} `json:"topics"`
			User struct {
				UID           string `json:"uid"`
				Nickname      string `json:"nickname"`
				Introduce     string `json:"introduce"`
				Avatar        string `json:"avatar"`
				Gender        int    `json:"gender"`
				Certification struct {
					Type  int    `json:"type"`
					Label string `json:"label"`
				} `json:"certification"`
				LevelExp struct {
					Level int `json:"level"`
					Exp   int `json:"exp"`
				} `json:"level_exp"`
				IsFollowing bool   `json:"is_following"`
				IsFollowed  bool   `json:"is_followed"`
				AvatarURL   string `json:"avatar_url"`
				Pendant     string `json:"pendant"`
			} `json:"user"`
			SelfOperation struct {
				Attitude    int  `json:"attitude"`
				IsCollected bool `json:"is_collected"`
			} `json:"self_operation"`
			Stat struct {
				ViewNum     int `json:"view_num"`
				ReplyNum    int `json:"reply_num"`
				LikeNum     int `json:"like_num"`
				BookmarkNum int `json:"bookmark_num"`
				ForwardNum  int `json:"forward_num"`
			} `json:"stat"`
			HelpSys struct {
				TopUp     interface{}   `json:"top_up"`
				TopN      []interface{} `json:"top_n"`
				AnswerNum int           `json:"answer_num"`
			} `json:"help_sys"`
			Cover struct {
				URL            string      `json:"url"`
				Height         int         `json:"height"`
				Width          int         `json:"width"`
				Format         string      `json:"format"`
				Size           string      `json:"size"`
				Crop           interface{} `json:"crop"`
				IsUserSetCover bool        `json:"is_user_set_cover"`
				ImageID        string      `json:"image_id"`
				EntityType     string      `json:"entity_type"`
				EntityID       string      `json:"entity_id"`
			} `json:"cover"`
			ImageList []struct {
				URL            string      `json:"url"`
				Height         int         `json:"height"`
				Width          int         `json:"width"`
				Format         string      `json:"format"`
				Size           string      `json:"size"`
				Crop           interface{} `json:"crop"`
				IsUserSetCover bool        `json:"is_user_set_cover"`
				ImageID        string      `json:"image_id"`
				EntityType     string      `json:"entity_type"`
				EntityID       string      `json:"entity_id"`
			} `json:"image_list"`
			IsOfficialMaster bool          `json:"is_official_master"`
			IsUserMaster     bool          `json:"is_user_master"`
			HotReplyExist    bool          `json:"hot_reply_exist"`
			VoteCount        int           `json:"vote_count"`
			LastModifyTime   int           `json:"last_modify_time"`
			RecommendType    string        `json:"recommend_type"`
			Collection       interface{}   `json:"collection"`
			VodList          []interface{} `json:"vod_list"`
			IsBlockOn        bool          `json:"is_block_on"`
			ForumRankInfo    interface{}   `json:"forum_rank_info"`
			LinkCardList     []interface{} `json:"link_card_list"`
		} `json:"list"`
		LastID   string `json:"last_id"`
		IsLast   bool   `json:"is_last"`
		IsOrigin bool   `json:"is_origin"`
	} `json:"data"`
}

米游社随机cos

type Params

type Params struct {
	Bot  *tgbotapi.BotAPI
	Conf config.Config
}

func (*Params) Y2mateByCom

func (params *Params) Y2mateByCom(writer http.ResponseWriter, request *http.Request)

y2mate.com

func (*Params) YoutubeSearch

func (params *Params) YoutubeSearch(query string, inlineType string) ([]interface{}, error)

Elysia music♪

type YoudaoTranslation

type YoudaoTranslation struct {
	ErrorCode       int `json:"errorCode"`
	TranslateResult [][]struct {
		Tgt string `json:"tgt"`
		Src string `json:"src"`
	} `json:"translateResult"`
	Type        string `json:"type"`
	SmartResult struct {
		Entries []string `json:"entries"`
		Type    int      `json:"type"`
	} `json:"smartResult"`
}

Jump to

Keyboard shortcuts

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