7
0

新增apk配置相关接口

This commit is contained in:
余 欣怀 2024-11-07 15:50:45 +08:00
parent e89f227e54
commit 721b735a0e
4 changed files with 100 additions and 0 deletions

View File

@ -28,3 +28,15 @@ func (c *Client) TaskCreate(req *TaskCreateRequest) (resp *TaskCreateResponse, e
err = c.DoAction(req, resp)
return
}
func (c *Client) ConfigModify(req *ConfigModifyRequest) (resp *ConfigModifyResponse, err error) {
resp = CreateConfigModifyResponse()
err = c.DoAction(req, resp)
return
}
func (c *Client) ConfigGet(req *ConfigGetRequest) (resp *ConfigGetResponse, err error) {
resp = CreateConfigGetResponse()
err = c.DoAction(req, resp)
return
}

View File

@ -16,3 +16,24 @@ func TestTask_Create(t *testing.T) {
resp, err := client.TaskCreate(req)
t.Logf("%v", resp.Data.TaskId)
}
func TestConfig_Modify(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Fatal(err)
}
req := CreateConfigModifyRequest()
req.Content = []byte(`<?xml version='1.0' encoding='UTF-8'?><xml><apks><!-- name母包文件名 --><!-- screen屏幕方向 0竖屏 1横屏 --><!-- targetSdktargetSdkVersion支持30以上 0否 1是 --><apk><param name="id" value="1" /><param name="name" value="heji" /><param name="desc" value="合击" /><param name="screen" value="1" /><param name="targetSdk" value="0" /></apk><apk><param name="id" value="2" /><param name="name" value="lanyue" /><param name="desc" value="蓝月" /><param name="screen" value="1" /><param name="targetSdk" value="0" /></apk></apks></xmls>`)
resp, err := client.ConfigModify(req)
t.Log(resp.Code, resp.Msg)
}
func TestConfig_Get(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Fatal(err)
}
req := CreateConfigGetRequest()
resp, err := client.ConfigGet(req)
t.Log(resp.Code, resp.Data)
}

View File

@ -0,0 +1,34 @@
package capk
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type ConfigGetRequest struct {
*requests.JsonRequest
}
type ConfigGetResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data string `json:"data"`
}
func CreateConfigGetRequest() *ConfigGetRequest {
req := &ConfigGetRequest{
JsonRequest: &requests.JsonRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/pack/config/get")
req.Method = requests.GET
return req
}
func CreateConfigGetResponse() *ConfigGetResponse {
return &ConfigGetResponse{
BaseResponse: &responses.BaseResponse{},
}
}

View File

@ -0,0 +1,33 @@
package capk
import (
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type ConfigModifyRequest struct {
*requests.StreamRequest
}
type ConfigModifyResponse struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data string `json:"data"`
}
func CreateConfigModifyRequest() (req *ConfigModifyRequest) {
req = &ConfigModifyRequest{
StreamRequest: &requests.StreamRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/pack/config/set")
req.Method = requests.POST
return
}
func CreateConfigModifyResponse() (resp *ConfigModifyResponse) {
return &ConfigModifyResponse{
BaseResponse: &responses.BaseResponse{},
}
}