Forráskód Böngészése

feat(api): 添加当前时间戳到响应数据

- 在AuctionController的接口响应中添加currentTimestamp字段
- 在LotController的biddingLotList接口响应中添加currentTimestamp字段
- 在LotController的queryLotByCategory接口响应中添加currentTimestamp字段
- 在LotController的detail接口响应中添加currentTimestamp字段
- 为所有拍品相关接口提供统一的时间戳返回机制
hr~ 1 hónapja
szülő
commit
072a31d585

+ 1 - 1
bid/src/main/java/cn/hobbystocks/auc/web/AuctionController.java

@@ -51,7 +51,7 @@ public class AuctionController extends BaseController {
         startPage(auction);
         List<Lot> lots = lotService.selectLotListByAucId(auction.getId());
         sortLotsByStatusTier(lots);
-        return AjaxResult.success().put("auction",dbAuction).put("lotList",lots);
+        return AjaxResult.success().put("auction",dbAuction).put("lotList",lots).put("currentTimestamp", System.currentTimeMillis());
     }
 
     private void sortLotsByStatusTier(List<Lot> lots) {

+ 3 - 3
bid/src/main/java/cn/hobbystocks/auc/web/LotController.java

@@ -42,7 +42,7 @@ public class LotController extends BaseController {
         //查询正在竞价中的拍品,按开始时间排序
         // todo 按计算的热度值排序;
         List<Lot> lots = lotService.selectBiddingLotList();
-        return AjaxResult.success(lots);
+        return AjaxResult.success(lots).put("currentTimestamp", System.currentTimeMillis());
     }
 
     /**
@@ -55,7 +55,7 @@ public class LotController extends BaseController {
          * 查询拍品,关键字模糊匹配拍品名称
          */
         List<LotFansResponse> responses = lotService.queryLotByCategory(request);
-        return AjaxResult.successPage(responses);
+        return AjaxResult.successPage(responses).put("currentTimestamp", System.currentTimeMillis());
     }
 
 
@@ -73,7 +73,7 @@ public class LotController extends BaseController {
     @ApiOperation("lot detail")
     public AjaxResult detail(@PathVariable("lotId")@ApiParam("拍品ID") Long lotId) {
         LotDetailResponse response = lotService.queryLotDetail(lotId);
-        return AjaxResult.success(response);
+        return AjaxResult.success(response).put("currentTimestamp", System.currentTimeMillis());
     }
 
 }