We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddd4bf5 commit a996d13Copy full SHA for a996d13
common/common-contract.md
@@ -0,0 +1,16 @@
1
+# 前后端协作规约
2
+
3
+## 日期传输规范
4
5
+对于系统中的两类日期时间,分别规定如下:
6
7
+- 系统自己生成的时间:前后端交互过程中统一转为 [UTC 时间](https://zh.wikipedia.org/wiki/%E5%8D%8F%E8%B0%83%E4%B8%96%E7%95%8C%E6%97%B6),格式上采用 [ISO 8601](https://zh.wikipedia.org/wiki/ISO_8601) 规定的 yyyy-MM-dd'T'HH:mm:ss.SSS'Z' 标准格式。
8
+- 第三方传入的时间:前后端交互过程中不对日期格式做转换处理。
9
10
+## 大数字传输规范
11
12
+对于 Java 中的 long 型等大数字,当超过一定范围,JavaScript 无法精确展示,故后端给前端的 Long 型数字时需转换为 String 字符串返回。
13
14
+## 列表传输规范
15
16
+对于列表形式的数据,如多个 ID,前后端应以列表/数组传输,不要使用逗号分隔的字符串。
0 commit comments