|
@@ -8,6 +8,7 @@ import (
|
|
|
"net/http"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
+ "go.mongodb.org/mongo-driver/bson"
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
)
|
|
|
|
|
@@ -32,6 +33,7 @@ func VersionLatest(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
version := &model.Versions{}
|
|
|
ok, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
|
|
|
CollectName: repo.CollectionVersions,
|
|
|
+ Sort: bson.M{"createTime": -1},
|
|
|
}, version)
|
|
|
if !ok || err != nil {
|
|
|
return nil, errors.New("未找到数据")
|