forked from Gitlink/microservices
Merge branch 'master' into hot_fix
This commit is contained in:
commit
72f5dce1cf
|
|
@ -9,7 +9,7 @@ server_name=$3
|
|||
# 使用说明,用来提示输入参数
|
||||
usage() {
|
||||
echo -e "\e[91m错误:必须传入环境参数 \e[0m"
|
||||
echo "Usage: sh auto_redeploy.sh [test|prod] [modules|front]"
|
||||
echo "Usage: sh auto_redeploy.sh [test|prod] [modules|zone_front]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -64,12 +64,12 @@ modules(){
|
|||
check_success gitlink-modules-zone
|
||||
}
|
||||
|
||||
front(){
|
||||
zone_front(){
|
||||
echo "自动部署前端"
|
||||
echo "进行前端编译"
|
||||
./build.sh "$current_env" build_front
|
||||
./build.sh "$current_env" build_zone_front
|
||||
echo "拷贝前端文件"
|
||||
./copy.sh "$current_env" copy_front
|
||||
./copy.sh "$current_env" copy_zone_front
|
||||
docker restart gitlink-nginx
|
||||
}
|
||||
zone(){
|
||||
|
|
@ -293,8 +293,8 @@ case "$2" in
|
|||
"modules")
|
||||
modules
|
||||
;;
|
||||
"front")
|
||||
front
|
||||
"zone_front")
|
||||
zone_front
|
||||
;;
|
||||
"zone")
|
||||
zone
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ env=$1
|
|||
# 使用说明,用来提示输入参数
|
||||
usage() {
|
||||
echo -e "\e[91m错误:必须传入环境和方法两个参数 \e[0m"
|
||||
echo "Usage: sh build.sh [test|prod] [build_base_image|gen_nginx_config|gen_nacos_sql|gen_gitlink_sql|gen_docker_compose|gen_dockerfile|build_maven|build_front]"
|
||||
echo "Usage: sh build.sh [test|prod] [build_base_image|gen_nacos_config|gen_nginx_config|gen_nacos_sql|gen_gitlink_sql|gen_docker_compose|gen_dockerfile|build_maven|build_zone_front]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ build_maven(){
|
|||
}
|
||||
|
||||
# 微服务模块编译
|
||||
build_front(){
|
||||
build_zone_front(){
|
||||
cd "${orgin_path}"/..
|
||||
#判断前端项目文件夹是否已创建
|
||||
if [ ! -d "ruoyi-react" ]; then
|
||||
|
|
@ -234,8 +234,8 @@ case "$2" in
|
|||
"build_maven")
|
||||
build_maven
|
||||
;;
|
||||
"build_front")
|
||||
build_front
|
||||
"build_zone_front")
|
||||
build_zone_front
|
||||
;;
|
||||
"test")
|
||||
test1
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
current_env=$1
|
||||
# 复制项目的文件到对应docker路径,便于一键生成镜像。
|
||||
usage() {
|
||||
echo "Usage: sh copy.sh [test|prod] [copy_jar|copy_config|copy_sql|copy_front|copy_all]"
|
||||
echo "Usage: sh copy.sh [test|prod] [copy_jar|copy_config|copy_sql|copy_zone_front|copy_all]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
@ -74,16 +74,16 @@ copy_sql(){
|
|||
mkdir -p "${docker_data}"/gitlink/mysql/
|
||||
cp ./nacos/sql/gitlink-nacos-config.sql "${docker_data}"/gitlink/mysql/gitlink-nacos-config.sql
|
||||
}
|
||||
copy_front(){
|
||||
copy_zone_front(){
|
||||
# copy 前端文件
|
||||
echo "begin copy front file "
|
||||
rm -rf "${docker_data}"/gitlink/nginx/html/dist
|
||||
echo "begin copy zone front file "
|
||||
rm -rf "${docker_data}"/gitlink/nginx/html/zone_admin
|
||||
mkdir -p "${docker_data}"/gitlink/nginx/html/
|
||||
cp -r ../ruoyi-react/dist "${docker_data}"/gitlink/nginx/html/dist
|
||||
cp -r ../ruoyi-react/dist "${docker_data}"/gitlink/nginx/html/zone_admin
|
||||
}
|
||||
copy_all(){
|
||||
copy_jar
|
||||
copy_front
|
||||
copy_zone_front
|
||||
}
|
||||
|
||||
case "$current_env" in
|
||||
|
|
@ -131,8 +131,8 @@ case "$2" in
|
|||
"copy_sql")
|
||||
copy_sql
|
||||
;;
|
||||
"copy_front")
|
||||
copy_front
|
||||
"copy_zone_front")
|
||||
copy_zone_front
|
||||
;;
|
||||
"copy_all")
|
||||
copy_all
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ services:
|
|||
- "#mapping_gateway_port:#mapping_gateway_port"
|
||||
- "#mapping_nacos_port:8848"
|
||||
volumes:
|
||||
- #docker_data/gitlink/nginx/html/dist:/home/gitlink/projects/gitlink-ui
|
||||
- #docker_data/gitlink/nginx/html/:/home/gitlink/projects/
|
||||
- #docker_data/gitlink/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
||||
- #docker_data/gitlink/nginx/logs:/var/log/nginx
|
||||
- #docker_data/gitlink/nginx/conf.d:/etc/nginx/conf.d
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ http {
|
|||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /home/gitlink/projects/gitlink-ui;
|
||||
root /home/gitlink/projects/zone_admin;
|
||||
try_files $uri $uri/ /index.html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ FROM nginx
|
|||
MAINTAINER gitlink
|
||||
|
||||
# 挂载目录
|
||||
VOLUME /home/gitlink/projects/gitlink-ui
|
||||
VOLUME /home/gitlink/projects
|
||||
# 创建目录
|
||||
RUN mkdir -p /home/gitlink/projects/gitlink-ui
|
||||
RUN mkdir -p /home/gitlink/projects
|
||||
# 指定路径
|
||||
WORKDIR /home/gitlink/projects/gitlink-ui
|
||||
WORKDIR /home/gitlink/projects
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ spring:
|
|||
name: ruoyi-cms
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: zone
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ spring:
|
|||
name: ruoyi-system
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: zone
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.zone.dataset.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 特色专区资源聚合对象 zone_resource
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-06-27
|
||||
*/
|
||||
@Data
|
||||
public class ZoneDataSet {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.ruoyi.zone.dataset.domain.vo;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.core.utils.html.EscapeUtil;
|
||||
import com.ruoyi.zone.project.domain.vo.ZoneProjectDataVo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("项目聚合数据对象")
|
||||
public class ZoneDataSetProjectVo {
|
||||
@ApiModelProperty(value = "数据集名称")
|
||||
private String dataSetName;
|
||||
@ApiModelProperty(value = "数据集描述")
|
||||
private String dataSetDescription;
|
||||
@ApiModelProperty(value = "项目聚合Id")
|
||||
private Long id;
|
||||
@ApiModelProperty(value = "代码库Id")
|
||||
private Long repositoryId;
|
||||
@ApiModelProperty(value = "代码库名称")
|
||||
private String repositoryName;
|
||||
@ApiModelProperty(value = "代码库标识")
|
||||
private String repositoryFullName;
|
||||
@ApiModelProperty(value = "代码库地址")
|
||||
private String repositoryUrl;
|
||||
@ApiModelProperty(value = "项目数据集地址")
|
||||
private String dataSetUrl;
|
||||
|
||||
public ZoneDataSetProjectVo() {
|
||||
}
|
||||
|
||||
public ZoneDataSetProjectVo(ZoneProjectDataVo projectDataVo, String gitLinkUrl) {
|
||||
this.id = projectDataVo.getId();
|
||||
JSONObject projectProperties = projectDataVo.getProjectProperties();
|
||||
if (projectProperties != null) {
|
||||
if (projectProperties.containsKey("name")) {
|
||||
this.repositoryName = projectProperties.getString("name");
|
||||
}
|
||||
if (projectProperties.containsKey("fullName")) {
|
||||
this.repositoryFullName = projectProperties.getString("fullName");
|
||||
this.repositoryUrl = EscapeUtil.removeExtraSlashOfUrl(String.format("%s/%s", gitLinkUrl, this.repositoryFullName));
|
||||
this.dataSetUrl = EscapeUtil.removeExtraSlashOfUrl(String.format("%s/dataset", this.repositoryUrl));
|
||||
}
|
||||
if (projectProperties.containsKey("repositoryId")) {
|
||||
this.repositoryId = projectProperties.getLong("repositoryId");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ruoyi.zone.dataset.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.zone.dataset.domain.vo.ZoneDataSetProjectVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特色专区资源聚合Service接口
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-06-27
|
||||
*/
|
||||
public interface IZoneDataSetService {
|
||||
|
||||
/**
|
||||
* 获取特色专区数据集项目列表
|
||||
*
|
||||
* @return 项目列表
|
||||
*/
|
||||
List<ZoneDataSetProjectVo> getDataSetProjectList(Long zoneId, String search);
|
||||
|
||||
/**
|
||||
* 获取特色专区聚合项目对应数据集详情
|
||||
*
|
||||
* @param projectId 项目聚合id
|
||||
* @param page
|
||||
* @param limit
|
||||
* @return 数据集详情
|
||||
*/
|
||||
JSONObject getDataSetDetail(Long projectId, Integer page, Integer limit);
|
||||
}
|
||||
|
|
@ -0,0 +1,110 @@
|
|||
package com.ruoyi.zone.dataset.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.page.GenericsTableDataInfo;
|
||||
import com.ruoyi.common.httpClient.util.GitLinkRequestHelper;
|
||||
import com.ruoyi.zone.dataset.domain.vo.ZoneDataSetProjectVo;
|
||||
import com.ruoyi.zone.dataset.service.IZoneDataSetService;
|
||||
import com.ruoyi.zone.project.domain.vo.ZoneProjectDataVo;
|
||||
import com.ruoyi.zone.project.domain.vo.ZoneProjectSearchVo;
|
||||
import com.ruoyi.zone.project.service.IZoneProjectService;
|
||||
import com.ruoyi.zone.utils.ZoneGitLinkRequestUrl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 特色专区资源聚合Service业务层处理
|
||||
*
|
||||
* @author otto
|
||||
* @date 2023-06-27
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ZoneDataSetServiceImpl implements IZoneDataSetService {
|
||||
@Autowired
|
||||
IZoneProjectService projectService;
|
||||
@Autowired
|
||||
GitLinkRequestHelper gitLinkRequestHelper;
|
||||
|
||||
@Override
|
||||
public List<ZoneDataSetProjectVo> getDataSetProjectList(Long zoneId, String search) {
|
||||
List<ZoneDataSetProjectVo> projectVoList = getZoneDataSetProjectVos(zoneId);
|
||||
if (projectVoList.isEmpty()) {
|
||||
return projectVoList;
|
||||
}
|
||||
// 获取存在数据集的项目id列表
|
||||
String projectIds = projectVoList.stream().map(x -> x.getRepositoryId().toString()).collect(Collectors.joining(","));
|
||||
// 根据项目id列表获取数据集列表
|
||||
JSONObject projectDataSets = gitLinkRequestHelper.doGet(
|
||||
ZoneGitLinkRequestUrl.PROJECT_DATASETS(projectIds)
|
||||
);
|
||||
List<ZoneDataSetProjectVo> projectDataSetList = new ArrayList<>();
|
||||
JSONArray projectDataSetArray = projectDataSets.getJSONArray("project_datasets");
|
||||
for (int i = 0; i < projectDataSetArray.size(); i++) {
|
||||
JSONObject projectDataSet = projectDataSetArray.getJSONObject(i);
|
||||
if (projectDataSet.containsKey("project")) {
|
||||
JSONObject project = projectDataSet.getJSONObject("project");
|
||||
if (project.containsKey("id")) {
|
||||
ZoneDataSetProjectVo zoneDataSetProjectVo = projectVoList
|
||||
.stream()
|
||||
.filter(x -> x.getRepositoryId().equals(project.getLong("id")))
|
||||
.findFirst().orElse(null);
|
||||
if (zoneDataSetProjectVo != null) {
|
||||
zoneDataSetProjectVo.setDataSetName(projectDataSet.getString("title"));
|
||||
zoneDataSetProjectVo.setDataSetDescription(projectDataSet.getString("description"));
|
||||
projectDataSetList.add(zoneDataSetProjectVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 根据搜索条件进行筛选
|
||||
return projectDataSetList.stream().filter(x -> {
|
||||
if (StringUtils.isNotEmpty(search)) {
|
||||
return x.getDataSetName().toLowerCase().contains(search.toLowerCase());
|
||||
}
|
||||
return true;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private List<ZoneDataSetProjectVo> getZoneDataSetProjectVos(Long zoneId) {
|
||||
ZoneProjectSearchVo searchVo = new ZoneProjectSearchVo();
|
||||
searchVo.setZoneId(zoneId);
|
||||
GenericsTableDataInfo<ZoneProjectDataVo> zoneProjectDataVoTable
|
||||
= projectService.selectZoneProjectList(searchVo, true);
|
||||
List<ZoneDataSetProjectVo> projectVoList = new ArrayList<>();
|
||||
if (zoneProjectDataVoTable != null) {
|
||||
List<ZoneProjectDataVo> projectDataVoList = zoneProjectDataVoTable.getRows();
|
||||
for (ZoneProjectDataVo projectDataVo : projectDataVoList) {
|
||||
// 获取有数据集的项目列表
|
||||
if (projectDataVo.getHasDataset()) {
|
||||
ZoneDataSetProjectVo zoneDataSetProjectVo = new ZoneDataSetProjectVo(projectDataVo, gitLinkRequestHelper.gitLinkUrl);
|
||||
projectVoList.add(zoneDataSetProjectVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return projectVoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getDataSetDetail(Long projectId, Integer page, Integer limit) {
|
||||
ZoneProjectDataVo zoneProjectDataVo = projectService.selectZoneProjectDataById(projectId);
|
||||
ZoneDataSetProjectVo zoneDataSetProjectVo = new ZoneDataSetProjectVo(zoneProjectDataVo, gitLinkRequestHelper.gitLinkUrl);
|
||||
if (StringUtils.isNotEmpty(zoneDataSetProjectVo.getRepositoryFullName())) {
|
||||
JSONObject dataSetDetail = gitLinkRequestHelper.doGet(
|
||||
ZoneGitLinkRequestUrl.DATASET(zoneDataSetProjectVo.getRepositoryFullName(), page, limit)
|
||||
);
|
||||
dataSetDetail.put("repository_url", zoneDataSetProjectVo.getRepositoryUrl());
|
||||
dataSetDetail.put("dataset_url", zoneDataSetProjectVo.getDataSetUrl());
|
||||
return dataSetDetail;
|
||||
}
|
||||
throw new ServiceException("获取项目聚合对应的数据集失败");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ruoyi.zone.detail.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -8,6 +9,8 @@ import com.ruoyi.common.core.web.page.GenericsTableDataInfo;
|
|||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.system.api.domain.SysUser;
|
||||
import com.ruoyi.zone.dataset.domain.vo.ZoneDataSetProjectVo;
|
||||
import com.ruoyi.zone.dataset.service.IZoneDataSetService;
|
||||
import com.ruoyi.zone.detail.domain.vo.ZoneBaseDataVo;
|
||||
import com.ruoyi.zone.detail.domain.vo.ZoneDetailDataVo;
|
||||
import com.ruoyi.zone.detail.service.IZoneDetailService;
|
||||
|
|
@ -61,6 +64,8 @@ public class OpenController extends BaseController {
|
|||
@Autowired
|
||||
private IZoneResourceService zoneResourceService;
|
||||
@Autowired
|
||||
private IZoneDataSetService zoneDataSetService;
|
||||
@Autowired
|
||||
private IZoneResourceDomainService zoneResourceDomainService;
|
||||
@Autowired
|
||||
private IZoneResourceTypeService zoneResourceTypeService;
|
||||
|
|
@ -261,4 +266,24 @@ public class OpenController extends BaseController {
|
|||
, HttpServletRequest request) {
|
||||
return genericsSuccess(zoneResourceService.selectOpenZoneResourceDataById(resourceId, request));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特色专区数据集项目列表
|
||||
*/
|
||||
@GetMapping("/{zoneId}/dataSet/projectList")
|
||||
@ApiOperation("获取特色专区数据集项目列表")
|
||||
public GenericsTableDataInfo<ZoneDataSetProjectVo> getDataSetProjectList(@ApiParam(name = "zoneId", value = "专区Id", required = true) @PathVariable("zoneId") Long zoneId
|
||||
, @ApiParam(name = "search", value = "名称模糊搜索") @RequestParam(value = "search", required = false) String search) {
|
||||
return getGenericsDataTable(zoneDataSetService.getDataSetProjectList(zoneId, search));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特色专区聚合项目对应数据集详情
|
||||
*/
|
||||
@GetMapping("/dataSet/{projectId}")
|
||||
@ApiOperation("获取特色专区聚合项目对应数据集详情")
|
||||
public GenericsAjaxResult<JSONObject> getDataSetDetail(@ApiParam(name = "projectId", value = "项目聚合Id", required = true) @PathVariable("projectId") Long projectId
|
||||
, @RequestParam("page") Integer page, @RequestParam("limit") Integer limit) {
|
||||
return genericsSuccess(zoneDataSetService.getDataSetDetail(projectId, page, limit));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,12 @@ public class ZoneDetail extends BaseEntity {
|
|||
@ApiModelProperty(value = "资源板块是否展示(0:不展示,1:展示)")
|
||||
private Integer sectionResourceShow;
|
||||
|
||||
/**
|
||||
* 数据集板块是否展示(0:不展示,1:展示)
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块是否展示(0:不展示,1:展示)")
|
||||
private Integer sectionDataSetShow;
|
||||
|
||||
/**
|
||||
* 资讯板块标题
|
||||
*/
|
||||
|
|
@ -257,6 +263,12 @@ public class ZoneDetail extends BaseEntity {
|
|||
@ApiModelProperty(value = "资源板块标题")
|
||||
private String sectionResourceTitle;
|
||||
|
||||
/**
|
||||
* 数据集板块标题
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块标题")
|
||||
private String sectionDataSetTitle;
|
||||
|
||||
|
||||
public ZoneDetailDataVo toZoneDetailDataVo() {
|
||||
ZoneDetailDataVo target = new ZoneDetailDataVo();
|
||||
|
|
|
|||
|
|
@ -212,6 +212,13 @@ public class ZoneDetailDataVo extends BaseEntity {
|
|||
private Integer sectionResourceShow;
|
||||
|
||||
|
||||
/**
|
||||
* 数据集板块是否展示(0:不展示,1:展示)
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块是否展示(0:不展示,1:展示)")
|
||||
private Integer sectionDataSetShow;
|
||||
|
||||
|
||||
/**
|
||||
* 首页板块标题
|
||||
*/
|
||||
|
|
@ -223,4 +230,9 @@ public class ZoneDetailDataVo extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "资源板块标题")
|
||||
private String sectionResourceTitle;
|
||||
/**
|
||||
* 数据集板块标题
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块标题")
|
||||
private String sectionDataSetTitle;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -154,6 +154,12 @@ public class ZoneDetailUpdateVo {
|
|||
@ApiModelProperty(value = "资源板块是否展示(0:不展示,1:展示)")
|
||||
private Integer sectionResourceShow;
|
||||
|
||||
/**
|
||||
* 数据集板块是否展示(0:不展示,1:展示)
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块是否展示(0:不展示,1:展示)")
|
||||
private Integer sectionDataSetShow;
|
||||
|
||||
/**
|
||||
* 资讯板块标题
|
||||
*/
|
||||
|
|
@ -191,6 +197,12 @@ public class ZoneDetailUpdateVo {
|
|||
@ApiModelProperty(value = "资源板块标题")
|
||||
private String sectionResourceTitle;
|
||||
|
||||
/**
|
||||
* 数据集板块标题
|
||||
*/
|
||||
@ApiModelProperty(value = "数据集板块标题")
|
||||
private String sectionDataSetTitle;
|
||||
|
||||
public ZoneDetail toZoneDetail() {
|
||||
ZoneDetail target = new ZoneDetail();
|
||||
BeanUtils.copyProperties(this, target);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ public class ZoneProjectDataVo implements Comparable<ZoneProjectDataVo> {
|
|||
private Long zoneId;
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
@ApiModelProperty(value = "是否有数据集")
|
||||
private Boolean hasDataset;
|
||||
|
||||
@Override
|
||||
public int compareTo(ZoneProjectDataVo zoneProjectDataVo) {
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public class ZoneProjectServiceImpl implements IZoneProjectService {
|
|||
* 查询特色专区项目聚合列表
|
||||
*
|
||||
* @param zoneProjectSearchVo 特色专区项目聚合
|
||||
* @param isOpen
|
||||
* @param isOpen 是否前台访问
|
||||
* @return 特色专区项目聚合
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -209,7 +209,8 @@ public class ZoneProjectServiceImpl implements IZoneProjectService {
|
|||
HashMap<String, String> projectKeyName = new HashMap<>();
|
||||
JSONObject projectPropertiesVo = new JSONObject();
|
||||
//项目名称、头像、描述为一定展示的字段
|
||||
String authorImageUrl = "";
|
||||
projectPropertiesVo.put("repositoryId", gitLinkProject.getLongValue("id"));
|
||||
String authorImageUrl;
|
||||
JSONObject author = gitLinkProject.getJSONObject("author");
|
||||
if (author != null) {
|
||||
String authorImagePath = author.getString("image_url");
|
||||
|
|
@ -286,6 +287,11 @@ public class ZoneProjectServiceImpl implements IZoneProjectService {
|
|||
}
|
||||
|
||||
projectPropertiesVo.put("projectKeyName",projectKeyName);
|
||||
if (gitLinkProject.containsKey("has_dataset")) {
|
||||
zoneProjectDataVo.setHasDataset(gitLinkProject.getBoolean("has_dataset"));
|
||||
} else {
|
||||
zoneProjectDataVo.setHasDataset(false);
|
||||
}
|
||||
zoneProjectDataVo.setProjectProperties(projectPropertiesVo);
|
||||
zoneProjectDataVo.setProjectURL(EscapeUtil.removeExtraSlashOfUrl(String.format("%s/%s", gitLinkRequestHelper.gitLinkUrl, projectPropertiesVo.get("fullName"))));
|
||||
return zoneProjectDataVo;
|
||||
|
|
@ -403,7 +409,7 @@ public class ZoneProjectServiceImpl implements IZoneProjectService {
|
|||
/**
|
||||
* 修改特色专区项目聚合
|
||||
*
|
||||
* @param id
|
||||
* @param id 项目聚合主键
|
||||
* @param zoneProjectUpdateVo 特色专区项目聚合
|
||||
* @return 结果
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,6 +22,20 @@ public class ZoneGitLinkRequestUrl extends GitLinkRequestUrl {
|
|||
return getOpenGitLinkRequestUrl(String.format("/api/projects.json%s", query));
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据集详情
|
||||
*/
|
||||
public static GitLinkRequestUrl DATASET(String fullName, Integer page, Integer limit) {
|
||||
return getOpenGitLinkRequestUrl(String.format("/api/v1/%s/dataset?page=%d&limit=%d", fullName, page, limit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据集详情
|
||||
*/
|
||||
public static GitLinkRequestUrl PROJECT_DATASETS(String ids) {
|
||||
return getOpenGitLinkRequestUrl(String.format("/api/v1/project_datasets.json?ids=%s", ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索用户列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ spring:
|
|||
name: ruoyi-zone
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
active: zone
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
|
|
|
|||
|
|
@ -47,12 +47,14 @@
|
|||
<result property="sectionHelperShow" column="section_helper_show"/>
|
||||
<result property="sectionHomepageShow" column="section_homepage_show"/>
|
||||
<result property="sectionResourceShow" column="section_resource_show"/>
|
||||
<result property="sectionDataSetShow" column="section_dataset_show"/>
|
||||
<result property="sectionCmsTitle" column="section_cms_title"/>
|
||||
<result property="sectionProjectTitle" column="section_project_title"/>
|
||||
<result property="sectionMemberTitle" column="section_member_title"/>
|
||||
<result property="sectionHelperTitle" column="section_helper_title"/>
|
||||
<result property="sectionHomepageTitle" column="section_homepage_title"/>
|
||||
<result property="sectionResourceTitle" column="section_resource_title"/>
|
||||
<result property="sectionDataSetTitle" column="section_dataset_title"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZoneDetailVo">
|
||||
|
|
@ -98,11 +100,13 @@
|
|||
section_helper_show,
|
||||
section_homepage_show,
|
||||
section_resource_show,
|
||||
section_dataset_show,
|
||||
section_cms_title,
|
||||
section_project_title,
|
||||
section_member_title,
|
||||
section_homepage_title,
|
||||
section_resource_title,
|
||||
section_dataset_title,
|
||||
section_helper_title
|
||||
from zone_detail
|
||||
</sql>
|
||||
|
|
@ -150,11 +154,13 @@
|
|||
z.section_helper_show,
|
||||
z.section_homepage_show,
|
||||
z.section_resource_show,
|
||||
z.section_dataset_show,
|
||||
z.section_cms_title,
|
||||
z.section_project_title,
|
||||
z.section_member_title,
|
||||
z.section_homepage_title,
|
||||
z.section_resource_title,
|
||||
z.section_dataset_title,
|
||||
z.section_helper_title
|
||||
from zone_detail as z
|
||||
</sql>
|
||||
|
|
@ -238,12 +244,14 @@
|
|||
<if test="sectionHelperShow != null">section_helper_show,</if>
|
||||
<if test="sectionHomepageShow != null">section_homepage_show,</if>
|
||||
<if test="sectionResourceShow != null">section_resource_show,</if>
|
||||
<if test="sectionDataSetShow != null">section_dataset_show,</if>
|
||||
<if test="sectionCmsTitle != null">section_cms_title,</if>
|
||||
<if test="sectionProjectTitle != null">section_project_title,</if>
|
||||
<if test="sectionMemberTitle != null">section_member_title,</if>
|
||||
<if test="sectionHelperTitle != null">section_helper_title,</if>
|
||||
<if test="sectionHomepageTitle != null">section_homepage_title,</if>
|
||||
<if test="sectionResourceTitle != null">section_resource_title,</if>
|
||||
<if test="sectionDataSetTitle != null">section_dataset_title,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
|
|
@ -286,12 +294,14 @@
|
|||
<if test="sectionHelperShow != null">#{sectionHelperShow},</if>
|
||||
<if test="sectionHomepageShow != null">#{sectionHomepageShow},</if>
|
||||
<if test="sectionResourceShow != null">#{sectionResourceShow},</if>
|
||||
<if test="sectionDataSetShow != null">#{sectionDataSetShow},</if>
|
||||
<if test="sectionCmsTitle != null">#{sectionCmsTitle},</if>
|
||||
<if test="sectionProjectTitle != null">#{sectionProjectTitle},</if>
|
||||
<if test="sectionMemberTitle != null">#{sectionMemberTitle},</if>
|
||||
<if test="sectionHelperTitle != null">#{sectionHelperTitle},</if>
|
||||
<if test="sectionHomepageTitle != null">#{sectionHomepageTitle},</if>
|
||||
<if test="sectionResourceTitle != null">#{sectionResourceTitle},</if>
|
||||
<if test="sectionDataSetTitle != null">#{sectionDataSetTitle},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
@ -339,13 +349,17 @@
|
|||
<if test="sectionHelperShow != null">section_helper_show = #{sectionHelperShow},</if>
|
||||
<if test="sectionHomepageShow != null">section_homepage_show = #{sectionHomepageShow},</if>
|
||||
<if test="sectionResourceShow != null">section_resource_show = #{sectionResourceShow},</if>
|
||||
<if test="sectionDataSetShow != null">section_dataset_show = #{sectionDataSetShow},</if>
|
||||
<if test="sectionCmsTitle != null">section_cms_title = #{sectionCmsTitle},</if>
|
||||
<if test="sectionProjectTitle != null">section_project_title = #{sectionProjectTitle},</if>
|
||||
<if test="sectionMemberTitle != null">section_member_title = #{sectionMemberTitle},</if>
|
||||
<if test="sectionHelperTitle != null">section_helper_title = #{sectionHelperTitle},</if>
|
||||
<if test="sectionHomepageTitle != null">section_homepage_title = #{sectionHomepageTitle},</if>
|
||||
<if test="sectionResourceTitle != null">section_resource_title = #{sectionResourceTitle},</if>
|
||||
<if test="sectionDataSetTitle != null">section_dataset_title = #{sectionDataSetTitle},</if>
|
||||
</trim>
|
||||
|
||||
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
-- 专区详情新增数据集板块相关配置
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
ALTER TABLE `zone_detail`
|
||||
ADD COLUMN `section_dataset_show` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '数据集板块是否展示(0:不展示,1:展示)';
|
||||
|
||||
ALTER TABLE `zone_detail`
|
||||
ADD COLUMN `section_dataset_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '数据集' COMMENT '数据集板块标题';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Loading…
Reference in New Issue