From b3757b3024fd83904323eb1c6ba1839c1fcf6c84 Mon Sep 17 00:00:00 2001 From: gxwebsoft Date: Mon, 11 Mar 2024 19:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E5=8F=8B=E6=83=85=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gxwebsoft/cms/controller/WebsiteController.java | 11 +++++++++++ src/main/java/com/gxwebsoft/cms/entity/Website.java | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java b/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java index 87d1946..a54f58e 100644 --- a/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java +++ b/src/main/java/com/gxwebsoft/cms/controller/WebsiteController.java @@ -20,6 +20,8 @@ import com.gxwebsoft.common.core.utils.RedisUtil; import com.gxwebsoft.common.core.web.*; import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.oa.entity.Company; +import com.gxwebsoft.oa.param.LinkParam; +import com.gxwebsoft.oa.service.LinkService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -48,6 +50,8 @@ public class WebsiteController extends BaseController { @Resource private ArticleCategoryService articleCategoryService; @Resource + private LinkService linkService; + @Resource private RedisUtil redisUtil; @ApiOperation("获取网站信息") @@ -77,6 +81,9 @@ public class WebsiteController extends BaseController { JSONObject jsonObject = JSONObject.parseObject(result); final String data = jsonObject.getString("data"); final Company company = JSONObject.parseObject(data, Company.class); + if(company == null){ + return success("站点不存在",null); + } // 创建网站记录 final Website website = new Website(); website.setTenantId(company.getTenantId()); @@ -129,6 +136,10 @@ public class WebsiteController extends BaseController { param.setDeleted(0); param.setStatus(0); website.setCategoryList(articleCategoryService.listRel(param)); + // 读取友情链接 + final LinkParam linkParam = new LinkParam(); + linkParam.setLinkType("友情链接"); + website.setLinks(linkService.listRel(linkParam)); // 授权信息 HashMap config = new HashMap<>(); diff --git a/src/main/java/com/gxwebsoft/cms/entity/Website.java b/src/main/java/com/gxwebsoft/cms/entity/Website.java index 9cbcf6f..178fe5c 100644 --- a/src/main/java/com/gxwebsoft/cms/entity/Website.java +++ b/src/main/java/com/gxwebsoft/cms/entity/Website.java @@ -1,6 +1,7 @@ package com.gxwebsoft.cms.entity; import com.baomidou.mybatisplus.annotation.*; +import com.gxwebsoft.oa.entity.Link; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -34,12 +35,15 @@ public class Website implements Serializable { @ApiModelProperty(value = "网站标识") private String websiteCode; - @ApiModelProperty(value = "网站LOGO") + @ApiModelProperty(value = "网站Icon") private String websiteIcon; - @ApiModelProperty(value = "网站LOGO") + @ApiModelProperty(value = "网站Logo") private String websiteLogo; + @ApiModelProperty(value = "网站Logo(深色模式)") + private String websiteDarkLogo; + @ApiModelProperty(value = "网站类型") private String websiteType; @@ -137,6 +141,10 @@ public class Website implements Serializable { @TableField(exist = false) private List categoryList; + @ApiModelProperty(value = "友情链接") + @TableField(exist = false) + private List links; + @ApiModelProperty(value = "配置信息") @TableField(exist = false) private Object config;