7
0

delete sign value

This commit is contained in:
liangzy 2020-08-06 18:35:41 +08:00
parent b411002b7d
commit d09a6833e6

View File

@ -64,6 +64,18 @@ func init() {
}) })
} }
``` ```
服务端处理响应体为以下结构的json字符流, `code`,`status`,`msg` 这三个字段*最好*要包含且数字类型要一致 , `data` 部分为业务内容,自行定义
```json
{
"code": 1001,
"msg": "不能为空",
"status": false,
"data": {
...
}
}
```
### 4.sdk编写 ### 4.sdk编写
@ -72,6 +84,12 @@ func init() {
```go ```go
import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk" import "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk"
const (
HOST = "jedi" // 如果非全域名会自动补全.gaore.com , 如jedi 会自动补全jedi.goare.com, 也可以打全域名 test.uu89.com
VERSION = "2020-08-04"
)
type Client struct { type Client struct {
sdk.Client sdk.Client
} }
@ -119,6 +137,7 @@ import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
) )
// 定义请求体
type DemoTestRequest struct { type DemoTestRequest struct {
*requests.RpcRequest *requests.RpcRequest
Param1 string `position:"Query" field:"param_1" default:"" ` Param1 string `position:"Query" field:"param_1" default:"" `
@ -128,11 +147,15 @@ type DemoTestRequest struct {
func CreateDemoTestRequest() (req *DemoTestRequest) { func CreateDemoTestRequest() (req *DemoTestRequest) {
req = &DemoTestRequest{RpcRequest: &requests.RpcRequest{}} req = &DemoTestRequest{RpcRequest: &requests.RpcRequest{}}
// InitWithApiInfo 初始化请求,有三个参数,域名,版本,和路径
// 域名参数如果非全域名会自动补全.gaore.com , 如jedi 会自动补全jedi.goare.com, 也可以打全域名 test.uu89.com
req.InitWithApiInfo(HOST, VERSION, "/api/sms/Index") req.InitWithApiInfo(HOST, VERSION, "/api/sms/Index")
// 定义 请求方法 POST 或 GET
req.Method = requests.GET req.Method = requests.GET
return return
} }
// 定义响应体
type DemoTestResponse struct { type DemoTestResponse struct {
*responses.BaseResponse *responses.BaseResponse
Data DemoTestResponseData `json:"data"` Data DemoTestResponseData `json:"data"`