From 05ce81ee4babaa95d44318ebcdc1d7cc6d0f7dfe Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 16 Oct 2023 14:30:47 +0800 Subject: [PATCH] 一个商品领取一张卷, --- src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java b/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java index b3e0dec..f6444ee 100644 --- a/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java +++ b/src/main/java/cc/mrbird/febs/mall/controller/AdminSystemController.java @@ -5,6 +5,7 @@ import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; import cc.mrbird.febs.mall.dto.AdminAgentAmountDto; import cc.mrbird.febs.mall.dto.AdminAgentDetailDto; +import cc.mrbird.febs.mall.dto.AdminIndexVideoDto; import cc.mrbird.febs.mall.dto.CashOutSettingDto; import cc.mrbird.febs.mall.entity.DataDictionaryCustom; import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; @@ -22,6 +23,8 @@ import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; import java.util.Map; @Slf4j @@ -132,4 +135,43 @@ dataDictionaryCustomMapper.updateById(dic); return new FebsResponse().success(); } + + @PostMapping(value = "/indexVideoSet") + public FebsResponse indexVideoSet(AdminIndexVideoDto adminIndexVideoDto) { + DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( + DataDictionaryEnum.VIDEO_URL_INDEX.getType(), + DataDictionaryEnum.VIDEO_URL_INDEX.getCode() + ); + if(ObjectUtil.isEmpty(dic)){ + return new FebsResponse().fail().message("请刷新页面重试"); + } + dic.setValue(adminIndexVideoDto.getVideoUrl()); + dataDictionaryCustomMapper.updateById(dic); + return new FebsResponse().success(); + } + +// public static void main(String[] args) { +// List<Integer> lines = Arrays.asList(new Integer[]{1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0}); +// //数字连续出现的计数 +// Integer symbol = 0; +// //数字连续出现的次数限制 +// Integer times = 3; +// //出现的数字 +// Integer symbolNum = 1; +// //满足规则的次数 +// Integer timesOneSign = 0; +// for(int i=0;i<lines.size();i++){ +// if(symbolNum == lines.get(i)){ +// symbol = symbol + 1; +// if(symbol >= times){ +// timesOneSign = timesOneSign + 1; +// symbol = 0; +// } +// }else{ +// symbol = 0; +// } +// } +// +// System.out.println(timesOneSign); +// } } -- Gitblit v1.9.1