更新SSO请求地址
This commit is contained in:
parent
1bd1a66cfe
commit
58afabebe9
16
README.md
16
README.md
@ -15,11 +15,11 @@
|
||||
```
|
||||
### 2.引入
|
||||
```go
|
||||
go get -u golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk
|
||||
go get -u golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk
|
||||
```
|
||||
或 Go Module
|
||||
```go
|
||||
import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
import "golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
```
|
||||
|
||||
### 3.服务端认证及返回处理
|
||||
@ -34,9 +34,9 @@ package applications
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/context"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/signers"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/signers"
|
||||
"golib.gaore.com/GaoreGo/grlogs"
|
||||
)
|
||||
|
||||
@ -81,7 +81,7 @@ func init() {
|
||||
在`services`目录下以服务归类新建文件夹, 如`jedi`为短信服务,以 `RpcRequest` 和 `BaseResponse` 以基类写好请求子类和响应子类。一个请求接口对应一对请求和响应类。
|
||||
|
||||
```go
|
||||
import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
import "golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
|
||||
const (
|
||||
HOST = "jedi" // 如果非全域名会自动补全.gaore.com , 如jedi 会自动补全jedi.goare.com, 也可以打全域名 test.uu89.com
|
||||
@ -132,8 +132,8 @@ GET param_1=111¶m_2=10086¶m_3=false
|
||||
package jedi
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
// 定义请求体
|
||||
|
@ -1,6 +1,6 @@
|
||||
package auth
|
||||
|
||||
import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
import "golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
|
||||
var debug utils.Debug
|
||||
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -2,10 +2,10 @@ package auth
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/signers"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/signers"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha1"
|
||||
"encoding/base64"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
)
|
||||
|
||||
type AccessKeySigner struct {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
)
|
||||
|
||||
type AliAppcodeSigner struct {
|
||||
|
@ -3,7 +3,7 @@ package signers
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
)
|
||||
|
||||
type StsTokenSigner struct {
|
||||
|
@ -5,11 +5,11 @@ import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/auth/credentials"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
@ -24,7 +24,7 @@ import (
|
||||
var Version = "0.0.1"
|
||||
var defaultConnectTimeout = 5 * time.Second
|
||||
var defaultReadTimeout = 10 * time.Second
|
||||
var defaultDomain = ".gaore.com"
|
||||
var defaultDomain = ".gaore.com.hk"
|
||||
var DefaultUserAgent = fmt.Sprintf("GaoreGoSdk (%s;%s) Golang/%s Core/%s", runtime.GOOS, runtime.GOARCH, strings.Trim(runtime.Version(), "go"), Version)
|
||||
|
||||
var debug utils.Debug
|
||||
|
@ -1,7 +1,7 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
@ -3,7 +3,7 @@ package requests
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"io"
|
||||
"math/cmplx"
|
||||
"reflect"
|
||||
@ -236,7 +236,7 @@ func defaultBaseRequest() (request *baseRequest) {
|
||||
Method: GET,
|
||||
QueryParams: make(map[string]string),
|
||||
Headers: map[string]string{
|
||||
"Gr-Sdk-Client": "golang/1.14",
|
||||
"Gr-Sdk-Client": "golang/1.19.4",
|
||||
"Gr-Sdk-Invoke-Type": "normal",
|
||||
"Accept-Encoding": Json,
|
||||
},
|
||||
|
@ -2,7 +2,7 @@ package requests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/utils"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/utils"
|
||||
"io"
|
||||
"strings"
|
||||
)
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package apk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type AddApkRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package apk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type AddTopRequest struct {
|
||||
|
@ -2,8 +2,8 @@ package apk
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package apk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type RefreshApkRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package apk
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package callback
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package callback
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
const OS_ANDROID = 2
|
||||
|
@ -4,7 +4,7 @@
|
||||
```go
|
||||
import (
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/services/jedi"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/services/jedi"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package jedi
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package jedi
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type SendSmsRequest struct {
|
||||
|
@ -3,8 +3,8 @@ package mail
|
||||
import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mail
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type PostEmailRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mkt
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package mkt
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
// PkgNoticeRequest 打包通知请求信息
|
||||
|
@ -1,8 +1,8 @@
|
||||
package sso
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -11,6 +11,18 @@ const (
|
||||
|
||||
var HOST = requests.Host{
|
||||
Default: "sso",
|
||||
Func: func(s string) string {
|
||||
host := map[string]string{
|
||||
requests.RELEASE: "sso.gaore.com.hk",
|
||||
requests.PRE: "sso.gaore.com",
|
||||
requests.TEST: "sso.gaore.com",
|
||||
}
|
||||
if s, ok := host[s]; ok {
|
||||
return s
|
||||
} else {
|
||||
return "sso.gaore.com.hk"
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package sso
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type CodeAuthRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package sso
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type GetUserInfoRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package sso
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type RefreshTokenRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package sso
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type SearchUserRequest struct {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package www
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -1,8 +1,8 @@
|
||||
package www
|
||||
|
||||
import (
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/requests"
|
||||
"golib.gaore.com/GaoreGo/haiwai-common-sdk-go/sdk/responses"
|
||||
)
|
||||
|
||||
type GetPwdRequest struct {
|
||||
|
Loading…
Reference in New Issue
Block a user