充值兑换码相关接口
This commit is contained in:
parent
f7568202df
commit
81ad6f433c
|
|
@ -43,6 +43,14 @@ public class RechargeRedemptionController {
|
|||
return CzgResult.success(enableConfigService.upEnable(StpKit.USER.getMainShopId(),StpKit.USER.getLoginIdAsLong(), enable, TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关状态
|
||||
*/
|
||||
@GetMapping("/enable/status")
|
||||
public CzgResult<Integer> upEnable() {
|
||||
return CzgResult.success(enableConfigService.detail(StpKit.USER.getMainShopId(), StpKit.USER.getLoginIdAsLong(), TableValueConstant.EnableConfig.Type.RECHARGE_REDEMPTION));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息详情
|
||||
*/
|
||||
|
|
@ -63,7 +71,7 @@ public class RechargeRedemptionController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 配置信息田间
|
||||
* 配置信息添加
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "rechargeRedemption:add", name = "充值兑换配置添加")
|
||||
@PostMapping
|
||||
|
|
|
|||
|
|
@ -13,4 +13,5 @@ import com.czg.market.entity.MkEnableConfig;
|
|||
public interface MkEnableConfigService extends IService<MkEnableConfig> {
|
||||
|
||||
Boolean upEnable(Long mainShopId, Long shopId, Integer enable, TableValueConstant.EnableConfig.Type type);
|
||||
Integer detail(Long mainShopId, Long shopId, TableValueConstant.EnableConfig.Type type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,19 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper, MkEnableConfig> implements MkEnableConfigService{
|
||||
|
||||
@Override
|
||||
public Integer detail(Long mainShopId, Long shopId, TableValueConstant.EnableConfig.Type type) {
|
||||
MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode()));
|
||||
if (one == null) {
|
||||
one = new MkEnableConfig();
|
||||
one.setMainShopId(mainShopId);
|
||||
one.setIsEnable(1);
|
||||
one.setShopId(shopId);
|
||||
save(one);
|
||||
}
|
||||
return one.getIsEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean upEnable(Long mainShopId, Long shopId, Integer enable, TableValueConstant.EnableConfig.Type type) {
|
||||
MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode()));
|
||||
|
|
|
|||
Loading…
Reference in New Issue