jfinal相关

时间:2023-03-10 08:44:47
jfinal相关

1:jfinal工具类

1):密码加密工具

HashKit.md5(String password);
2):数据缓存工具类

chacheKit
3):获取项目路径工具类:

PathKit

4):读取文件流里面的数据

List<String> readLines=FileUtils.readLines(file, "GBK");

2:jfinal db操作

String delSql = "DELETE FROM TR_ROLE_MENU WHERE ROLE_ID="+roleId;
1:Db.update(delSql);
2:Db.batch(sql, paras, menuIds.length).length;

3:controller层可以直接调用的方法

1:getSession().xxx
2:getRequest();

/**
* 返回客户端状态数据
* @param msg
* @return
*/
public Record successJson(String msg){
return new Record().set("status","y").set("msg",msg);
}

public Record failJson(String msg){
return new Record().set("status","n").set("msg",msg);
}

renderJson(failJson("非法操作,该帐号已停用!").set("type","user_phone"));

jfinal相关