-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.go
77 lines (64 loc) · 2.56 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package huawei
import (
"net/http"
)
var HuaweiAppIdMap = map[string]string{
"com.gengcon.android.jxc": "100582595",
"com.niimbot.cxprinter": "103954035",
"com.gengcon.android.jccloudprinter": "100455843",
"com.android.jckdcs": "101277937",
"com.android.jcycgj": "100895813",
"com.gengcon.android.fixedassets": "100408187",
}
// 查询应用包名对应的appid https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-appid-list-0000001111845086
func (c *HuaweiClient) GetAppId(params *GetAppIdParams) (*GetAppIdRes, *http.Response, error) {
req, err := c.NewRequest(http.MethodGet, "/api/publish/v2/appid-list", params, nil)
if err != nil {
return nil, nil, err
}
var appIdRes *GetAppIdRes
resp, err := c.Do(req, &appIdRes)
if err != nil {
return nil, resp, err
}
return appIdRes, resp, err
}
// 查询应用信息 https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-app-info-query-0000001158365045
func (c *HuaweiClient) GetAppDetail(params *GetAppDetailParams) (*AppDetailRes, *http.Response, error) {
req, err := c.NewRequest(http.MethodGet, "/api/publish/v2/app-info", params, nil)
if err != nil {
return nil, nil, err
}
var appDetail *AppDetailRes
resp, err := c.Do(req, &appDetail)
if err != nil {
return nil, resp, err
}
return appDetail, resp, err
}
// 通过下载方式提交发布 https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-app-submit-with-file-0000001111845092
func (c *HuaweiClient) SubmitWithDownload(query *AppIdParams, params *SubmitWithDownloadParams) (*SubmitWithDownloadRes, *http.Response, error) {
req, err := c.NewRequest(http.MethodPost, "/api/publish/v2/app-submit-with-file", query, params)
if err != nil {
return nil, nil, err
}
var submitWithDownloadRes *SubmitWithDownloadRes
resp, err := c.Do(req, &submitWithDownloadRes)
if err != nil {
return nil, resp, err
}
return submitWithDownloadRes, resp, err
}
// 更新语言描述信息 https://developer.huawei.com/consumer/cn/doc/development/AppGallery-connect-References/agcapi-language-info-update-0000001158245057
func (c *HuaweiClient) UpdateLangDescription(quey *AppIdParams, params *UpdateLangDescriptionParams) (*Ret, *http.Response, error) {
req, err := c.NewRequest(http.MethodPut, "/api/publish/v2/app-language-info", quey, params)
if err != nil {
return nil, nil, err
}
var ret *Ret
resp, err := c.Do(req, &ret)
if err != nil {
return nil, resp, err
}
return ret, resp, err
}