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;