类 UserParamService

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

@Service public class UserParamService extends Object
用户参数服务类,提供对用户自定义参数的增删改查操作。
从以下版本开始:
2024/3/29 17:46
作者:
AaronFung
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    int
    delete(long userId)
    删除指定用户的所有参数记录。
    int
    delete(long userId, String name)
    删除指定用户下的某个具体参数项。
    get(long userId, String name)
    获取指定用户下某参数的原始对象值。
    boolean
    getBoolean(long userId, String name)
    获取指定用户下某参数的布尔值。
    getDate(long userId, String name)
    获取指定用户下某参数的日期格式化字符串(仅年月日)。
    getDateTime(long userId, String name)
    获取指定用户下某参数的时间格式化字符串(包含时分秒)。
    double
    getDouble(long userId, String name)
    获取指定用户下某参数的双精度浮点值。
    float
    getFloat(long userId, String name)
    获取指定用户下某参数的单精度浮点值。
    int
    getInt(long userId, String name)
    获取指定用户下某参数的整型值。
    com.alibaba.fastjson.JSONObject
    getJson(long userId, String name)
    将指定用户下某参数解析为JSON对象。
    getList(long userId, String name)
    将指定用户下某参数解析为List结构。
    getMap(long userId, String name)
    将指定用户下某参数解析为Map结构。
    getString(long userId, String name)
    获取指定用户下某参数的字符串形式值。
    int
    insert(long userId, String name, Object value)
    插入一个新的用户参数项。
    获取所有用户的参数列表。
    list(long userId)
    根据用户ID获取该用户的参数列表。
    int
    update(long userId, String name, Object value)
    更新指定用户下某参数的值。

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • UserParamService

      public UserParamService()
  • 方法详细资料

    • list

      @Comment("\u83b7\u53d6\u7528\u6237\u5217\u8868") public List<Map<String,Object>> list() throws SQLException
      获取所有用户的参数列表。
      返回:
      包含所有用户参数信息的列表
      抛出:
      SQLException - 数据库访问异常时抛出
    • list

      @Comment("\u83b7\u53d6\u7528\u6237\u53c2\u6570\u5217\u8868") public List<Map<String,Object>> list(long userId) throws SQLException
      根据用户ID获取该用户的参数列表。
      参数:
      userId - 用户唯一标识符
      返回:
      指定用户的所有参数信息列表
      抛出:
      SQLException - 数据库访问异常时抛出
    • delete

      @Comment("\u6e05\u7a7a\u7528\u6237\u53c2\u6570") public int delete(long userId) throws SQLException
      删除指定用户的所有参数记录。
      参数:
      userId - 要删除参数的用户ID
      返回:
      受影响的行数
      抛出:
      SQLException - 数据库访问异常时抛出
    • delete

      @Comment("\u5220\u9664\u7528\u6237\u53c2\u6570") public int delete(long userId, String name) throws SQLException
      删除指定用户下的某个具体参数项。
      参数:
      userId - 用户ID
      name - 参数名称
      返回:
      受影响的行数
      抛出:
      SQLException - 数据库访问异常时抛出
    • insert

      @Comment("\u6dfb\u52a0\u7528\u6237\u53c2\u6570") public int insert(long userId, String name, Object value) throws SQLException
      插入一个新的用户参数项。
      参数:
      userId - 用户ID
      name - 参数名
      value - 参数值(可为任意类型)
      返回:
      插入成功的条目数量
      抛出:
      SQLException - 数据库访问异常时抛出
    • update

      @Comment("\u66f4\u65b0\u7528\u6237\u53c2\u6570") public int update(long userId, String name, Object value) throws SQLException
      更新指定用户下某参数的值。
      参数:
      userId - 用户ID
      name - 参数名
      value - 新的参数值
      返回:
      更新成功的条目数量
      抛出:
      SQLException - 数据库访问异常时抛出
    • get

      @Comment("\u83b7\u53d6\u7528\u6237\u53c2\u6570") public Object get(long userId, String name) throws SQLException
      获取指定用户下某参数的原始对象值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数对应的值对象
      抛出:
      SQLException - 数据库访问异常时抛出
    • getString

      @Comment("\u83b7\u53d6\u7528\u6237\u53c2\u6570") public String getString(long userId, String name) throws SQLException
      获取指定用户下某参数的字符串形式值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数转换后的字符串值,默认为空字符串
      抛出:
      SQLException - 数据库访问异常时抛出
    • getInt

      @Comment("\u83b7\u53d6\u7528\u6237\u53c2\u6570") public int getInt(long userId, String name) throws SQLException
      获取指定用户下某参数的整型值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数转换后的整数值,默认为0
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDouble

      @Comment("\u83b7\u53d6\u7528\u6237\u53c2\u6570") public double getDouble(long userId, String name) throws SQLException
      获取指定用户下某参数的双精度浮点值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数转换后的double值
      抛出:
      SQLException - 数据库访问异常时抛出
    • getFloat

      @Comment("\u83b7\u53d6Float") public float getFloat(long userId, String name) throws SQLException
      获取指定用户下某参数的单精度浮点值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数转换后的float值
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDate

      @Comment("\u83b7\u53d6\u65e5\u671f") public String getDate(long userId, String name) throws SQLException
      获取指定用户下某参数的日期格式化字符串(仅年月日)。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      格式化后的日期字符串,格式:yyyy-MM-dd
      抛出:
      SQLException - 数据库访问异常时抛出
    • getDateTime

      @Comment("\u83b7\u53d6\u65e5\u671f\u65f6\u95f4") public String getDateTime(long userId, String name) throws SQLException
      获取指定用户下某参数的时间格式化字符串(包含时分秒)。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      格式化后的时间字符串,格式:yyyy-MM-dd hh:mm:ss
      抛出:
      SQLException - 数据库访问异常时抛出
    • getJson

      @Comment("\u83b7\u53d6JSON") public com.alibaba.fastjson.JSONObject getJson(long userId, String name) throws SQLException
      将指定用户下某参数解析为JSON对象。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      解析后的JSONObject对象
      抛出:
      SQLException - 数据库访问异常时抛出
    • getMap

      @Comment("\u83b7\u53d6Map") public Map getMap(long userId, String name) throws SQLException
      将指定用户下某参数解析为Map结构。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      解析后的Map对象
      抛出:
      SQLException - 数据库访问异常时抛出
    • getList

      @Comment("\u83b7\u53d6List") public List getList(long userId, String name) throws SQLException
      将指定用户下某参数解析为List结构。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      解析后的List对象
      抛出:
      SQLException - 数据库访问异常时抛出
    • getBoolean

      @Comment("\u83b7\u53d6Boolean") public boolean getBoolean(long userId, String name) throws SQLException
      获取指定用户下某参数的布尔值。
      参数:
      userId - 用户ID
      name - 参数名
      返回:
      参数转换后的boolean值
      抛出:
      SQLException - 数据库访问异常时抛出