Giter Site home page Giter Site logo

Comments (6)

user1121114685 avatar user1121114685 commented on June 26, 2024

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

from elevengo.

deadblue avatar deadblue commented on June 26, 2024

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

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

from elevengo.

deadblue avatar deadblue commented on June 26, 2024

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

from elevengo.

user1121114685 avatar user1121114685 commented on June 26, 2024

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

from elevengo.

deadblue avatar deadblue commented on June 26, 2024

@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])
	}
}

from elevengo.

user1121114685 avatar user1121114685 commented on June 26, 2024

@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])
	}
}

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

from elevengo.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.