jeesite1,工具类,文件介绍

jeesiteV1.2.7

Java代码篇

StringUtils字符串工具类

位置:com.thinkgem.jeesite.common.utils
/**
 *
判断字符串是否不为空并且不为空字符串
 * StringUtils.isNotBlank(null)      = false
 *      * StringUtils.isNotBlank("")        = false
 *      * StringUtils.isNotBlank(" ")       = false
 *      * StringUtils.isNotBlank("bob")     = true
 *      * StringUtils.isNotBlank("  bob  ") = true
 */
StringUtils.isNotBlank("str1");
//判断字符串是否为空
StringUtils.isBlank("str1");
//判断字符串str1是否存在searchSeq
StringUtils.contains("str1", "searchSeq");
//判断字符串是否为nul
StringUtils.isEmpty("str1");
//判断字符串是否不为null
StringUtils.isNotEmpty("str1");
//替换字符串中的目标字符
StringUtils.replace("text", "searchString", "replacement");
//比对字符串
StringUtils.equals("CharSequence1", "CharSequence2");
//不区分大小写比对字符串
StringUtils.equalsIgnoreCase("str1", "str2");
//拆分字符串,跟split用法相同,返回字符串数组
StringUtils.split("str","separatorChars");

DateUtils日期工具类

位置:com.thinkgem.jeesite.common.utils
//得到当前日期字符串 格式(yyyy-MM-dd)
DateUtils.getDate();
// 得到当前年份字符串 格式(yyyy)
DateUtils.getYear();
// 得到当前月份字符串 格式(MM)
DateUtils.getMonth();
//得到当天字符串 格式(dd)
DateUtils.getDay();
//得到当前日期字符串 格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
DateUtils.getDate("pattern");
//判断两个日期是否为同一天
DateUtils.isSameDay(new Date(), new Date());
//日期修改,为当前日期添加1天
DateUtils.addDays(new Date(), 1);
//字符串转日期,parsePatterns如果没有,默认格式转换
DateUtils.parseDate("the date to parse, not null", "the date format patterns to use, see SimpleDateFormat, not null");
//得到日期字符串 默认格式(yyyy-MM-dd) pattern可以为:"yyyy-MM-dd" "HH:mm:ss" "E"
DateUtils.formatDate(new Date(), "parsePatterns");

IdGen id工具类

位置:com.thinkgem.jeesite.common.utils
//封装JDK自带的UUID, 通过Random数字生成, 中间无-分割.
IdGen.uuid();

Global全局配置类

位置:com.thinkgem.jeesite.common.config;
//获取当前对象实例
getInstance()
// 获取管理端根路径
getAdminPath()
//获取前端根路径
getFrontPath()
//获取URL后缀
getUrlSuffix()
//获取上传文件的根目录
getUserfilesBaseDir()
//获取工程路径
getProjectPath()

DloadImgUtil图片下载工具类

位置:com.thinkgem.jeesite.common.wechat.utils
/**
 *
获取媒体文件
 * @param
accessToken 接口访问凭证
 * @param
mediaId 媒体文件id
 * @param
savePath 文件在本地服务器上的存储路径
 * */
public static String downloadMedia(String accessToken, String mediaId, String savePath,String filePath)
/**
 *
获取多张媒体文件
 * @param
accessToken 接口访问凭证
 * @param
savePath 文件在本地服务器上的存储路径
 * */
public static String downloadMedias(String accessToken, String mediaIds, String savePath,String filePath)

MNews企业号消息推送

位置:com.thinkgem.jeesite.common.wechat.utils;
//给对应的用户推送消息,多个用户可以用|隔开,调用时需进入方法里,修改为对应url
sendMessage(String userId) 

TokenSchUtil获取token类

@Service
@Lazy(false)
public class TokenSchUtil {
//应用的accesstoken
public static String accessToken_x = "";
@Scheduled(fixedRate = 1000*60*60)//每1.5小时触发

public void taskCycle(){
accessToken_x = WeixinUtil.getAccessToken(Constants.CORPID, Constants.XC_SECRETA).getToken();
}
}
位置:com.thinkgem.jeesite
//获取token
TokenSchUtil.accessToken_x

timedTask定时任务类

位置:com.thinkgem.jeesite

对应资料:https://www.cnblogs.com/liaojie970/p/5913272.html

DictUtils字典工具类

位置:com.thinkgem.jeesite.modules.sys.utils;
//根据type并通过value查找label,defaultValue为默认value
public static String getDictLabel(String value, String type, String defaultValue)
//根据type并通过label查找value,defaultLabel为默认label
public static String getDictValue(String label, String type, String defaultLabel)
//返回字典列表
public static List<Dict> getDictList(String type)
//返回字典列表(JSON)
public static String getDictListJson(String type)

UserUtils用户工具类

位置:com.thinkgem.jeesite.modules.sys.utils;

//根据ID获取用户,获取不到返回null
public static User get(String id)
//根据登录名获取用户, 获取不到返回null
public static User getByLoginName(String loginName)
//清除当前用户缓存
public static void clearCache()
//清除指定用户缓存
public static void clearCache(User user)
//获取当前用户, 取不到返回 new User().当前用户为后台登录用户,手机端没有做登录则永远为new User()
public static User getUser()
//获取当前用户角色列表
public static List<Role> getRoleList()

resources资源篇

资源存放位置

注:

数据库xml存放位置为resources/mappings/modules/

缓存配置:resources/cache

配置文件说明

errors.properties:系统错误配置文档

jeesite.properties:jeesite配置文档,可配置jdbc,redis,产品名称,版本,管理路径,前端路径,网址后缀,工程路径等

log4j. properties:日志文件,可配置日志打印的资源。建议项目部署上主机时,注释最下方5行配置
log4j.logger.com.thinkgem.jeesite=DEBUG
log4j.logger.com.thinkgem.jeesite.common.security.shiro=WARN
log4j.logger.com.thinkgem.jeesite.common.utils.JedisUtils=WARN
log4j.logger.com.thinkgem.jeesite.modules.sys.web.LoginController=WARN
log4j.logger.com.thinkgem.jeesite.modules.oa.dao.OaNotifyDao.findCount=WARN
spring-context-shiro.xml:权限控制配置文件

webapp(根目录)

static为所有页面css,js,图片资源等存放位置

userfiles为项目运行时产生的所有文件(图片等)的存储位置。

WEB-INF 下lib为项目运行所需的jar包

WEB-INF 下views为项目所需页面的存放位置

所有映射文件(企业号与服务号的文件)均存放在根目录下

猜你喜欢

转载自www.cnblogs.com/coolSome/p/11235700.html