xyh

package module
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 9 Imported by: 0

README

校园号SDK

image

Check out XYH Open API document at: https://work.xiaoyuanhao.com/

使用

Fetch the SDK

go get -v -u gitee.com/suguo79/xyh

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpRequest

func HttpRequest(path string, params url.Values, requestData interface{}) (*[]byte, error)

http request,带凭证

func HttpRequestWithoutHeader added in v0.2.3

func HttpRequestWithoutHeader(path string, params url.Values, requestData interface{}) (*[]byte, error)

HTTP请求无header,token在URL中附带

func Init

func Init(config *Config)

初始配置

func RefreshAccessToken

func RefreshAccessToken() (*string, error)

获取 access_token

Types

type AccessToken

type AccessToken struct {
	Common
	Data struct {
		AccessToken  string `json:"accessToken"`
		ExpiresIn    int    `json:"expiresIn"`
		RefreshToken string `json:"refreshToken"`
		TokenType    string `json:"tokenType"`
	} `json:"data"`
}

type Common

type Common struct {
	Code      int    `json:"code"`
	Msg       string `json:"msg"`
	Tip       string `json:"tip"`
	RequestID string `json:"requestId"`
}

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	BaseURL      string
}
var (
	Conf *Config
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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