读取友情链接数据

This commit is contained in:
gxwebsoft
2024-03-11 19:45:33 +08:00
parent 2a909fef9c
commit b3757b3024
2 changed files with 21 additions and 2 deletions
@@ -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<String, Object> config = new HashMap<>();
@@ -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<ArticleCategory> categoryList;
@ApiModelProperty(value = "友情链接")
@TableField(exist = false)
private List<Link> links;
@ApiModelProperty(value = "配置信息")
@TableField(exist = false)
private Object config;