添加全局配置代码
This commit is contained in:
1 parent
00a4a08c70
commit
ce9d974b57
7 files changed
+1154
No files matched your search
@@ -0,0 +1,118 @@
|
||||
package com.ruoyi.system.controller;
|
||||
import com.ruoyi.common.select.Ids;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.UsdtConfig;
|
||||
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||
import com.ruoyi.system.service.IUsdtConfigService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 全局配置Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/config")
|
||||
public class UsdtConfigController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IUsdtConfigService usdtConfigService;
|
||||
@PreAuthorize("@ss.hasPermi('system:config:getByIds')")
|
||||
@PostMapping("/getByIds")
|
||||
public AjaxResult getByIds(@RequestBody Ids ids)
|
||||
{
|
||||
List<UsdtConfigPlus> list = usdtConfigService.getByIds(ids.getLongIds(),UsdtConfigPlus::getVersion,UsdtConfigPlus::getId);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@PreAuthorize("@ss.hasPermi('system:config:select')")
|
||||
@GetMapping("/select")
|
||||
public AjaxResult select(String keyword)
|
||||
{
|
||||
List<SelectItem> list = usdtConfigService.select(keyword);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
/**
|
||||
* 查询全局配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UsdtConfig usdtConfig)
|
||||
{
|
||||
startPage();
|
||||
List<UsdtConfig> list = usdtConfigService.selectUsdtConfigList(usdtConfig);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出全局配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:export')")
|
||||
@Log(title = "全局配置", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(UsdtConfig usdtConfig)
|
||||
{
|
||||
List<UsdtConfig> list = usdtConfigService.selectUsdtConfigList(usdtConfig);
|
||||
ExcelUtil<UsdtConfig> util = new ExcelUtil<UsdtConfig>(UsdtConfig.class);
|
||||
return util.exportExcel(list, "config");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全局配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(usdtConfigService.selectUsdtConfigById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全局配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:add')")
|
||||
@Log(title = "全局配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UsdtConfig usdtConfig)
|
||||
{
|
||||
return toAjax(usdtConfigService.insertUsdtConfig(usdtConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全局配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:edit')")
|
||||
@Log(title = "全局配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UsdtConfig usdtConfig)
|
||||
{
|
||||
return toAjax(usdtConfigService.updateUsdtConfig(usdtConfig));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全局配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:config:remove')")
|
||||
@Log(title = "全局配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(usdtConfigService.deleteUsdtConfigByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 全局配置对象 usdt_config
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
public class UsdtConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 代付手续费 */
|
||||
@Excel(name = "代付手续费")
|
||||
private BigDecimal payUsdtNum;
|
||||
|
||||
/** 代收手续费 */
|
||||
@Excel(name = "代收手续费")
|
||||
private BigDecimal receiveUsdtNum;
|
||||
|
||||
/** 波场网络类型 */
|
||||
@Excel(name = "波场网络类型")
|
||||
private Integer tronNetType;
|
||||
|
||||
/** 信封版本;配置密码轮换成功后递增 */
|
||||
@Excel(name = "信封版本;配置密码轮换成功后递增")
|
||||
private Long version;
|
||||
|
||||
/** 助记词和 DEK 使用的加密算法 */
|
||||
@Excel(name = "助记词和 DEK 使用的加密算法")
|
||||
private String encryptionAlgorithm;
|
||||
|
||||
/** 配置密码派生算法 */
|
||||
@Excel(name = "配置密码派生算法")
|
||||
private String passwordKdf;
|
||||
|
||||
/** PBKDF2 迭代次数;轮换时按当前安全策略更新 */
|
||||
@Excel(name = "PBKDF2 迭代次数;轮换时按当前安全策略更新")
|
||||
private Long iterations;
|
||||
|
||||
/** AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词 */
|
||||
@Excel(name = "AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词")
|
||||
private String encryptedMnemonic;
|
||||
|
||||
/** 助记词 AES-GCM nonce,Base64,通常为 12 字节 */
|
||||
@Excel(name = "助记词 AES-GCM nonce,Base64,通常为 12 字节")
|
||||
private String mnemonicNonce;
|
||||
|
||||
/** 由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK */
|
||||
@Excel(name = "由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK")
|
||||
private String encryptedDek;
|
||||
|
||||
/** DEK AES-GCM nonce,Base64,通常为 12 字节 */
|
||||
@Excel(name = "DEK AES-GCM nonce,Base64,通常为 12 字节")
|
||||
private String dekNonce;
|
||||
|
||||
/** 配置密码派生 KEK 使用的 salt,Base64 */
|
||||
@Excel(name = "配置密码派生 KEK 使用的 salt,Base64")
|
||||
private String keySalt;
|
||||
|
||||
/** 配置密码校验哈希使用的独立 salt,Base64 */
|
||||
@Excel(name = "配置密码校验哈希使用的独立 salt,Base64")
|
||||
private String passwordSalt;
|
||||
|
||||
/** PBKDF2 配置密码校验值,Base64;不是可逆密码 */
|
||||
@Excel(name = "PBKDF2 配置密码校验值,Base64;不是可逆密码")
|
||||
private String passwordHash;
|
||||
|
||||
/** 最近一次配置密码轮换时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近一次配置密码轮换时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date rotatedAt;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "最近一次配置密码轮换时间")
|
||||
private BigDecimal trxNum;
|
||||
|
||||
/** 主账号地址 */
|
||||
@Excel(name = "主账号地址")
|
||||
private String tokenAddress;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPayUsdtNum(BigDecimal payUsdtNum)
|
||||
{
|
||||
this.payUsdtNum = payUsdtNum;
|
||||
}
|
||||
|
||||
public BigDecimal getPayUsdtNum()
|
||||
{
|
||||
return payUsdtNum;
|
||||
}
|
||||
public void setReceiveUsdtNum(BigDecimal receiveUsdtNum)
|
||||
{
|
||||
this.receiveUsdtNum = receiveUsdtNum;
|
||||
}
|
||||
|
||||
public BigDecimal getReceiveUsdtNum()
|
||||
{
|
||||
return receiveUsdtNum;
|
||||
}
|
||||
public void setTronNetType(Integer tronNetType)
|
||||
{
|
||||
this.tronNetType = tronNetType;
|
||||
}
|
||||
|
||||
public Integer getTronNetType()
|
||||
{
|
||||
return tronNetType;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setEncryptionAlgorithm(String encryptionAlgorithm)
|
||||
{
|
||||
this.encryptionAlgorithm = encryptionAlgorithm;
|
||||
}
|
||||
|
||||
public String getEncryptionAlgorithm()
|
||||
{
|
||||
return encryptionAlgorithm;
|
||||
}
|
||||
public void setPasswordKdf(String passwordKdf)
|
||||
{
|
||||
this.passwordKdf = passwordKdf;
|
||||
}
|
||||
|
||||
public String getPasswordKdf()
|
||||
{
|
||||
return passwordKdf;
|
||||
}
|
||||
public void setIterations(Long iterations)
|
||||
{
|
||||
this.iterations = iterations;
|
||||
}
|
||||
|
||||
public Long getIterations()
|
||||
{
|
||||
return iterations;
|
||||
}
|
||||
public void setEncryptedMnemonic(String encryptedMnemonic)
|
||||
{
|
||||
this.encryptedMnemonic = encryptedMnemonic;
|
||||
}
|
||||
|
||||
public String getEncryptedMnemonic()
|
||||
{
|
||||
return encryptedMnemonic;
|
||||
}
|
||||
public void setMnemonicNonce(String mnemonicNonce)
|
||||
{
|
||||
this.mnemonicNonce = mnemonicNonce;
|
||||
}
|
||||
|
||||
public String getMnemonicNonce()
|
||||
{
|
||||
return mnemonicNonce;
|
||||
}
|
||||
public void setEncryptedDek(String encryptedDek)
|
||||
{
|
||||
this.encryptedDek = encryptedDek;
|
||||
}
|
||||
|
||||
public String getEncryptedDek()
|
||||
{
|
||||
return encryptedDek;
|
||||
}
|
||||
public void setDekNonce(String dekNonce)
|
||||
{
|
||||
this.dekNonce = dekNonce;
|
||||
}
|
||||
|
||||
public String getDekNonce()
|
||||
{
|
||||
return dekNonce;
|
||||
}
|
||||
public void setKeySalt(String keySalt)
|
||||
{
|
||||
this.keySalt = keySalt;
|
||||
}
|
||||
|
||||
public String getKeySalt()
|
||||
{
|
||||
return keySalt;
|
||||
}
|
||||
public void setPasswordSalt(String passwordSalt)
|
||||
{
|
||||
this.passwordSalt = passwordSalt;
|
||||
}
|
||||
|
||||
public String getPasswordSalt()
|
||||
{
|
||||
return passwordSalt;
|
||||
}
|
||||
public void setPasswordHash(String passwordHash)
|
||||
{
|
||||
this.passwordHash = passwordHash;
|
||||
}
|
||||
|
||||
public String getPasswordHash()
|
||||
{
|
||||
return passwordHash;
|
||||
}
|
||||
public void setRotatedAt(Date rotatedAt)
|
||||
{
|
||||
this.rotatedAt = rotatedAt;
|
||||
}
|
||||
|
||||
public Date getRotatedAt()
|
||||
{
|
||||
return rotatedAt;
|
||||
}
|
||||
public void setTrxNum(BigDecimal trxNum)
|
||||
{
|
||||
this.trxNum = trxNum;
|
||||
}
|
||||
|
||||
public BigDecimal getTrxNum()
|
||||
{
|
||||
return trxNum;
|
||||
}
|
||||
public void setTokenAddress(String tokenAddress)
|
||||
{
|
||||
this.tokenAddress = tokenAddress;
|
||||
}
|
||||
|
||||
public String getTokenAddress()
|
||||
{
|
||||
return tokenAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("payUsdtNum", getPayUsdtNum())
|
||||
.append("receiveUsdtNum", getReceiveUsdtNum())
|
||||
.append("tronNetType", getTronNetType())
|
||||
.append("version", getVersion())
|
||||
.append("encryptionAlgorithm", getEncryptionAlgorithm())
|
||||
.append("passwordKdf", getPasswordKdf())
|
||||
.append("iterations", getIterations())
|
||||
.append("encryptedMnemonic", getEncryptedMnemonic())
|
||||
.append("mnemonicNonce", getMnemonicNonce())
|
||||
.append("encryptedDek", getEncryptedDek())
|
||||
.append("dekNonce", getDekNonce())
|
||||
.append("keySalt", getKeySalt())
|
||||
.append("passwordSalt", getPasswordSalt())
|
||||
.append("passwordHash", getPasswordHash())
|
||||
.append("rotatedAt", getRotatedAt())
|
||||
.append("trxNum", getTrxNum())
|
||||
.append("tokenAddress", getTokenAddress())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
package com.ruoyi.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 全局配置对象 usdt_config
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
@TableName(value = "usdt_config")
|
||||
public class UsdtConfigPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 代付手续费 */
|
||||
@Excel(name = "代付手续费")
|
||||
private BigDecimal payUsdtNum;
|
||||
/** 代收手续费 */
|
||||
@Excel(name = "代收手续费")
|
||||
private BigDecimal receiveUsdtNum;
|
||||
/** 波场网络类型 */
|
||||
@Excel(name = "波场网络类型 0 测试网络, 1 正式网络")
|
||||
private Integer tronNetType;
|
||||
/** 信封版本;配置密码轮换成功后递增 */
|
||||
@Excel(name = "信封版本;配置密码轮换成功后递增")
|
||||
private Long version;
|
||||
/** 助记词和 DEK 使用的加密算法 */
|
||||
@Excel(name = "助记词和 DEK 使用的加密算法")
|
||||
private String encryptionAlgorithm;
|
||||
/** 配置密码派生算法 */
|
||||
@Excel(name = "配置密码派生算法")
|
||||
private String passwordKdf;
|
||||
/** PBKDF2 迭代次数;轮换时按当前安全策略更新 */
|
||||
@Excel(name = "PBKDF2 迭代次数;轮换时按当前安全策略更新")
|
||||
private Long iterations;
|
||||
/** AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词 */
|
||||
@Excel(name = "AES-GCM 加密后的助记词密文,Base64;禁止保存明文助记词")
|
||||
private String encryptedMnemonic;
|
||||
/** 助记词 AES-GCM nonce,Base64,通常为 12 字节 */
|
||||
@Excel(name = "助记词 AES-GCM nonce,Base64,通常为 12 字节")
|
||||
private String mnemonicNonce;
|
||||
/** 由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK */
|
||||
@Excel(name = "由 KEK 包装后的 DEK,Base64;禁止保存明文 DEK")
|
||||
private String encryptedDek;
|
||||
/** DEK AES-GCM nonce,Base64,通常为 12 字节 */
|
||||
@Excel(name = "DEK AES-GCM nonce,Base64,通常为 12 字节")
|
||||
private String dekNonce;
|
||||
/** 配置密码派生 KEK 使用的 salt,Base64 */
|
||||
@Excel(name = "配置密码派生 KEK 使用的 salt,Base64")
|
||||
private String keySalt;
|
||||
/** 配置密码校验哈希使用的独立 salt,Base64 */
|
||||
@Excel(name = "配置密码校验哈希使用的独立 salt,Base64")
|
||||
private String passwordSalt;
|
||||
/** PBKDF2 配置密码校验值,Base64;不是可逆密码 */
|
||||
@Excel(name = "PBKDF2 配置密码校验值,Base64;不是可逆密码")
|
||||
private String passwordHash;
|
||||
/** 最近一次配置密码轮换时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "最近一次配置密码轮换时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date rotatedAt;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "最近一次配置密码轮换时间")
|
||||
private BigDecimal trxNum;
|
||||
/** 主账号地址 */
|
||||
@Excel(name = "主账号地址")
|
||||
private String tokenAddress;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setPayUsdtNum(BigDecimal payUsdtNum)
|
||||
{
|
||||
this.payUsdtNum = payUsdtNum;
|
||||
}
|
||||
|
||||
public BigDecimal getPayUsdtNum()
|
||||
{
|
||||
return payUsdtNum;
|
||||
}
|
||||
public void setReceiveUsdtNum(BigDecimal receiveUsdtNum)
|
||||
{
|
||||
this.receiveUsdtNum = receiveUsdtNum;
|
||||
}
|
||||
|
||||
public BigDecimal getReceiveUsdtNum()
|
||||
{
|
||||
return receiveUsdtNum;
|
||||
}
|
||||
public void setTronNetType(Integer tronNetType)
|
||||
{
|
||||
this.tronNetType = tronNetType;
|
||||
}
|
||||
|
||||
public Integer getTronNetType()
|
||||
{
|
||||
return tronNetType;
|
||||
}
|
||||
public void setVersion(Long version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public Long getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
public void setEncryptionAlgorithm(String encryptionAlgorithm)
|
||||
{
|
||||
this.encryptionAlgorithm = encryptionAlgorithm;
|
||||
}
|
||||
|
||||
public String getEncryptionAlgorithm()
|
||||
{
|
||||
return encryptionAlgorithm;
|
||||
}
|
||||
public void setPasswordKdf(String passwordKdf)
|
||||
{
|
||||
this.passwordKdf = passwordKdf;
|
||||
}
|
||||
|
||||
public String getPasswordKdf()
|
||||
{
|
||||
return passwordKdf;
|
||||
}
|
||||
public void setIterations(Long iterations)
|
||||
{
|
||||
this.iterations = iterations;
|
||||
}
|
||||
|
||||
public Long getIterations()
|
||||
{
|
||||
return iterations;
|
||||
}
|
||||
public void setEncryptedMnemonic(String encryptedMnemonic)
|
||||
{
|
||||
this.encryptedMnemonic = encryptedMnemonic;
|
||||
}
|
||||
|
||||
public String getEncryptedMnemonic()
|
||||
{
|
||||
return encryptedMnemonic;
|
||||
}
|
||||
public void setMnemonicNonce(String mnemonicNonce)
|
||||
{
|
||||
this.mnemonicNonce = mnemonicNonce;
|
||||
}
|
||||
|
||||
public String getMnemonicNonce()
|
||||
{
|
||||
return mnemonicNonce;
|
||||
}
|
||||
public void setEncryptedDek(String encryptedDek)
|
||||
{
|
||||
this.encryptedDek = encryptedDek;
|
||||
}
|
||||
|
||||
public String getEncryptedDek()
|
||||
{
|
||||
return encryptedDek;
|
||||
}
|
||||
public void setDekNonce(String dekNonce)
|
||||
{
|
||||
this.dekNonce = dekNonce;
|
||||
}
|
||||
|
||||
public String getDekNonce()
|
||||
{
|
||||
return dekNonce;
|
||||
}
|
||||
public void setKeySalt(String keySalt)
|
||||
{
|
||||
this.keySalt = keySalt;
|
||||
}
|
||||
|
||||
public String getKeySalt()
|
||||
{
|
||||
return keySalt;
|
||||
}
|
||||
public void setPasswordSalt(String passwordSalt)
|
||||
{
|
||||
this.passwordSalt = passwordSalt;
|
||||
}
|
||||
|
||||
public String getPasswordSalt()
|
||||
{
|
||||
return passwordSalt;
|
||||
}
|
||||
public void setPasswordHash(String passwordHash)
|
||||
{
|
||||
this.passwordHash = passwordHash;
|
||||
}
|
||||
|
||||
public String getPasswordHash()
|
||||
{
|
||||
return passwordHash;
|
||||
}
|
||||
public void setRotatedAt(Date rotatedAt)
|
||||
{
|
||||
this.rotatedAt = rotatedAt;
|
||||
}
|
||||
|
||||
public Date getRotatedAt()
|
||||
{
|
||||
return rotatedAt;
|
||||
}
|
||||
public void setTrxNum(BigDecimal trxNum)
|
||||
{
|
||||
this.trxNum = trxNum;
|
||||
}
|
||||
|
||||
public BigDecimal getTrxNum()
|
||||
{
|
||||
return trxNum;
|
||||
}
|
||||
public void setTokenAddress(String tokenAddress)
|
||||
{
|
||||
this.tokenAddress = tokenAddress;
|
||||
}
|
||||
|
||||
public String getTokenAddress()
|
||||
{
|
||||
return tokenAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("payUsdtNum", getPayUsdtNum())
|
||||
.append("receiveUsdtNum", getReceiveUsdtNum())
|
||||
.append("tronNetType", getTronNetType())
|
||||
.append("version", getVersion())
|
||||
.append("encryptionAlgorithm", getEncryptionAlgorithm())
|
||||
.append("passwordKdf", getPasswordKdf())
|
||||
.append("iterations", getIterations())
|
||||
.append("encryptedMnemonic", getEncryptedMnemonic())
|
||||
.append("mnemonicNonce", getMnemonicNonce())
|
||||
.append("encryptedDek", getEncryptedDek())
|
||||
.append("dekNonce", getDekNonce())
|
||||
.append("keySalt", getKeySalt())
|
||||
.append("passwordSalt", getPasswordSalt())
|
||||
.append("passwordHash", getPasswordHash())
|
||||
.append("rotatedAt", getRotatedAt())
|
||||
.append("trxNum", getTrxNum())
|
||||
.append("tokenAddress", getTokenAddress())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.UsdtConfig;
|
||||
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||
|
||||
/**
|
||||
* 全局配置Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
public interface UsdtConfigMapper extends BaseMapper<UsdtConfigPlus>
|
||||
{
|
||||
/**
|
||||
* 查询全局配置
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 全局配置
|
||||
*/
|
||||
public UsdtConfig selectUsdtConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询全局配置列表
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 全局配置集合
|
||||
*/
|
||||
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 新增全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUsdtConfig(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 修改全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUsdtConfig(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 删除全局配置
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUsdtConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除全局配置
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUsdtConfigByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.ruoyi.system.service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.UsdtConfig;
|
||||
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 全局配置Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
public interface IUsdtConfigService extends IService<UsdtConfigPlus>
|
||||
{
|
||||
|
||||
List<SelectItem> select(String keyword);
|
||||
/**
|
||||
* 查询全局配置
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 全局配置
|
||||
*/
|
||||
public UsdtConfig selectUsdtConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询全局配置列表
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 全局配置集合
|
||||
*/
|
||||
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 新增全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertUsdtConfig(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 修改全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUsdtConfig(UsdtConfig usdtConfig);
|
||||
|
||||
/**
|
||||
* 批量删除全局配置
|
||||
*
|
||||
* @param ids 需要删除的全局配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUsdtConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除全局配置信息
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteUsdtConfigById(Long id);
|
||||
|
||||
List<UsdtConfigPlus> getByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns);
|
||||
|
||||
UsdtConfigPlus getById(Long id, SFunction<UsdtConfigPlus, ?>... columns);
|
||||
|
||||
Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns);
|
||||
|
||||
List<UsdtConfigPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -0,0 +1,203 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
import java.util.HashMap;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.system.mapper.UsdtConfigMapper;
|
||||
import com.ruoyi.system.domain.UsdtConfig;
|
||||
import com.ruoyi.system.domain.UsdtConfigPlus;
|
||||
import com.ruoyi.system.service.IUsdtConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import com.ruoyi.common.select.SelectItem;
|
||||
/**
|
||||
* 全局配置Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2026-10-08
|
||||
*/
|
||||
@Service
|
||||
public class UsdtConfigServiceImpl extends ServiceImpl<UsdtConfigMapper, UsdtConfigPlus> implements IUsdtConfigService
|
||||
{
|
||||
@Autowired
|
||||
private UsdtConfigMapper usdtConfigMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<UsdtConfigPlus> getByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||
.select(columns).in(UsdtConfigPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@Override
|
||||
public List<SelectItem> select(String keyword) {
|
||||
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||
.select(UsdtConfigPlus::getId, UsdtConfigPlus::getName)
|
||||
.like(UsdtConfigPlus::getName, keyword);
|
||||
List<UsdtConfigPlus> list = this.list(lambdaQueryWrapper);
|
||||
List<SelectItem> result =new ArrayList<>();
|
||||
for (UsdtConfigPlus item : list){
|
||||
SelectItem selectItem = new SelectItem();
|
||||
selectItem.setName(item.getName());
|
||||
selectItem.setId(item.getId());
|
||||
result.add(selectItem);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public UsdtConfigPlus getById(Long id, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>()
|
||||
.select(columns).eq(UsdtConfigPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids, SFunction<UsdtConfigPlus, ?>... columns) {
|
||||
List<UsdtConfigPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, UsdtConfigPlus> map = new HashMap<>();
|
||||
for (UsdtConfigPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, UsdtConfigPlus> getMapByIds(List<Long> ids) {
|
||||
List<UsdtConfigPlus> list = this.getByIds(ids);
|
||||
Map<Long, UsdtConfigPlus> map = new HashMap<>();
|
||||
for (UsdtConfigPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UsdtConfigPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<UsdtConfigPlus> lambdaQueryWrapper = new LambdaQueryWrapper<UsdtConfigPlus>().in(UsdtConfigPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from usdt_config ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" usdt_config ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" usdt_config ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询全局配置
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 全局配置
|
||||
*/
|
||||
@Override
|
||||
public UsdtConfig selectUsdtConfigById(Long id)
|
||||
{
|
||||
return usdtConfigMapper.selectUsdtConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全局配置列表
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 全局配置
|
||||
*/
|
||||
@Override
|
||||
public List<UsdtConfig> selectUsdtConfigList(UsdtConfig usdtConfig)
|
||||
{
|
||||
return usdtConfigMapper.selectUsdtConfigList(usdtConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertUsdtConfig(UsdtConfig usdtConfig)
|
||||
{
|
||||
return usdtConfigMapper.insertUsdtConfig(usdtConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改全局配置
|
||||
*
|
||||
* @param usdtConfig 全局配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUsdtConfig(UsdtConfig usdtConfig)
|
||||
{
|
||||
return usdtConfigMapper.updateUsdtConfig(usdtConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除全局配置
|
||||
*
|
||||
* @param ids 需要删除的全局配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUsdtConfigByIds(Long[] ids)
|
||||
{
|
||||
return usdtConfigMapper.deleteUsdtConfigByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除全局配置信息
|
||||
*
|
||||
* @param id 全局配置ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUsdtConfigById(Long id)
|
||||
{
|
||||
return usdtConfigMapper.deleteUsdtConfigById(id);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user