类 SystemParamService

java.lang.Object
net.sohelp.boot.admin.core.service.param.SystemParamService

@Service public class SystemParamService extends Object
系统参数操作服务类,提供对系统常量参数的增删改查功能。
从以下版本开始:
2024/3/29 10:39
作者:
AaronFung
  • 构造器详细资料

    • SystemParamService

      public SystemParamService()
  • 方法详细资料

    • instance

      public static SystemParamService instance()
      获取当前Spring容器中的SystemParamService实例。
      返回:
      SystemParamService 实例对象
    • update

      @Comment("\u66f4\u65b0\u8bb0\u5f55") public int update(String name, Object value) throws SQLException
      根据名称更新指定参数的值。
      参数:
      name - 参数名
      value - 新的参数值(将转换为字符串存储)
      返回:
      受影响的记录数
      抛出:
      SQLException - 数据库访问异常时抛出
    • list

      @Comment("\u5217\u8868\u6240\u6709\u5b57\u5178\u6570\u636e") public List<Map<String,Object>> list() throws SQLException
      查询所有系统参数配置项。
      返回:
      包含所有参数信息的列表,每个元素是一个键值对映射
      抛出:
      SQLException - 数据库访问异常时抛出
    • save

      @Comment("\u4fdd\u5b58\u5b57\u5178\u6570\u636e") public int save(String name, Object value, String description) throws SQLException
      保存系统参数。如果该参数已存在则执行更新操作;否则插入新记录。
      参数:
      name - 参数名
      value - 参数值
      description - 参数描述信息
      返回:
      操作结果影响的行数
      抛出:
      SQLException - 数据库访问异常时抛出
    • insert

      @Comment("\u6dfb\u52a0\u5b57\u5178\u6570\u636e") public int insert(String name, Object value, String description) throws SQLException
      插入新的系统参数记录。
      参数:
      name - 参数名
      value - 参数值
      description - 参数描述信息
      返回:
      插入成功的记录数量
      抛出:
      SQLException - 数据库访问异常时抛出
    • getObject

      @Comment("\u83b7\u53d6\u5b57\u5178\u6570\u636e") public Object getObject(String name) throws SQLException
      根据参数名称获取原始对象类型的值。
      参数:
      name - 参数名
      返回:
      对应的参数值对象,未找到返回null
      抛出:
      SQLException - 数据库访问异常时抛出
    • getString

      @Comment("\u83b7\u53d6\u5b57\u7b26\u4e32") public String getString(String name) throws SQLException
      根据参数名称获取字符串类型值。
      参数:
      name - 参数名
      返回:
      字符串形式的参数值,默认为空字符串
      抛出:
      SQLException - 数据库访问异常时抛出
    • getInt

      @Comment("\u83b7\u53d6\u6574\u6570") public Integer getInt(String name) throws SQLException
      根据参数名称获取整型数值。
      参数:
      name - 参数名
      返回:
      整型参数值,默认为0
      抛出:
      SQLException - 数据库访问异常时抛出
    • getLong

      @Comment("\u83b7\u53d6\u957f\u6574\u6570") public Long getLong(String name) throws SQLException
      根据参数名称获取长整型数值。
      参数:
      name - 参数名
      返回:
      长整型参数值,默认为0L
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDouble

      @Comment("\u83b7\u53d6\u6d6e\u70b9\u6570") public Double getDouble(String name) throws SQLException
      根据参数名称获取双精度浮点数。
      参数:
      name - 参数名
      返回:
      双精度浮点数,默认为0D
      抛出:
      SQLException - 数据库访问异常时抛出
    • getFloat

      @Comment("\u83b7\u53d6\u6d6e\u70b9\u6570") public Float getFloat(String name) throws SQLException
      根据参数名称获取单精度浮点数。
      参数:
      name - 参数名
      返回:
      单精度浮点数,默认为0F
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDate

      @Comment("\u83b7\u53d6\u65e5\u671f") public Date getDate(String name) throws SQLException
      根据参数名称获取日期类型值。
      参数:
      name - 参数名
      返回:
      日期对象,默认为null
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDateTime

      @Comment("\u83b7\u53d6\u65e5\u671f\u65f6\u95f4") public String getDateTime(String name) throws SQLException
      根据参数名称获取格式化后的日期时间字符串。
      参数:
      name - 参数名
      返回:
      格式化的日期时间字符串(格式:yyyy-MM-dd hh:mm:ss),默认为null
      抛出:
      SQLException - 数据库访问异常时抛出
    • getJson

      @Comment("\u83b7\u53d6JSON") public com.alibaba.fastjson.JSONObject getJson(String name) throws SQLException
      根据参数名称获取JSON对象。
      参数:
      name - 参数名
      返回:
      JSONObject对象,默认为null
      抛出:
      SQLException - 数据库访问异常时抛出
    • getMap

      @Comment("\u83b7\u53d6Map") public Map getMap(String name) throws SQLException
      根据参数名称获取Map结构的数据。
      参数:
      name - 参数名
      返回:
      Map对象,默认为空Map
      抛出:
      SQLException - 数据库访问异常时抛出
    • getList

      @Comment("\u83b7\u53d6\u5217\u8868") public List getList(String name) throws SQLException
      根据参数名称获取List结构的数据。
      参数:
      name - 参数名
      返回:
      List对象,默认为空List
      抛出:
      SQLException - 数据库访问异常时抛出
    • getBoolean

      @Comment("\u83b7\u53d6Boolean") public Boolean getBoolean(String name) throws SQLException
      根据参数名称获取布尔类型值。
      参数:
      name - 参数名
      返回:
      布尔值,默认为null
      抛出:
      SQLException - 数据库访问异常时抛出