openapi

package
v0.0.0-...-7540414 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS_CODE = "200"
	ERROR_CODE   = "-1"
)
View Source
const (
	API_URL = "http://www.tuling123.com/openapi/api"
)

Variables

This section is empty.

Functions

func QueryByMoli

func QueryByMoli(msg string) string

func QueryFromYoudaoAsString

func QueryFromYoudaoAsString(msg string) string

func SetBaiduKey

func SetBaiduKey(key string)

func SetGaodekey

func SetGaodekey(key ...string)

Types

type GeoLocation

type GeoLocation struct {
	Lat string //纬度 `json:"lat,float32"`
	Lng string //经度 `json:"lng,float32"`
}

func (*GeoLocation) UnmarshalJSON

func (this *GeoLocation) UnmarshalJSON(data []byte) error

type LocationQueryResponse

type LocationQueryResponse struct {
	Status  string           `json:"status"`
	Message string           `json:"message"`
	Result  []locationResult `json:"result"`
}

func QueryLocationTips

func QueryLocationTips(city, citycode, input string) *LocationQueryResponse

type TulingItem

type TulingItem struct {
	Name    string `json:"name"`      //菜名
	Info    string `json:"info"`      //菜谱信息
	Icon    string `json:"icon"`      //信息图标
	Url     string `json:"detailurl"` //详情链接
	Article string `json:"article"`   //文章标题
	Source  string `json:"source"`    //来源
}

type TulingRequest

type TulingRequest struct {
	Key  string `json:"key"`
	Text string `json:"info"`
	Loc  string `json:"loc"`
	User string `json:"userid"`
}

type TulingRespone

type TulingRespone struct {
	Code int64        `json:"code"`
	Text string       `json:"text"`
	URL  string       `json:"url"`
	List []TulingItem `json:"list"`
}

*

100000 文本类 200000 链接类 有url 302000 新闻类 有list 308000 菜谱类

type TulingSDK

type TulingSDK struct {
	Key string
}

func (*TulingSDK) Query

func (this *TulingSDK) Query(user, text string) TulingRespone

func (*TulingSDK) QueryAsString

func (this *TulingSDK) QueryAsString(user, text string) string

type YoudaoResponse

type YoudaoResponse struct {
	Translation []string  `json:"translation"` //翻译内容
	Basic       basicDict `json:"basic"`       //基础词典
	Query       string    `json:"query"`       //查询的词
	Code        int       `json:"errorCode"`   //错误码 0 -代表成功
	WebItems    []webItem `json:"web"`         //网络词条

}

func QueryFromYoudao

func QueryFromYoudao(msg string) *YoudaoResponse

type Youfen

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

func (*Youfen) Call

func (this *Youfen) Call(url string, paramters string) string

func (*Youfen) Init

func (this *Youfen) Init(account string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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