Commit 5c9855fc by stylefeng

整理包结构

parent 3647b776
package com.stylefeng.guns.core.util.qr;
package com.stylefeng.guns.core.qr;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
......
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.stylefeng.guns.core.util.qr;
package com.stylefeng.guns.core.qr;
import java.awt.image.BufferedImage;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.util.qr;
package com.stylefeng.guns.core.qr;
import com.google.zxing.common.BitMatrix;
......
package com.stylefeng.guns.core.util.qr;
package com.stylefeng.guns.core.qr;
/**
* 二维码图片对象
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import java.util.HashMap;
import java.util.Map;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import com.stylefeng.guns.core.support.exception.ToolBoxException;
import com.stylefeng.guns.core.util.Convert;
import com.stylefeng.guns.core.util.support.exception.ToolBoxException;
import java.beans.*;
import java.lang.reflect.Method;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import com.stylefeng.guns.core.util.support.exception.ToolBoxException;
import com.stylefeng.guns.core.support.exception.ToolBoxException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import com.stylefeng.guns.core.util.support.exception.ToolBoxException;
import com.stylefeng.guns.core.support.exception.ToolBoxException;
import java.lang.reflect.Array;
import java.util.*;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import java.util.Date;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import com.stylefeng.guns.core.util.support.exception.ToolBoxException;
import com.stylefeng.guns.core.support.exception.ToolBoxException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import java.nio.charset.Charset;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
/**
* 一些通用的函数
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
/**
* 分页工具类
......
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import java.io.StringReader;
import java.io.StringWriter;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import java.util.regex.Pattern;
......
......@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.stylefeng.guns.core.util.support;
package com.stylefeng.guns.core.support;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
......
......@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.stylefeng.guns.core.util.support.exception;
package com.stylefeng.guns.core.support.exception;
import com.stylefeng.guns.core.util.support.StrKit;
import com.stylefeng.guns.core.support.StrKit;
/**
* 工具类初始化异常
......
package com.stylefeng.guns.core.util;
import com.stylefeng.guns.core.util.support.*;
import com.stylefeng.guns.core.util.support.exception.ToolBoxException;
import com.stylefeng.guns.core.support.*;
import com.stylefeng.guns.core.support.exception.ToolBoxException;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
......
package com.stylefeng.guns.core.util;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Date;
/**
* 对比两个对象的变化的工具类
*
* @author fengshuonan
* @Date 2017/3/31 10:36
*/
public class SimpleContrast {
//记录每个修改字段的分隔符
public static final String separator = ";;;";
/**
* 比较两个对象,并返回不一致的信息
*
* @author stylefeng
* @Date 2017/5/9 19:34
*/
public static String contrastObj(Object pojo1, Object pojo2) {
String str = "";
try {
Class clazz = pojo1.getClass();
Field[] fields = pojo1.getClass().getDeclaredFields();
int i = 1;
for (Field field : fields) {
if ("serialVersionUID".equals(field.getName())) {
continue;
}
PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz);
Method getMethod = pd.getReadMethod();
Object o1 = getMethod.invoke(pojo1);
Object o2 = getMethod.invoke(pojo2);
if (o1 == null || o2 == null) {
continue;
}
if (o1 instanceof Date) {
o1 = DateUtil.getDay((Date) o1);
}
if (!o1.toString().equals(o2.toString())) {
if (i != 1) {
str += separator;
}
str += "字段名称" + field.getName() + ",旧值:" + o1 + ",新值:" + o2;
i++;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return str;
}
}
\ No newline at end of file
......@@ -15,7 +15,8 @@
*/
package com.stylefeng.guns.core.util;
import com.stylefeng.guns.core.util.support.StrKit;
import com.stylefeng.guns.core.support.StrKit;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
......
package com.stylefeng.guns.core.util.xss;
package com.stylefeng.guns.core.xss;
import javax.servlet.*;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment