修改dialogueData spaceid和dentryid
This commit is contained in:
parent
97758fb1c8
commit
43630729be
@ -16,6 +16,11 @@ import (
|
||||
"github.com/alibabacloud-go/tea/tea"
|
||||
)
|
||||
|
||||
const (
|
||||
DIA_SPACEID = "28879119988"
|
||||
DIA_DENTRYID = "221784566389"
|
||||
)
|
||||
|
||||
func CreateSpace() (_err error) {
|
||||
client, _err := CreateStorageClientV1()
|
||||
if _err != nil {
|
||||
@ -150,7 +155,7 @@ func GetMaxFileVersion(version int, nextToken string) int {
|
||||
MaxResults: tea.Int32(30),
|
||||
UnionId: tea.String(UNIONID),
|
||||
}
|
||||
resp, _err := client.ListDentryVersionsWithOptions(tea.String("28057154815"), tea.String("206700372014"), listDentryVersionsRequest, listDentryVersionsHeaders, &util.RuntimeOptions{})
|
||||
resp, _err := client.ListDentryVersionsWithOptions(tea.String(DIA_SPACEID), tea.String(DIA_DENTRYID), listDentryVersionsRequest, listDentryVersionsHeaders, &util.RuntimeOptions{})
|
||||
if resp.Body.Dentries != nil {
|
||||
return int(*resp.Body.Dentries[0].Version)
|
||||
}
|
||||
@ -169,7 +174,7 @@ func GetFileInfo() error {
|
||||
listDentriesHeaders := &dingtalkstorage_1_0.ListDentriesHeaders{}
|
||||
listDentriesHeaders.XAcsDingtalkAccessToken = tea.String(token)
|
||||
listDentriesRequest := &dingtalkstorage_1_0.ListDentriesRequest{
|
||||
ParentId: tea.String("0"),
|
||||
ParentId: tea.String("221787406507"),
|
||||
NextToken: tea.String(""),
|
||||
MaxResults: tea.Int32(30),
|
||||
OrderBy: tea.String("MODIFIED_TIME"),
|
||||
@ -177,7 +182,7 @@ func GetFileInfo() error {
|
||||
WithThumbnail: tea.Bool(false),
|
||||
UnionId: tea.String(UNIONID),
|
||||
}
|
||||
resp, _err := client.ListDentriesWithOptions(tea.String("28057154815"), listDentriesRequest, listDentriesHeaders, &util.RuntimeOptions{})
|
||||
resp, _err := client.ListDentriesWithOptions(tea.String(DIA_SPACEID), listDentriesRequest, listDentriesHeaders, &util.RuntimeOptions{})
|
||||
fmt.Println(resp)
|
||||
return _err
|
||||
}
|
||||
@ -202,7 +207,7 @@ func DownloadFile() error {
|
||||
UnionId: tea.String("YWjeT8Ltk2mUOP82QyMe0AiEiE"),
|
||||
Option: option,
|
||||
}
|
||||
resp, _err := client.GetFileDownloadInfoWithOptions(tea.String("28057154815"), tea.String("206700372014"), getFileDownloadInfoRequest, getFileDownloadInfoHeaders, &util.RuntimeOptions{})
|
||||
resp, _err := client.GetFileDownloadInfoWithOptions(tea.String(DIA_SPACEID), tea.String(DIA_DENTRYID), getFileDownloadInfoRequest, getFileDownloadInfoHeaders, &util.RuntimeOptions{})
|
||||
responseBody := resp.Body
|
||||
downloadUrl := responseBody.HeaderSignatureInfo.ResourceUrls[0]
|
||||
header := map[string]string{
|
||||
|
||||
23
middleware/alibaba/space_test.go
Normal file
23
middleware/alibaba/space_test.go
Normal file
@ -0,0 +1,23 @@
|
||||
package alibaba
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetFileInfo(t *testing.T) {
|
||||
if err := GetFileInfo(); err != nil {
|
||||
t.Fatalf("GetFileInfo failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSearchSpaceId(t *testing.T) {
|
||||
if err := SearchSpaceId(); err != nil {
|
||||
t.Fatalf("SearchSpaceId failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDownloadFile(t *testing.T) {
|
||||
if err := DownloadFile(); err != nil {
|
||||
t.Fatalf("DownloadFile failed: %v", err)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user