更新注释

master
星期八 5 years ago
parent 1103b8c1e1
commit 210df7f85b
  1. 11
      src/main/java/com/lq/cms/service/WechatInfoService.java
  2. 12
      src/main/java/com/lq/cms/vo/SysRoleResourcePermissionVo.java
  3. 6
      src/main/java/com/lq/code/util/XmlUtil.java
  4. 9
      src/main/java/com/lq/code/util/email/emailUtil.java
  5. 5
      src/main/java/com/lq/code/util/jdbc/ResultSetHandler.java
  6. 42
      src/main/java/com/lq/code/util/jdbc/mode/Table.java
  7. 3
      src/main/java/com/lq/code/util/os/NetUtil.java
  8. 6
      src/main/java/com/lq/code/util/sql/factory/DbBuilerFactory.java
  9. 2
      src/main/java/com/lq/dao/SysResourceDao.java
  10. 18
      src/main/java/com/lq/wechat/util/DecriptTest.java
  11. 3
      src/main/java/com/lq/wechat/util/MessageUtil.java

@ -11,9 +11,18 @@ import java.util.List;
* @author qi * @author qi
*/ */
public interface WechatInfoService extends BaseService<WechatInfo> { public interface WechatInfoService extends BaseService<WechatInfo> {
/**
* 返回统计数据
* @param vo
* @return
*/
Integer count(WechatInfoVo vo); Integer count(WechatInfoVo vo);
/**
* 带条件分页查询
* @param vo
* @return
*/
List<WechatInfoVo> findListPage(WechatInfoVo vo); List<WechatInfoVo> findListPage(WechatInfoVo vo);
/** /**

@ -7,11 +7,17 @@ package com.lq.cms.vo;
*/ */
public class SysRoleResourcePermissionVo { public class SysRoleResourcePermissionVo {
//角色ID /**
* 角色ID
*/
private Long roleId; private Long roleId;
//资源ID /**
* 资源ID
*/
private Long resourceId; private Long resourceId;
//权限ID /**
* 权限ID
*/
private Long permissionId; private Long permissionId;
public Long getRoleId() { public Long getRoleId() {

@ -23,7 +23,8 @@ public class XmlUtil {
*/ */
public static String objToXml(Object obj){ public static String objToXml(Object obj){
XStream xstream = new XStream(new DomDriver("utf8")); XStream xstream = new XStream(new DomDriver("utf8"));
xstream.processAnnotations(obj.getClass()); // 识别obj类中的注解 // 识别obj类中的注解
xstream.processAnnotations(obj.getClass());
/* /*
// 以压缩的方式输出XML // 以压缩的方式输出XML
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();
@ -37,7 +38,8 @@ public class XmlUtil {
public static String objToXml(Object obj,String str) throws IOException { public static String objToXml(Object obj,String str) throws IOException {
XStream xstream = new XStream(new DomDriver("utf8")); XStream xstream = new XStream(new DomDriver("utf8"));
xstream.processAnnotations(obj.getClass()); // 识别obj类中的注解 // 识别obj类中的注解
xstream.processAnnotations(obj.getClass());
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Writer writer = new OutputStreamWriter(outputStream, "UTF-8"); Writer writer = new OutputStreamWriter(outputStream, "UTF-8");
writer.write(str); writer.write(str);

@ -36,9 +36,12 @@ public class emailUtil {
Properties props = new Properties(); Properties props = new Properties();
props.put("mail.smtp.host", smtpHost); props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.starttls.enable","true");//使用 STARTTLS安全连接 //使用 STARTTLS安全连接
props.put("mail.smtp.port", "25"); //google使用465或587端口 props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.auth", "true"); // 使用验证 //google使用465或587端口
props.put("mail.smtp.port", "25");
// 使用验证
props.put("mail.smtp.auth", "true");
Session mailSession = Session.getInstance(props,new MyAuthenticator(from,fromUserPassword)); Session mailSession = Session.getInstance(props,new MyAuthenticator(from,fromUserPassword));
// 第二步:编写消息 // 第二步:编写消息

@ -8,6 +8,11 @@ import java.sql.ResultSet;
*/ */
public interface ResultSetHandler { public interface ResultSetHandler {
/**
* 结果集封装成对象
* @param rs
* @return
*/
Object handler(ResultSet rs); Object handler(ResultSet rs);
} }

@ -20,27 +20,45 @@ public class Table {
SELF_REFERENCING_COL_NAME SELF_REFERENCING_COL_NAME
REF_GENERATION REF_GENERATION
*/ */
//类别 /**
* 类别
*/
private String tableCat; private String tableCat;
//模式 /**
* 模式
*/
private String tableSchem; private String tableSchem;
//表名 /**
* 表名
*/
private String tableName; private String tableName;
//表类型 /**
* 表类型
*/
private String tableType; private String tableType;
//备注 /**
* 备注
*/
private String remarks; private String remarks;
//类型的类别 /**
* 类型的类别
*/
private String typeCat; private String typeCat;
//类型模式 /**
* 类型模式
*/
private String typeSchem; private String typeSchem;
//类型名称 /**
* 类型名称
*/
private String typeName; private String typeName;
// 有类型表的指定 "identifier" 的列的名称 /**
* 有类型表的指定 "identifier" 的列的名称
*/
private String selfReferencingColName; private String selfReferencingColName;
// /**
// private String refGeneration; * 表相关的列
*/
private List<Column> columns; private List<Column> columns;
public String getTableCat() { public String getTableCat() {

@ -48,7 +48,8 @@ public class NetUtil {
LOGGER.info("获取到的客户端内网ip为空,从配置文件读取本地ip。"); LOGGER.info("获取到的客户端内网ip为空,从配置文件读取本地ip。");
return null; return null;
} }
return ip.getHostAddress();// 客户端ip // 客户端ip
return ip.getHostAddress();
} }
} }
} }

@ -8,6 +8,10 @@ import com.lq.code.util.sql.AbstractDbBuiler;
* @author qi * @author qi
*/ */
public interface DbBuilerFactory { public interface DbBuilerFactory {
/**
* 返回sql构造器
* @param dbType
* @return
*/
AbstractDbBuiler getSqlBuilder(String dbType); AbstractDbBuiler getSqlBuilder(String dbType);
} }

@ -43,7 +43,7 @@ public interface SysResourceDao extends BaseDao<SysResource> {
Integer count(SysResourceVo vo); Integer count(SysResourceVo vo);
/** /**
* * 查找菜单
* @param map * @param map
* @return * @return
*/ */

@ -103,11 +103,14 @@ public class DecriptTest {
SecretKey secretKey = kgen.generateKey(); SecretKey secretKey = kgen.generateKey();
byte[] enCodeFormat = secretKey.getEncoded(); byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");// 创建密码器 // 创建密码器
Cipher cipher = Cipher.getInstance("AES");
byte[] byteContent = content.getBytes("utf-8"); byte[] byteContent = content.getBytes("utf-8");
cipher.init(Cipher.ENCRYPT_MODE, key);// 初始化 // 初始化
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] result = cipher.doFinal(byteContent); byte[] result = cipher.doFinal(byteContent);
return result; // 加密 // 加密
return result;
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
e.printStackTrace(); e.printStackTrace();
} catch (NoSuchPaddingException e) { } catch (NoSuchPaddingException e) {
@ -140,10 +143,13 @@ public class DecriptTest {
SecretKey secretKey = kgen.generateKey(); SecretKey secretKey = kgen.generateKey();
byte[] enCodeFormat = secretKey.getEncoded(); byte[] enCodeFormat = secretKey.getEncoded();
SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES");
Cipher cipher = Cipher.getInstance("AES");// 创建密码器 // 创建密码器
cipher.init(Cipher.DECRYPT_MODE, key);// 初始化 Cipher cipher = Cipher.getInstance("AES");
// 初始化
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] result = cipher.doFinal(content); byte[] result = cipher.doFinal(content);
return result; // 加密 // 加密
return result;
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
e.printStackTrace(); e.printStackTrace();
} catch (NoSuchPaddingException e) { } catch (NoSuchPaddingException e) {

@ -52,7 +52,8 @@ public class MessageUtil {
*/ */
public static String MessageToXml(Object obj){ public static String MessageToXml(Object obj){
XStream xstream = new XStream(new DomDriver("utf8")); XStream xstream = new XStream(new DomDriver("utf8"));
xstream.processAnnotations(obj.getClass()); // 识别obj类中的注解 // 识别obj类中的注解
xstream.processAnnotations(obj.getClass());
/* /*
// 以压缩的方式输出XML // 以压缩的方式输出XML
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();

Loading…
Cancel
Save