更新SSO请求地址

This commit is contained in:
余 欣怀 2023-02-21 20:58:53 +08:00
parent 1bd1a66cfe
commit 58afabebe9
35 changed files with 86 additions and 74 deletions

View File

@ -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&param_2=10086&param_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"
)
// 定义请求体

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
)

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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

View File

@ -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"
)

View File

@ -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,
},

View File

@ -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"
)

View File

@ -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"

View File

@ -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 {

View File

@ -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 {

View File

@ -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 (

View File

@ -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 {

View File

@ -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"
)

View File

@ -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 (

View File

@ -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

View File

@ -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() {

View File

@ -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"
)

View File

@ -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 {

View File

@ -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"
)

View File

@ -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 {

View File

@ -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 (

View File

@ -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 打包通知请求信息

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 (

View File

@ -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 {