Browse Source

添加打包任务sdk

tags/v1.1.12
liaokaishan 2 years ago
parent
commit
4da114e97b
3 changed files with 84 additions and 4 deletions
  1. +8
    -0
      services/apk/client.go
  2. +5
    -4
      services/apk/client_test.go
  3. +71
    -0
      services/apk/search_apk.go

+ 8
- 0
services/apk/client.go View File

@@ -56,3 +56,11 @@ func (c *Client) RefreshApkR(req *RefreshApkRequest) (response *RefreshApkRespon
err = c.DoAction(req, response)
return
}

//获取打包日志
func (c *Client) SearchApk(req *SearchApkRequest) (response *SearchApkResponse, err error) {
response = CreateSearchApkResponse()

err = c.DoAction(req, response)
return
}

+ 5
- 4
services/apk/client_test.go View File

@@ -8,13 +8,14 @@ import (

func TestClient_GetUserInfo(t *testing.T) {
c := NewClient()
req := CreateRefreshApkRequest()
req.CdnUrlArray = []string{"https://download.abc086.com/lyzzflb_ylh_ez1/lyzzflb_ylh_ez1_490809.apk"}
req := CreateSearchApkRequest()
req.GameIds = "3503"
req.Ver = "1.0.0"
req.SetReadTimeout(60 * time.Second)
resp, err := c.RefreshApkR(req)
resp, err := c.SearchApk(req)

fmt.Println(req)
fmt.Println(resp)
fmt.Println(resp.GetHttpContentString())
fmt.Println(err)

}

+ 71
- 0
services/apk/search_apk.go View File

@@ -0,0 +1,71 @@
package apk

import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
"time"
)

type SearchApkRequest struct {
*requests.RpcRequest
StartTime string `position:"Body" field:"startTime" default:"" `
EndTime string `position:"Body" field:"endTime" default:"" `
State string `position:"Body" field:"state" default:"" `
SiteIds string `position:"Body" field:"siteIds" default:"" `
Ver string `position:"Body" field:"ver" default:"" `
SiteId int `position:"Body" field:"siteId" default:"" `
GameIds string `position:"Body" field:"gameIds" default:"" `
Autor string `position:"Body" field:"autor" default:"" `
Page int `position:"Body" field:"page" default:"1" `
Pagesize int `position:"Body" field:"pagesize" default:"20" `
Order string `position:"Body" field:"order" default:"" `
}

type ApkLog struct {
ID int `json:"Id"`
GameID int `json:"GameId"`
GameName string `json:"GameName"`
Ver string `json:"Ver"`
Top int `json:"Top"`
AgentID int `json:"AgentId"`
SiteID int `json:"SiteId"`
Addtime time.Time `json:"Addtime"`
Edittime time.Time `json:"Edittime"`
State int `json:"State"`
Times int `json:"Times"`
ReleaseTime int `json:"ReleaseTime"`
Env int `json:"Env"`
AliOss int `json:"AliOss"`
NeedCdn bool `json:"NeedCdn"`
Autor string `json:"Autor"`
IsAugment bool `json:"IsAugment"`
}

type SearchApkResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Status bool `json:"status"`
Msg string `json:"msg"`
Data struct {
Page int `json:"Page"`
PageSize int `json:"PageSize"`
Total int `json:"Total"`
List []ApkLog `json:"List"`
} `json:"data"`
}

func CreateSearchApkRequest() (req *SearchApkRequest) {
req = &SearchApkRequest{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/apk/list")
req.Method = requests.POST
return
}

func CreateSearchApkResponse() (response *SearchApkResponse) {
response = &SearchApkResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}

Loading…
Cancel
Save