From db7fa6a91b9534ac90e219b6f554c54c43c83a5a Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期三, 16 八月 2023 09:28:15 +0800 Subject: [PATCH] update --- driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/ImgController.java | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/ImgController.java b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/ImgController.java index 3076392..5e864b3 100644 --- a/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/ImgController.java +++ b/driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/api/ImgController.java @@ -1,10 +1,14 @@ package com.supersavedriving.driver.modular.system.api; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.supersavedriving.driver.core.common.annotion.ServiceLog; import com.supersavedriving.driver.core.util.ToolUtil; import com.supersavedriving.driver.modular.system.model.Img; +import com.supersavedriving.driver.modular.system.model.SystemConfig; import com.supersavedriving.driver.modular.system.service.IImgService; +import com.supersavedriving.driver.modular.system.service.ISystemConfigService; import com.supersavedriving.driver.modular.system.util.ResultUtil; import com.supersavedriving.driver.modular.system.warpper.BaseWarpper; import com.supersavedriving.driver.modular.system.warpper.ResponseWarpper; @@ -24,6 +28,9 @@ @Autowired private IImgService imgService; + @Autowired + private ISystemConfigService systemConfigService; + @ResponseBody @@ -38,13 +45,20 @@ return ResponseWarpper.success(ResultUtil.paranErr("type")); } try { - List<Img> imgs = imgService.selectList(new EntityWrapper<Img>().eq("type", type)); List<BaseWarpper> list = new ArrayList<>(); - for (Img img : imgs) { - BaseWarpper baseWarpper = new BaseWarpper(); - baseWarpper.setId(img.getId().longValue()); - baseWarpper.setPath(img.getImg()); - list.add(baseWarpper); + SystemConfig systemConfig = systemConfigService.selectOne(new EntityWrapper<SystemConfig>().eq("type", 8)); + if(null != systemConfig) { + JSONObject jsonObject1 = JSON.parseObject(systemConfig.getContent()); + Integer num2 = jsonObject1.getInteger("num2");//启动页开关 + if(1 == num2){ + List<Img> imgs = imgService.selectList(new EntityWrapper<Img>().eq("type", type)); + for (Img img : imgs) { + BaseWarpper baseWarpper = new BaseWarpper(); + baseWarpper.setId(img.getId().longValue()); + baseWarpper.setPath(img.getImg()); + list.add(baseWarpper); + } + } } return ResponseWarpper.success(list); }catch (Exception e){ -- Gitblit v1.7.1