package com.ruoyi.system.controller; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.select.Ids; import com.ruoyi.common.select.SelectItem; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.system.domain.RentCredential; import com.ruoyi.system.domain.RentCredentialPlus; import com.ruoyi.system.service.IRentCredentialService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 商户及节点统一HMAC凭证版本;不含RSAController * * @author luqj * @date 2026-10-22 */ @RestController @RequestMapping("/system/rentCredential") public class RentCredentialController extends BaseController { @Autowired private IRentCredentialService rentCredentialService; @PreAuthorize("@ss.hasPermi('system:rentCredential:getByIds')") @PostMapping("/getByIds") public AjaxResult getByIds(@RequestBody Ids ids) { List list = rentCredentialService.getByIds(ids.getLongIds(),RentCredentialPlus::getApiKey,RentCredentialPlus::getId); return AjaxResult.success(list); } @PreAuthorize("@ss.hasPermi('system:rentCredential:select')") @GetMapping("/select") public AjaxResult select(String keyword) { List list = rentCredentialService.select(keyword); return AjaxResult.success(list); } /** * 查询商户及节点统一HMAC凭证版本;不含RSA列表 */ @PreAuthorize("@ss.hasPermi('system:rentCredential:list')") @GetMapping("/list") public TableDataInfo list(RentCredential rentCredential) { startPage(); List list = rentCredentialService.selectRentCredentialList(rentCredential); return getDataTable(list); } /** * 导出商户及节点统一HMAC凭证版本;不含RSA列表 */ @PreAuthorize("@ss.hasPermi('system:rentCredential:export')") @Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(RentCredential rentCredential) { List list = rentCredentialService.selectRentCredentialList(rentCredential); ExcelUtil util = new ExcelUtil(RentCredential.class); return util.exportExcel(list, "rentCredential"); } /** * 获取商户及节点统一HMAC凭证版本;不含RSA详细信息 */ @PreAuthorize("@ss.hasPermi('system:rentCredential:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return AjaxResult.success(rentCredentialService.selectRentCredentialById(id)); } /** * 新增商户及节点统一HMAC凭证版本;不含RSA */ @PreAuthorize("@ss.hasPermi('system:rentCredential:add')") @Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody RentCredential rentCredential) { return toAjax(rentCredentialService.insertRentCredential(rentCredential)); } /** * 修改商户及节点统一HMAC凭证版本;不含RSA */ @PreAuthorize("@ss.hasPermi('system:rentCredential:edit')") @Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody RentCredential rentCredential) { return toAjax(rentCredentialService.updateRentCredential(rentCredential)); } /** * 删除商户及节点统一HMAC凭证版本;不含RSA */ @PreAuthorize("@ss.hasPermi('system:rentCredential:remove')") @Log(title = "商户及节点统一HMAC凭证版本;不含RSA", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(rentCredentialService.deleteRentCredentialByIds(ids)); } }