public interface ISohelpBootResourceService
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,Object> |
add(String filePath,
String fileJson)
添加配置资源
|
default <T> T |
convertClass(com.alibaba.fastjson.JSONObject jsonObject,
Class<T> cls)
将 JSONObject 转换为指定类型的对象
|
void |
deleteBatch(String filePath)
批量删除配置资源
|
void |
deleteByPath(String filePath)
删除配置资源
|
boolean |
exists(String filePath)
判断文件是否存在
|
default String |
formatFilePath(String filePath)
检查并格式化文件路径
该方法会检查传入的文件路径是否合法,并将路径中的多余斜杠(/)替换为单个斜杠(/)。
|
com.alibaba.fastjson.JSONObject |
getByPath(String filePath)
根据路径获取对象
|
<T> T |
getByPath(String filePath,
Class<T> cls)
根据路径获取对象
|
List<com.alibaba.fastjson.JSONObject> |
listByPath(String filePath)
查询文件列表
|
<T> List<T> |
listByPath(String filePath,
Class<T> cls)
查询文件列表
|
List<com.alibaba.fastjson.JSONObject> |
listByRegex(String filePath,
String regex)
查询文件列表
|
<T> List<T> |
listByRegex(String filePath,
String regex,
Class<T> cls)
查询文件列表
|
default boolean |
readOnly()
设置资源为只读模式
|
void |
renamePath(String srcFilePath,
String newFilePath)
修改路径
|
Map<String,Object> |
save(String filePath,
Map<String,Object> formMap)
保存配置资源
|
Map<String,Object> |
save(String filePath,
String fileJson)
保存配置资源
|
Map<String,Object> |
updateByPath(String filePath,
String fileJson)
更新配置资源
|
@Comment(value="\u683c\u5f0f\u5316\u6587\u4ef6\u8def\u5f84") default String formatFilePath(String filePath)
该方法会检查传入的文件路径是否合法,并将路径中的多余斜杠(/)替换为单个斜杠(/)。
filePath - 文件路径字符串IllegalArgumentException - 如果filePath为null,则抛出此异常default <T> T convertClass(com.alibaba.fastjson.JSONObject jsonObject,
Class<T> cls)
T - 目标对象的类型jsonObject - 要转换的 JSONObject 对象cls - 目标对象的类型com.fasterxml.jackson.core.JsonProcessingException - 如果 JSON 解析过程中发生错误,会抛出此异常@Comment(value="\u8d44\u6e90\u8bbe\u7f6e\u4e3a\u53ea\u8bfb\u6a21\u5f0f") default boolean readOnly()
@Comment(value="\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728") boolean exists(String filePath)
filePath - 文件路径@Comment(value="\u6839\u636e\u8def\u5f84\u83b7\u53d6\u5bf9\u8c61") com.alibaba.fastjson.JSONObject getByPath(String filePath)
filePath - 文件路径@Comment(value="\u6839\u636e\u8def\u5f84\u83b7\u53d6\u5bf9\u8c61") <T> T getByPath(String filePath, Class<T> cls) throws BusiException, SQLException
filePath - 文件路径cls - 目标对象的类类型BusiException - 业务异常SQLException - SQL异常@Comment(value="\u4fdd\u5b58\u914d\u7f6e\u8d44\u6e90") Map<String,Object> save(String filePath, Map<String,Object> formMap) throws SQLException, BusiException
filePath - 配置资源文件的路径formMap - 配置资源的键值对集合SQLException - SQL异常BusiException - 业务异常@Comment(value="\u4fdd\u5b58\u914d\u7f6e\u8d44\u6e90") Map<String,Object> save(String filePath, String fileJson) throws SQLException, BusiException
filePath - 配置资源文件的路径fileJson - 配置资源的JSON字符串SQLException - SQL异常BusiException - 业务异常@Comment(value="\u6dfb\u52a0\u914d\u7f6e\u8d44\u6e90") Map<String,Object> add(String filePath, String fileJson) throws SQLException, BusiException
filePath - 配置资源文件的路径fileJson - 配置资源的JSON字符串SQLException - SQL异常BusiException - 业务异常@Comment(value="\u4fee\u6539\u8def\u5f84") void renamePath(String srcFilePath, String newFilePath) throws SQLException, BusiException
srcFilePath - 原路径newFilePath - 新路径SQLException - SQL异常BusiException - 业务异常@Comment(value="\u66f4\u65b0\u914d\u7f6e\u8d44\u6e90") Map<String,Object> updateByPath(String filePath, String fileJson) throws SQLException, BusiException
filePath - 配置资源文件的路径fileJson - 配置资源的JSON字符串SQLException - SQL异常BusiException - 业务异常@Comment(value="\u67e5\u8be2\u6587\u4ef6\u5217\u8868") <T> List<T> listByPath(String filePath, Class<T> cls) throws SQLException
T - 泛型参数,表示文件对象类型filePath - 文件路径cls - 文件对象类型SQLException - 如果数据库查询操作发生异常,则抛出此异常@Comment(value="\u67e5\u8be2\u6587\u4ef6\u5217\u8868") List<com.alibaba.fastjson.JSONObject> listByRegex(String filePath, String regex) throws SQLException
filePath - 文件路径regex - 正则表达式SQLException - 如果发生数据库访问异常,抛出此异常@Comment(value="\u67e5\u8be2\u6587\u4ef6\u5217\u8868") <T> List<T> listByRegex(String filePath, String regex, Class<T> cls) throws SQLException
T - 返回对象类型filePath - 文件路径regex - 正则表达式cls - 返回对象类型SQLException - 数据库操作异常@Comment(value="\u67e5\u8be2\u6587\u4ef6\u5217\u8868") List<com.alibaba.fastjson.JSONObject> listByPath(String filePath)
filePath - 文件路径@Comment(value="\u5220\u9664\u914d\u7f6e\u8d44\u6e90") void deleteByPath(String filePath) throws BusiException
filePath - 配置资源的路径BusiException - 如果删除过程中出现业务异常@Comment(value="\u6279\u91cf\u5220\u9664\u914d\u7f6e\u8d44\u6e90") void deleteBatch(String filePath) throws BusiException
filePath - 配置文件的路径BusiException - 业务异常Copyright © 2025. All rights reserved.