diff --git a/src/main/java/com/gxwebsoft/bszx/controller/BszxPayRankingController.java b/src/main/java/com/gxwebsoft/bszx/controller/BszxPayRankingController.java index e33e8d8..6458b32 100644 --- a/src/main/java/com/gxwebsoft/bszx/controller/BszxPayRankingController.java +++ b/src/main/java/com/gxwebsoft/bszx/controller/BszxPayRankingController.java @@ -108,7 +108,6 @@ public class BszxPayRankingController extends BaseController { return success(list); } list.forEach(item -> { - System.out.println("item = " + item); wrapper.clear(); wrapper.eq(BszxPay::getGradeName,item.getGradeName()); wrapper.eq(BszxPay::getClassName, item.getName()); diff --git a/src/main/java/com/gxwebsoft/bszx/service/impl/BszxBmServiceImpl.java b/src/main/java/com/gxwebsoft/bszx/service/impl/BszxBmServiceImpl.java index e739f63..65fef9d 100644 --- a/src/main/java/com/gxwebsoft/bszx/service/impl/BszxBmServiceImpl.java +++ b/src/main/java/com/gxwebsoft/bszx/service/impl/BszxBmServiceImpl.java @@ -68,7 +68,6 @@ public class BszxBmServiceImpl extends ServiceImpl impleme final List bszxClasses = bszxClassService.listRel(classParam); if (!CollectionUtils.isEmpty(bszxClasses)) { BszxClass bszxClass = bszxClasses.get(0); - System.out.println("bszxClass = " + bszxClass); d.setClassId(bszxClass.getId()); d.setBranchId(bszxClass.getBranch()); updateById(d); diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsMainController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsMainController.java index eb60389..d91a6df 100644 --- a/src/main/java/com/gxwebsoft/cms/controller/CmsMainController.java +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsMainController.java @@ -2,8 +2,7 @@ package com.gxwebsoft.cms.controller; import cn.hutool.core.util.ObjectUtil; import com.gxwebsoft.cms.service.CmsWebsiteService; -import com.gxwebsoft.cms.vo.CmsWebsiteVO; -import com.gxwebsoft.common.core.utils.RedisUtil; +import com.gxwebsoft.cms.vo.CmsVO; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; import io.swagger.v3.oas.annotations.Operation; @@ -14,37 +13,29 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** - * 网站信息记录表控制器 + * 网站应用主入口 * * @author 科技小王子 * @since 2024-09-10 20:36:14 */ @Slf4j -@Tag(name = "网站信息记录表管理") +@Tag(name = "网站应用") @RestController @RequestMapping("/api/cms") public class CmsMainController extends BaseController { @Resource private CmsWebsiteService cmsWebsiteService; - @Resource - private RedisUtil redisUtil; - - private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:"; - private static final String MP_INFO_KEY_PREFIX = "MpInfo:"; - private static final String SELECT_PAYMENT_KEY_PREFIX = "SelectPayment:"; - private static final String SYS_DOMAIN_SUFFIX = ".websoft.top"; - private static final String DOMAIN_SUFFIX = ".wsdns.cn"; @Operation(summary = "网站基本信息", description = "获取网站的基本信息,包括配置、导航、设置和过期状态等") @GetMapping("/getSiteInfo") - public ApiResult getSiteInfo() { + public ApiResult getSiteInfo() { try { Integer tenantId = getTenantId(); if (ObjectUtil.isEmpty(tenantId)) { return fail("租户ID不能为空", null); } - CmsWebsiteVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId); + CmsVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId); return success(websiteVO); } catch (IllegalArgumentException e) { return fail(e.getMessage(), null); @@ -56,18 +47,4 @@ public class CmsMainController extends BaseController { } } - @Operation(summary = "清除缓存") - @DeleteMapping("/removeRedisByKey/{key}") - public ApiResult removeRedisByKey(@PathVariable("key") String key) { - // 清除指定key - redisUtil.delete(key); - // 清除缓存 - redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString())); - // 清除小程序缓存 - redisUtil.delete(MP_INFO_KEY_PREFIX.concat(getTenantId().toString())); - // 选择支付方式 - redisUtil.delete(SELECT_PAYMENT_KEY_PREFIX.concat(getTenantId().toString())); - return success("清除成功"); - } - } diff --git a/src/main/java/com/gxwebsoft/cms/controller/CmsWebsiteController.java b/src/main/java/com/gxwebsoft/cms/controller/CmsWebsiteController.java index ff52b48..73d7bd6 100644 --- a/src/main/java/com/gxwebsoft/cms/controller/CmsWebsiteController.java +++ b/src/main/java/com/gxwebsoft/cms/controller/CmsWebsiteController.java @@ -4,7 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import com.gxwebsoft.cms.entity.CmsWebsite; import com.gxwebsoft.cms.param.CmsWebsiteParam; import com.gxwebsoft.cms.service.CmsWebsiteService; -import com.gxwebsoft.cms.vo.CmsWebsiteVO; +import com.gxwebsoft.cms.vo.CmsVO; import com.gxwebsoft.common.core.utils.RedisUtil; import com.gxwebsoft.common.core.web.ApiResult; import com.gxwebsoft.common.core.web.BaseController; @@ -161,14 +161,14 @@ public class CmsWebsiteController extends BaseController { @Operation(summary = "网站基本信息", description = "获取网站的基本信息,包括配置、导航、设置和过期状态等") @GetMapping("/getSiteInfo") - public ApiResult getSiteInfo() { + public ApiResult getSiteInfo() { try { Integer tenantId = getTenantId(); if (ObjectUtil.isEmpty(tenantId)) { return fail("租户ID不能为空", null); } - CmsWebsiteVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId); + CmsVO websiteVO = cmsWebsiteService.getSiteInfo(tenantId); return success(websiteVO); } catch (IllegalArgumentException e) { diff --git a/src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java b/src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java index 0624e81..73c3842 100644 --- a/src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java +++ b/src/main/java/com/gxwebsoft/cms/entity/CmsWebsite.java @@ -244,6 +244,10 @@ public class CmsWebsite implements Serializable { @Schema(description = "租户id") private Integer tenantId; + @Schema(description = "租户名称") + @TableField(exist = false) + private String tenantName; + @Schema(description = "创建时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; diff --git a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsWebsiteMapper.xml b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsWebsiteMapper.xml index 6f46a05..577c1c6 100644 --- a/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsWebsiteMapper.xml +++ b/src/main/java/com/gxwebsoft/cms/mapper/xml/CmsWebsiteMapper.xml @@ -4,8 +4,9 @@ - SELECT a.* + SELECT a.*, b.tenant_name as tenantName FROM cms_website a + LEFT JOIN gxwebsoft_core.sys_tenant b ON a.tenant_id = b.tenant_id AND a.website_id = #{param.websiteId} @@ -177,8 +178,9 @@