weibo

package
v0.0.0-...-d2c9018 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthWb

type AuthWb struct {
	Config *oauth.AuthConfig
	oauth.AuthOauthURL
}

微博授权登录

func NewAuthWb

func NewAuthWb(conf *oauth.AuthConfig) *AuthWb

func (*AuthWb) GetAccessToken

func (a *AuthWb) GetAccessToken(code string) (resp *TokenResult, err error)

获取token

func (*AuthWb) GetAuthorizeUrl

func (a *AuthWb) GetAuthorizeUrl(state string) string

获取登录地址

func (*AuthWb) GetName

func (a *AuthWb) GetName() string

func (*AuthWb) GetUserInfo

func (a *AuthWb) GetUserInfo(accessToken string, openId string) (resp *UserResult, err error)

获取第三方用户信息

func (*AuthWb) GetUserOpenInfo

func (a *AuthWb) GetUserOpenInfo(code string) (resp *oauth.UserResult, err error)

获取用户信息

type Status

type Status struct {
	CreatedAt           string        `json:"created_at" example:"Tue May 24 18:04:53 +0800 2011"`
	Id                  int64         `json:"id" example:"11142488790"`
	Text                string        `json:"text" example:"我的相机到了。"`
	Source              string        `json:"source" example:"<a href='http://weibo.com' rel='nofollow'>新浪微博</a>"`
	Favorited           bool          `json:"favorited" example:"false"`
	Truncated           bool          `json:"truncated" example:"false"`
	InReplyToStatusId   string        `json:"in_reply_to_status_id" example:""`
	InReplyToUserId     string        `json:"in_reply_to_user_id" example:""`
	InReplyToScreenName string        `json:"in_reply_to_screen_name" example:""`
	Geo                 interface{}   `json:"geo" example:"null"`
	MId                 string        `json:"mid" example:"5610221544300749636"`
	Annotations         []interface{} `json:"annotations" example:"[]"`
	RepostsCount        int           `json:"reposts_count" example:"5"`
	CommentsCount       int           `json:"comments_count" example:"8"`
}

type TokenResult

type TokenResult struct {
	AccessToken string `json:"access_token" example:"2.00OYpWYGPTpttCaf929b916cL6FMXD"` //访问令牌
	RemindIn    string `json:"remind_in" example:"157679999"`                           //过期时间
	ExpiresIn   int    `json:"expires_in" example:"157679999"`                          //过期时间
	Uid         string `json:"uid" example:"6007017078"`                                //用户ID
	IsRealName  string `json:"isRealName" example:"true"`                               //是否实名认证
}

微博token返回结果

type UserResult

type UserResult struct {
	Id               int64  `json:"id" example:"1404376560"`
	ScreenName       string `json:"screen_name" example:"zaku"`
	Name             string `json:"name" example:"zaku"`
	Province         string `json:"province" example:"11"`
	City             string `json:"city" example:"5"`
	Location         string `json:"location" example:"北京 朝阳区"`
	Description      string `json:"description" example:"人生五十年,乃如梦如幻;有生斯有死,壮士复何憾。"`
	URL              string `json:"url" example:"http://blog.sina.com.cn/zaku"`
	ProfileImageURL  string `json:"profile_image_url" example:"http://tp1.sinaimg.cn/1404376560/50/0/1"`
	Domain           string `json:"domain" example:"zaku"`
	Gender           string `json:"gender" example:"m"`
	FollowersCount   int    `json:"followers_count" example:"1204"`
	FriendsCount     int    `json:"friends_count" example:"447"`
	StatusesCount    int    `json:"statuses_count" example:"2908"`
	FavouritesCount  int    `json:"favourites_count" example:"0"`
	CreatedAt        string `json:"created_at" example:"Fri Aug 28 00:00:00 +0800 2009"`
	Following        bool   `json:"following" example:"false"`
	AllowAllActMsg   bool   `json:"allow_all_act_msg" example:"false"`
	GeoEnabled       bool   `json:"geo_enabled" example:"true"`
	Verified         bool   `json:"verified" example:"false"`
	Status           Status `json:"status"`
	AllowAllComment  bool   `json:"allow_all_comment" example:"true"`
	AvatarLarge      string `json:"avatar_large" example:"http://tp1.sinaimg.cn/1404376560/180/0/1"`
	VerifiedReason   string `json:"verified_reason" example:""`
	FollowMe         bool   `json:"follow_me" example:"false"`
	OnlineStatus     int    `json:"online_status" example:"0"`
	BiFollowersCount int    `json:"bi_followers_count" example:"215"`
}

Jump to

Keyboard shortcuts

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