格式化时间

20230922-ljl-fixBug
daixiaogang 1 year ago
parent 9d341f66e5
commit bcc827814a

@ -1,8 +1,11 @@
package com.ms.api.common;
import lombok.Data;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
/**
*
@ -38,6 +41,11 @@ public class Ret {
}
public static Ret success(Map data) {
for (Object key : data.keySet()) {
if (data.get(key) instanceof Date){
data.put(key,DateUtil.formatDateTime((Date) data.get(key)));
}
}
return new Ret("success", data);
}
@ -52,10 +60,10 @@ public class Ret {
@Override
public String toString() {
return "Ret{" +
"result='" + result + '\'' +
", reason='" + reason + '\'' +
", code='" + code + '\'' +
", data=" + data +
'}';
"result='" + result + '\'' +
", reason='" + reason + '\'' +
", code='" + code + '\'' +
", data=" + data +
'}';
}
}

Loading…
Cancel
Save