| @@ -17,7 +17,9 @@ import org.springframework.scheduling.annotation.EnableScheduling; | |||||
| @EnableRyFeignClients | @EnableRyFeignClients | ||||
| @SpringBootApplication | @SpringBootApplication | ||||
| @EnableScheduling | @EnableScheduling | ||||
| public class RuoYiManagementPlatformApplication { | |||||
| public class | |||||
| RuoYiManagementPlatformApplication { | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| SpringApplication.run(RuoYiManagementPlatformApplication.class, args); | SpringApplication.run(RuoYiManagementPlatformApplication.class, args); | ||||
| System.out.println("(♥◠‿◠)ノ゙ 复杂智能软件管理平台启动成功 ლ(´ڡ`ლ)゙ \n" + | System.out.println("(♥◠‿◠)ノ゙ 复杂智能软件管理平台启动成功 ლ(´ڡ`ლ)゙ \n" + | ||||
| @@ -19,8 +19,8 @@ public class AssetIcon implements Serializable { | |||||
| /** | /** | ||||
| * 主键 | * 主键 | ||||
| */ | */ | ||||
| @ApiModelProperty(value = "资产ID") | |||||
| private Integer id; | |||||
| @ApiModelProperty(value = "资产ID") | |||||
| private Integer id; | |||||
| @ApiModelProperty(value = "资产图标名称") | @ApiModelProperty(value = "资产图标名称") | ||||
| private String name; | private String name; | ||||
| @@ -76,6 +76,13 @@ public class Dataset implements Serializable { | |||||
| @ApiModelProperty(value = "状态:0失效,1生效") | @ApiModelProperty(value = "状态:0失效,1生效") | ||||
| private Integer state; | private Integer state; | ||||
| @ApiModelProperty(value = "数据集类型名字") | |||||
| private String datasetTypeName; | |||||
| @ApiModelProperty(value = "数据集tag名字") | |||||
| private String datasetTagName; | |||||
| public Integer getId() { | public Integer getId() { | ||||
| return id; | return id; | ||||
| @@ -165,5 +172,21 @@ public class Dataset implements Serializable { | |||||
| this.state = state; | this.state = state; | ||||
| } | } | ||||
| public String getDatasetTypeName() { | |||||
| return datasetTypeName; | |||||
| } | |||||
| public String getDatasetTagName() { | |||||
| return datasetTagName; | |||||
| } | |||||
| public void setDatasetTagName(String datasetTagName) { | |||||
| this.datasetTagName = datasetTagName; | |||||
| } | |||||
| public void setDatasetTypeName(String datasetTypeName) { | |||||
| this.datasetTypeName = datasetTypeName; | |||||
| } | |||||
| } | } | ||||
| @@ -118,7 +118,7 @@ public class Image implements Serializable { | |||||
| this.updateTime = updateTime; | this.updateTime = updateTime; | ||||
| } | } | ||||
| // Getter 和 Setter | |||||
| public Integer getVersionCount() { | public Integer getVersionCount() { | ||||
| return versionCount; | return versionCount; | ||||
| } | } | ||||
| @@ -84,5 +84,6 @@ public interface AssetIconDao { | |||||
| List<AssetIcon> queryByCategoryId(Integer categoryId); | List<AssetIcon> queryByCategoryId(Integer categoryId); | ||||
| AssetIcon queryByPath(String path); | |||||
| } | } | ||||
| @@ -22,6 +22,15 @@ public interface AssetIconService { | |||||
| */ | */ | ||||
| AssetIcon queryById(Integer id); | AssetIcon queryById(Integer id); | ||||
| /** | |||||
| * 通过path查询单条数据 | |||||
| * | |||||
| * @param path 路径 | |||||
| * @return 实例对象 | |||||
| */ | |||||
| AssetIcon queryByPath(String path); | |||||
| /** | /** | ||||
| * 分页查询 | * 分页查询 | ||||
| * | * | ||||
| @@ -2,7 +2,6 @@ package com.ruoyi.platform.service.impl; | |||||
| import com.ruoyi.common.security.utils.SecurityUtils; | import com.ruoyi.common.security.utils.SecurityUtils; | ||||
| import com.ruoyi.platform.domain.AssetIcon; | import com.ruoyi.platform.domain.AssetIcon; | ||||
| import com.ruoyi.platform.domain.Models; | |||||
| import com.ruoyi.platform.mapper.AssetIconDao; | import com.ruoyi.platform.mapper.AssetIconDao; | ||||
| import com.ruoyi.platform.service.AssetIconService; | import com.ruoyi.platform.service.AssetIconService; | ||||
| import com.ruoyi.system.api.model.LoginUser; | import com.ruoyi.system.api.model.LoginUser; | ||||
| @@ -38,6 +37,12 @@ public class AssetIconServiceImpl implements AssetIconService { | |||||
| return this.assetIconDao.queryById(id); | return this.assetIconDao.queryById(id); | ||||
| } | } | ||||
| @Override | |||||
| public AssetIcon queryByPath(String path) { | |||||
| return this.assetIconDao.queryByPath(path); | |||||
| } | |||||
| /** | /** | ||||
| * 分页查询 | * 分页查询 | ||||
| * | * | ||||
| @@ -125,4 +130,6 @@ public class AssetIconServiceImpl implements AssetIconService { | |||||
| public List<AssetIcon> queryByCategoryId(Integer categoryId) { | public List<AssetIcon> queryByCategoryId(Integer categoryId) { | ||||
| return this.assetIconDao.queryByCategoryId(categoryId); | return this.assetIconDao.queryByCategoryId(categoryId); | ||||
| } | } | ||||
| } | } | ||||
| @@ -3,10 +3,12 @@ package com.ruoyi.platform.service.impl; | |||||
| import com.ruoyi.common.security.utils.SecurityUtils; | import com.ruoyi.common.security.utils.SecurityUtils; | ||||
| import com.ruoyi.platform.annotations.CheckDuplicate; | import com.ruoyi.platform.annotations.CheckDuplicate; | ||||
| import com.ruoyi.platform.domain.AssetIcon; | |||||
| import com.ruoyi.platform.domain.Dataset; | import com.ruoyi.platform.domain.Dataset; | ||||
| import com.ruoyi.platform.domain.DatasetVersion; | import com.ruoyi.platform.domain.DatasetVersion; | ||||
| import com.ruoyi.platform.mapper.DatasetDao; | import com.ruoyi.platform.mapper.DatasetDao; | ||||
| import com.ruoyi.platform.mapper.DatasetVersionDao; | import com.ruoyi.platform.mapper.DatasetVersionDao; | ||||
| import com.ruoyi.platform.service.AssetIconService; | |||||
| import com.ruoyi.platform.service.DatasetService; | import com.ruoyi.platform.service.DatasetService; | ||||
| import com.ruoyi.platform.service.DatasetVersionService; | import com.ruoyi.platform.service.DatasetVersionService; | ||||
| import com.ruoyi.platform.service.MinioService; | import com.ruoyi.platform.service.MinioService; | ||||
| @@ -58,6 +60,9 @@ public class DatasetServiceImpl implements DatasetService { | |||||
| @Resource | @Resource | ||||
| private DatasetVersionService datasetVersionService; | private DatasetVersionService datasetVersionService; | ||||
| @Resource | |||||
| private AssetIconService assetIconService; | |||||
| @Resource | @Resource | ||||
| private MinioService minioService; | private MinioService minioService; | ||||
| @@ -77,7 +82,17 @@ public class DatasetServiceImpl implements DatasetService { | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public Dataset queryById(Integer id) { | public Dataset queryById(Integer id) { | ||||
| return this.datasetDao.queryById(id); | |||||
| Dataset dataset = this.datasetDao.queryById(id); | |||||
| String dataType = dataset.getDataType(); | |||||
| String dataTag = dataset.getDataTag(); | |||||
| //去资产管理表中查询对应的图标名 | |||||
| AssetIcon dataTypeAssetIcon = assetIconService.queryByPath(dataType); | |||||
| AssetIcon dataTagAssetIcon = assetIconService.queryByPath(dataTag); | |||||
| dataset.setDatasetTypeName(dataTypeAssetIcon.getName()); | |||||
| dataset.setDatasetTagName(dataTagAssetIcon.getName()); | |||||
| return dataset; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -316,6 +316,7 @@ public class ImageServiceImpl implements ImageService { | |||||
| String filePath = "/data/argo-workflow/" + bucketName + "/" +path; | String filePath = "/data/argo-workflow/" + bucketName + "/" +path; | ||||
| String logs2 = k8sClientUtil.executeCommand(pod,"docker load -i "+filePath); | String logs2 = k8sClientUtil.executeCommand(pod,"docker load -i "+filePath); | ||||
| // 在容器里执行 docker tag name:tag nexus3.kube-system.svc:8083/imageName:imageTag | // 在容器里执行 docker tag name:tag nexus3.kube-system.svc:8083/imageName:imageTag | ||||
| if (StringUtils.isNoneBlank(logs2)){ | if (StringUtils.isNoneBlank(logs2)){ | ||||
| String substring = logs2.substring(logs2.indexOf(":")+1).trim(); | String substring = logs2.substring(logs2.indexOf(":")+1).trim(); | ||||
| String tagCmd = "docker tag " + substring + " " + harborUrl + "/" + repository + "/" + username + "/" + imageName + ":" + imageTag; | String tagCmd = "docker tag " + substring + " " + harborUrl + "/" + repository + "/" + username + "/" + imageName + ":" + imageTag; | ||||
| @@ -43,6 +43,13 @@ | |||||
| </where> | </where> | ||||
| </select> | </select> | ||||
| <select id="queryByPath" resultMap="AssetIconMap" > | |||||
| select | |||||
| id, name,category_id, path, description, create_by, create_time, update_by, update_time, state | |||||
| from asset_icon | |||||
| where path = #{path} and state = 1 | |||||
| </select> | |||||
| <select id="queryAllByLimit" resultMap="AssetIconMap"> | <select id="queryAllByLimit" resultMap="AssetIconMap"> | ||||
| select | select | ||||
| id, name, category_id, path, description, create_by, create_time, update_by, update_time, state | id, name, category_id, path, description, create_by, create_time, update_by, update_time, state | ||||
| @@ -123,6 +130,7 @@ | |||||
| </where> | </where> | ||||
| </select> | </select> | ||||
| <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | ||||
| insert into asset_icon(name, category_id, path, description, create_by, create_time, update_by, update_time, state) | insert into asset_icon(name, category_id, path, description, create_by, create_time, update_by, update_time, state) | ||||
| values (#{assetIcon.name}, #{assetIcon.categoryId}, #{assetIcon.path}, #{assetIcon.description}, #{assetIcon.createBy}, #{assetIcon.createTime}, #{assetIcon.updateBy}, #{assetIcon.updateTime}, #{assetIcon.state}) | values (#{assetIcon.name}, #{assetIcon.categoryId}, #{assetIcon.path}, #{assetIcon.description}, #{assetIcon.createBy}, #{assetIcon.createTime}, #{assetIcon.updateBy}, #{assetIcon.updateTime}, #{assetIcon.state}) | ||||
| @@ -152,13 +152,13 @@ | |||||
| description = #{dataset.description}, | description = #{dataset.description}, | ||||
| </if> | </if> | ||||
| <if test="dataset.availableRange != null and dataset.availableRange != ''"> | <if test="dataset.availableRange != null and dataset.availableRange != ''"> | ||||
| available_range = #{dataset.availableRange} | |||||
| </if>, | |||||
| available_range = #{dataset.availableRange}, | |||||
| </if> | |||||
| <if test="dataset.dataType != null"> | <if test="dataset.dataType != null"> | ||||
| data_type = #{dataset.dataType}, | data_type = #{dataset.dataType}, | ||||
| </if> | </if> | ||||
| <if test="dataset.dataTag != null"> | <if test="dataset.dataTag != null"> | ||||
| data_tag = #{dataset.dataTag} | |||||
| data_tag = #{dataset.dataTag}, | |||||
| </if> | </if> | ||||
| <if test="dataset.createBy != null and dataset.createBy != ''"> | <if test="dataset.createBy != null and dataset.createBy != ''"> | ||||
| create_by = #{dataset.createBy}, | create_by = #{dataset.createBy}, | ||||
| @@ -179,6 +179,7 @@ | |||||
| where id = #{dataset.id} | where id = #{dataset.id} | ||||
| </update> | </update> | ||||
| <!--通过主键删除--> | <!--通过主键删除--> | ||||
| <delete id="deleteById"> | <delete id="deleteById"> | ||||
| delete from dataset where id = #{id} | delete from dataset where id = #{id} | ||||
| @@ -154,7 +154,7 @@ | |||||
| description = #{models.description}, | description = #{models.description}, | ||||
| </if> | </if> | ||||
| <if test="models.availableRange != null and models.availableRange != ''"> | <if test="models.availableRange != null and models.availableRange != ''"> | ||||
| available_range = #{models.availableRange} | |||||
| available_range = #{models.availableRange}, | |||||
| </if> | </if> | ||||
| <if test="models.modelType != null"> | <if test="models.modelType != null"> | ||||
| model_type = #{models.modelType}, | model_type = #{models.modelType}, | ||||