优化
Some checks failed
Build and Deploy / deploy (push) Has been cancelled

This commit is contained in:
2026-03-28 01:10:23 +08:00
parent 730fab6efe
commit 31bc804074
5 changed files with 35 additions and 0 deletions

View File

@@ -81,6 +81,14 @@ public class PointExchangeConfigController {
return success(BeanUtils.toBean(pointExchangeConfig, PointExchangeConfigRespVO.class));
}
@GetMapping("/get-active")
@Operation(summary = "获得当前有效的积分兑换配置")
@PreAuthorize("@ss.hasPermission('muye:point-exchange-config:query')")
public CommonResult<PointExchangeConfigRespVO> getActivePointExchangeConfig() {
PointExchangeConfigDO pointExchangeConfig = pointExchangeConfigService.getActivePointExchangeConfig();
return success(BeanUtils.toBean(pointExchangeConfig, PointExchangeConfigRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得积分兑换配置分页")
@PreAuthorize("@ss.hasPermission('muye:point-exchange-config:query')")

View File

@@ -29,4 +29,14 @@ public interface PointExchangeConfigMapper extends BaseMapperX<PointExchangeConf
.orderByDesc(PointExchangeConfigDO::getId));
}
/**
* 获取当前有效的配置
*/
default PointExchangeConfigDO selectActiveConfig() {
return selectOne(new LambdaQueryWrapperX<PointExchangeConfigDO>()
.eq(PointExchangeConfigDO::getStatus, 1)
.orderByDesc(PointExchangeConfigDO::getId)
.last("LIMIT 1"));
}
}

View File

@@ -61,4 +61,11 @@ public interface PointExchangeConfigService {
*/
PageResult<PointExchangeConfigDO> getPointExchangeConfigPage(PointExchangeConfigPageReqVO pageReqVO);
/**
* 获取当前有效的积分兑换配置
*
* @return 积分兑换配置
*/
PointExchangeConfigDO getActivePointExchangeConfig();
}

View File

@@ -79,4 +79,9 @@ public class PointExchangeConfigServiceImpl implements PointExchangeConfigServic
return pointExchangeConfigMapper.selectPage(pageReqVO);
}
@Override
public PointExchangeConfigDO getActivePointExchangeConfig() {
return pointExchangeConfigMapper.selectActiveConfig();
}
}

View File

@@ -24,6 +24,11 @@ export const PointExchangeConfigApi = {
return await request.get({ url: `/muye/point-exchange-config/get?id=` + id })
},
// 获取当前有效的积分兑换配置
getActivePointExchangeConfig: async () => {
return await request.get({ url: `/muye/point-exchange-config/get-active` })
},
// 新增积分兑换配置
createPointExchangeConfig: async (data: PointExchangeConfig) => {
return await request.post({ url: `/muye/point-exchange-config/create`, data })