|
@@ -7,6 +7,7 @@ import (
|
|
|
"cr-svc/log"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
+ "time"
|
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
"go.mongodb.org/mongo-driver/bson"
|
|
@@ -27,6 +28,7 @@ func GetVersion(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
Page: page,
|
|
|
Size: size,
|
|
|
Query: query,
|
|
|
+ Sort: bson.M{"createTime": -1},
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
@@ -69,6 +71,7 @@ func UpdateVersion(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if version.Id.IsZero() {
|
|
|
return nil, errors.New("id错误")
|
|
|
}
|
|
|
+ version.UpdateTime = time.Now()
|
|
|
return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionVersions, version.Id.Hex(), &version)
|
|
|
}
|
|
|
|