From 89ff1a52320315f24912b58e4e025e35237cf367 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 11 十二月 2024 17:54:36 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java | 35 ++++++++++++++++++++++++++++++----- 1 files changed, 30 insertions(+), 5 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java index 53ff538..7f4830b 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/SystemConfigController.java @@ -6,9 +6,8 @@ import com.ruoyi.common.core.domain.R; import com.ruoyi.other.api.domain.SystemConfig; import com.ruoyi.other.api.dto.IndexConfigSetDto; +import com.ruoyi.other.api.dto.StartPageSetDto; import com.ruoyi.other.service.SystemConfigService; -import org.springframework.web.bind.annotation.*; -import io.swagger.annotations.Api; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.ApiOperation; @@ -29,7 +28,7 @@ @Resource private SystemConfigService systemConfigService; @PostMapping("/index/add") - @ApiOperation(value = "添加", tags = {"后台-广告管理-首页配置"}) + @ApiOperation(value = "添加", tags = {"后台管理-广告管理-首页配置"}) public R add(@RequestBody IndexConfigSetDto indexConfigSetDto){ //先删除type=2的数据 List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).list(); @@ -40,8 +39,8 @@ systemConfigService.save(systemConfig); return R.ok(); } - @PostMapping("/index/detail") - @ApiOperation(value = "宣传图片-公司简介", tags = {"后台-广告管理-首页配置","小程序-首页"}) + @GetMapping("/index/detail") + @ApiOperation(value = "宣传图片-公司简介", tags = {"后台管理-广告管理-首页配置","小程序-首页"}) public R<IndexConfigSetDto> detail(){ SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 2).one(); if (one==null){ @@ -65,5 +64,31 @@ return R.ok(one); } + @GetMapping("/index/start") + @ApiOperation(value = "宣传图片-公司简介", tags = {"小程序-启动页"}) + public R<StartPageSetDto> indexstart(){ + SystemConfig one = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 1).one(); + if (one==null){ + return R.ok(); + } + StartPageSetDto indexConfigSetDto = JSONObject.parseObject(one.getContent(), StartPageSetDto.class); + return R.ok(indexConfigSetDto); + + } + + @PostMapping("/startPage/add") + @ApiOperation(value = "添加", tags = {"后台管理-广告管理-启动页管理"}) + public R startPageadd(@RequestBody StartPageSetDto startPageSetDto){ + //先删除type=1的数据 + List<SystemConfig> list = systemConfigService.lambdaQuery().eq(SystemConfig::getType, 1).list(); + systemConfigService.removeBatchByIds(list); + SystemConfig systemConfig = new SystemConfig(); + systemConfig.setType(1); + systemConfig.setContent(JSON.toJSONString(startPageSetDto)); + systemConfigService.save(systemConfig); + return R.ok(); + } + + } -- Gitblit v1.7.1