Skip to content

Commit

Permalink
refactor: 将时间戳单位从毫秒调整为秒
Browse files Browse the repository at this point in the history
时间戳是指格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总秒数。通俗的讲,时间戳是一份能够表示一份数据在一个特定时间点已经存在的完整的可验证的数据。它的提出主要是为用户提供一份电子证据,以证明用户的某些数据的产生时间。在实际应用上,它可以使用在包括电子商务、金融活动的各个方面,尤其可以用来支撑公开密钥基础设施的“不可否认”服务。
  • Loading branch information
Charles7c committed Aug 14, 2023
1 parent a61196c commit fa916b9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

import org.springframework.http.HttpStatus;

import cn.hutool.core.date.DateUtil;

/**
* 响应信息
*
Expand Down Expand Up @@ -56,8 +58,8 @@ public class R<V> implements Serializable {
private V data;

/** 时间戳 */
@Schema(description = "时间戳", example = "1691453288000")
private long timestamp = System.currentTimeMillis();
@Schema(description = "时间戳", example = "1691453288")
private long timestamp = DateUtil.currentSeconds();

/** 成功状态码 */
private static final int SUCCESS_CODE = HttpStatus.OK.value();
Expand Down

0 comments on commit fa916b9

Please sign in to comment.