支持礼物权重单独编辑
This commit is contained in:
parent
527a0b916d
commit
e3942ff651
@ -53,11 +53,18 @@ public class SysGiftConfigRestController extends BaseController {
|
|||||||
|
|
||||||
@OpsOperationReqLog(value = "修改礼物信息")
|
@OpsOperationReqLog(value = "修改礼物信息")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public void updateGift(@RequestBody SysGiftConfigCO param) {
|
public void updateGift(@RequestBody SysGiftConfigCO param) {
|
||||||
param.setUpdateUser(getReqUserId());
|
param.setUpdateUser(getReqUserId());
|
||||||
sysGiftConfigService.updateGift(param);
|
sysGiftConfigService.updateGift(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OpsOperationReqLog(value = "修改礼物排序权重")
|
||||||
|
@PutMapping("/sort")
|
||||||
|
public void updateGiftSort(@RequestBody SysGiftConfigCO param) {
|
||||||
|
param.setUpdateUser(getReqUserId());
|
||||||
|
sysGiftConfigService.updateGiftSort(param);
|
||||||
|
}
|
||||||
|
|
||||||
@OpsOperationReqLog(value = "新增礼物信息")
|
@OpsOperationReqLog(value = "新增礼物信息")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public void addGift(@RequestBody SysGiftConfigCO param) {
|
public void addGift(@RequestBody SysGiftConfigCO param) {
|
||||||
|
|||||||
@ -83,10 +83,10 @@ public class SysGiftConfigServiceImpl implements SysGiftConfigService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGift(SysGiftConfigCO param) {
|
public void updateGift(SysGiftConfigCO param) {
|
||||||
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getId());
|
ResponseAssert.notNull(GiftErrorCode.BAD_REQUEST, param.getId());
|
||||||
GiftConfigDTO orlGiftConfig = ResponseAssert.requiredSuccess(
|
GiftConfigDTO orlGiftConfig = ResponseAssert.requiredSuccess(
|
||||||
giftConfigClient.getById(param.getId()));
|
giftConfigClient.getById(param.getId()));
|
||||||
ResponseAssert.notNull(GiftErrorCode.GIFT_NOT_FOUND, orlGiftConfig);
|
ResponseAssert.notNull(GiftErrorCode.GIFT_NOT_FOUND, orlGiftConfig);
|
||||||
GiftConfigDTO newGiftConfig = getGiftConfig(param);
|
GiftConfigDTO newGiftConfig = getGiftConfig(param);
|
||||||
if (StringUtils.isNotBlank(param.getAccount())){
|
if (StringUtils.isNotBlank(param.getAccount())){
|
||||||
@ -99,12 +99,25 @@ public class SysGiftConfigServiceImpl implements SysGiftConfigService {
|
|||||||
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
|
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
|
||||||
ResponseAssert.requiredSuccess(giftConfigClient.updateGift(newGiftConfig)));
|
ResponseAssert.requiredSuccess(giftConfigClient.updateGift(newGiftConfig)));
|
||||||
giftConfigClient.removeGiftCache();
|
giftConfigClient.removeGiftCache();
|
||||||
|
|
||||||
removeRemainingInventory(orlGiftConfig, newGiftConfig);
|
removeRemainingInventory(orlGiftConfig, newGiftConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addGift(SysGiftConfigCO param) {
|
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);
|
GiftConfigDTO giftConfig = getGiftConfig(param);
|
||||||
if (GiftTabEnum.EXCLUSIVE.equals(param.getGiftTab())) {
|
if (GiftTabEnum.EXCLUSIVE.equals(param.getGiftTab())) {
|
||||||
UserProfileDTO userProfile = userProfileClient.getByAccount(param.getSysOrigin(),
|
UserProfileDTO userProfile = userProfileClient.getByAccount(param.getSysOrigin(),
|
||||||
|
|||||||
@ -25,13 +25,18 @@ public interface SysGiftConfigService {
|
|||||||
*/
|
*/
|
||||||
PageResult<SysGiftConfigCO> pageGiftInfo(GiftConsoleQryCmd query);
|
PageResult<SysGiftConfigCO> pageGiftInfo(GiftConsoleQryCmd query);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改礼物信息.
|
* 修改礼物信息.
|
||||||
*/
|
*/
|
||||||
void updateGift(SysGiftConfigCO param);
|
void updateGift(SysGiftConfigCO param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增礼物信息.
|
* 修改礼物排序权重.
|
||||||
|
*/
|
||||||
|
void updateGiftSort(SysGiftConfigCO param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增礼物信息.
|
||||||
*/
|
*/
|
||||||
void addGift(SysGiftConfigCO param);
|
void addGift(SysGiftConfigCO param);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user