Merge branch 'master' of http://git.yoho.cn/ufo/ufo-platform
Showing
1 changed file
with
3 additions
and
30 deletions
@@ -3,43 +3,16 @@ package com.yoho.ufo.service.model; | @@ -3,43 +3,16 @@ package com.yoho.ufo.service.model; | ||
3 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder; | 3 | import org.apache.commons.lang3.builder.ReflectionToStringBuilder; |
4 | 4 | ||
5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
6 | -import java.text.SimpleDateFormat; | ||
7 | -import java.util.Date; | ||
8 | 6 | ||
9 | -/** | ||
10 | - * Created by yoho on 2017/2/15. | ||
11 | - */ | ||
12 | public class BaseBO implements Serializable { | 7 | public class BaseBO implements Serializable { |
13 | - public static final String NORMAL_FORMAT = "yyyy-MM-dd"; | ||
14 | - private static final long serialVersionUID = 1759153128139236954L; | 8 | + |
9 | + private static final long serialVersionUID = 2713604434915399057L; | ||
15 | 10 | ||
16 | public BaseBO() { | 11 | public BaseBO() { |
17 | } | 12 | } |
18 | 13 | ||
14 | + @Override | ||
19 | public String toString() { | 15 | public String toString() { |
20 | return ReflectionToStringBuilder.toString(this); | 16 | return ReflectionToStringBuilder.toString(this); |
21 | } | 17 | } |
22 | - | ||
23 | - public static String getDateFormatFromInt(long intTime, String... formats) { | ||
24 | - if(intTime <= 0L) { | ||
25 | - return null; | ||
26 | - } else { | ||
27 | - Date date = new Date(intTime * 1000L); | ||
28 | - return getDateFormatFromDate(date, formats); | ||
29 | - } | ||
30 | - } | ||
31 | - | ||
32 | - public static String getDateFormatFromDate(Date date, String... formats) { | ||
33 | - if(date == null) { | ||
34 | - return null; | ||
35 | - } else { | ||
36 | - String format = "yyyy-MM-dd"; | ||
37 | - if(null != formats && formats.length > 0) { | ||
38 | - format = null == formats[0]?"yyyy-MM-dd":formats[0]; | ||
39 | - } | ||
40 | - | ||
41 | - SimpleDateFormat sdf = new SimpleDateFormat(format); | ||
42 | - return sdf.format(date); | ||
43 | - } | ||
44 | - } | ||
45 | } | 18 | } |
-
Please register or login to post a comment