支持礼物权重单独编辑

This commit is contained in:
hy001 2026-05-19 20:23:23 +08:00
parent 527a0b916d
commit e3942ff651
3 changed files with 47 additions and 22 deletions

View File

@ -53,11 +53,18 @@ public class SysGiftConfigRestController extends BaseController {
@OpsOperationReqLog(value = "修改礼物信息")
@PutMapping
public void updateGift(@RequestBody SysGiftConfigCO param) {
param.setUpdateUser(getReqUserId());
sysGiftConfigService.updateGift(param);
}
public void updateGift(@RequestBody SysGiftConfigCO param) {
param.setUpdateUser(getReqUserId());
sysGiftConfigService.updateGift(param);
}
@OpsOperationReqLog(value = "修改礼物排序权重")
@PutMapping("/sort")
public void updateGiftSort(@RequestBody SysGiftConfigCO param) {
param.setUpdateUser(getReqUserId());
sysGiftConfigService.updateGiftSort(param);
}
@OpsOperationReqLog(value = "新增礼物信息")
@PostMapping
public void addGift(@RequestBody SysGiftConfigCO param) {

View File

@ -83,10 +83,10 @@ public class SysGiftConfigServiceImpl implements SysGiftConfigService {
}
@Override
public void updateGift(SysGiftConfigCO param) {
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getId());
GiftConfigDTO orlGiftConfig = ResponseAssert.requiredSuccess(
giftConfigClient.getById(param.getId()));
public void updateGift(SysGiftConfigCO param) {
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getId());
GiftConfigDTO orlGiftConfig = ResponseAssert.requiredSuccess(
giftConfigClient.getById(param.getId()));
ResponseAssert.notNull(GiftErrorCode.GIFT_NOT_FOUND, orlGiftConfig);
GiftConfigDTO newGiftConfig = getGiftConfig(param);
if (StringUtils.isNotBlank(param.getAccount())){
@ -99,12 +99,25 @@ public class SysGiftConfigServiceImpl implements SysGiftConfigService {
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
ResponseAssert.requiredSuccess(giftConfigClient.updateGift(newGiftConfig)));
giftConfigClient.removeGiftCache();
removeRemainingInventory(orlGiftConfig, newGiftConfig);
}
@Override
public void addGift(SysGiftConfigCO param) {
removeRemainingInventory(orlGiftConfig, newGiftConfig);
}
@Override
public void updateGiftSort(SysGiftConfigCO param) {
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getId());
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getSort());
GiftConfigDTO giftConfig = ResponseAssert.requiredSuccess(
giftConfigClient.getById(param.getId()));
ResponseAssert.notNull(GiftErrorCode.GIFT_NOT_FOUND, giftConfig);
giftConfig.setSort(param.getSort());
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
ResponseAssert.requiredSuccess(giftConfigClient.updateGift(giftConfig)));
giftConfigClient.removeGiftCache();
}
@Override
public void addGift(SysGiftConfigCO param) {
GiftConfigDTO giftConfig = getGiftConfig(param);
if (GiftTabEnum.EXCLUSIVE.equals(param.getGiftTab())) {
UserProfileDTO userProfile = userProfileClient.getByAccount(param.getSysOrigin(),

View File

@ -25,13 +25,18 @@ public interface SysGiftConfigService {
*/
PageResult<SysGiftConfigCO> pageGiftInfo(GiftConsoleQryCmd query);
/**
* 修改礼物信息.
*/
void updateGift(SysGiftConfigCO param);
/**
* 新增礼物信息.
/**
* 修改礼物信息.
*/
void updateGift(SysGiftConfigCO param);
/**
* 修改礼物排序权重.
*/
void updateGiftSort(SysGiftConfigCO param);
/**
* 新增礼物信息.
*/
void addGift(SysGiftConfigCO param);