Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

函数调用 出现错误 (a *Agent) FileStat 每次只能返回一个null #8

Closed
user1121114685 opened this issue May 15, 2022 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@user1121114685
Copy link
Contributor

最后追踪再(c *Client) CallJsonApi上decoder := json.NewDecoder(body)出现问题,应该是body有问题.但是我并未找到问题所在,还望大佬指点一下!

@user1121114685
Copy link
Contributor Author

a *Agent) DirSetOrder 这个函数也无法使用,返回了错误

@deadblue deadblue added the bug Something isn't working label May 16, 2022
@deadblue deadblue self-assigned this May 16, 2022
@deadblue
Copy link
Owner

DirSetOrder 的问题已经在 develop 分支修复。

FileStat 由于响应报文里没有 state 字段,因此当作 state = false 来处理了,正在修复。

@deadblue
Copy link
Owner

FileStat的问题已在 develop 分支修复,将包含在下个 release 版本中。

@user1121114685
Copy link
Contributor Author

DirSetOrder 没有工作,只是不报错了。。。。

@deadblue
Copy link
Owner

@user1121114685 我这边没问题,测试代码:

agent := makeTestAgent()
dirId := ""

// Order files by time in DESC
t.Logf("Order files by time in descending ...")
if err := agent.DirSetOrder(dirId, DirOrderByTime, false); err != nil {
	t.Fatal(err)
}
for cursor := new(FileCursor); cursor.HasMore(); {
	files := make([]*File, 10)
	n, err := agent.FileList(dirId, cursor, files)
	if err != nil || n == 0 {
		break
	}
	for i := 0; i < n; i++ {
		t.Logf("File => %#v", files[i])
	}
}

// Order files by name in ASC
t.Logf("Order files by name in ascending ...")
if err := agent.DirSetOrder(dirId, DirOrderByName, true); err != nil {
	t.Fatal(err)
}
for cursor := new(FileCursor); cursor.HasMore(); {
	files := make([]*File, 10)
	n, err := agent.FileList(dirId, cursor, files)
	if err != nil || n == 0 {
		break
	}
	for i := 0; i < n; i++ {
		t.Logf("File => %#v", files[i])
	}
}

@user1121114685
Copy link
Contributor Author

@user1121114685 我这边没问题,测试代码:

agent := makeTestAgent()
dirId := ""

// Order files by time in DESC
t.Logf("Order files by time in descending ...")
if err := agent.DirSetOrder(dirId, DirOrderByTime, false); err != nil {
	t.Fatal(err)
}
for cursor := new(FileCursor); cursor.HasMore(); {
	files := make([]*File, 10)
	n, err := agent.FileList(dirId, cursor, files)
	if err != nil || n == 0 {
		break
	}
	for i := 0; i < n; i++ {
		t.Logf("File => %#v", files[i])
	}
}

// Order files by name in ASC
t.Logf("Order files by name in ascending ...")
if err := agent.DirSetOrder(dirId, DirOrderByName, true); err != nil {
	t.Fatal(err)
}
for cursor := new(FileCursor); cursor.HasMore(); {
	files := make([]*File, 10)
	n, err := agent.FileList(dirId, cursor, files)
	if err != nil || n == 0 {
		break
	}
	for i := 0; i < n; i++ {
		t.Logf("File => %#v", files[i])
	}
}

辛苦了,经过我测试确实没有问题。给大佬造成误解了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants