Browse Source

Merge pull request '修复查询etl记录的bug' (#3) from fix_record into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_ETL/pulls/3
pull/5/head
weichenglei 3 years ago
parent
commit
648023ebf2
2 changed files with 7 additions and 7 deletions
  1. +1
    -1
      dao/etl/implments/record.dao.impl.go
  2. +6
    -6
      web/controllers/etl/Record.rest.go

+ 1
- 1
dao/etl/implments/record.dao.impl.go View File

@ -103,7 +103,7 @@ func (impl *RecordDaoImplement) Select(collectionName string, stage, status, sta
cursor, err := impl.client.Database(config.AppConfig.Mongo.LogDB).Collection(collectionName).Find(context.TODO(), condition, &options.FindOptions{
Skip: &skip,
Limit: &limit,
Sort: bson.D{{"timestamp", -1}},
Sort: bson.D{{"time", -1}},
})
if err != nil {
return grmi.EmptyPagingResult, err


+ 6
- 6
web/controllers/etl/Record.rest.go View File

@ -44,17 +44,17 @@ func RegisterSelect(party router.Party, httpMethod string, path string, method f
batchId := ctx.URLParam("batchId")
start := ctx.URLParam("start")
end := ctx.URLParam("end")
pageIndexStr := ctx.URLParam("pageIndex")
pageNumStr := ctx.URLParam("pageNum")
pageIndex, err := strconv.Atoi(pageIndexStr)
pageNumberStr := ctx.URLParam("pageNumber")
pageSizeStr := ctx.URLParam("pageSize")
pageIndex, err := strconv.Atoi(pageNumberStr)
if err != nil {
pageIndex = 1
}
pageNumber, err := strconv.Atoi(pageNumStr)
pageSize, err := strconv.Atoi(pageSizeStr)
if err != nil {
pageNumber = 10
pageSize = 10
}
result, err := method(taskId, stage, status, batchId, start, end, pageIndex, pageNumber)
result, err := method(taskId, stage, status, batchId, start, end, pageIndex, pageSize)
if err != nil {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return


Loading…
Cancel
Save