| @@ -24,11 +24,14 @@ public class Ray { | |||||
| private String dataset; | private String dataset; | ||||
| @ApiModelProperty(value = "数据集挂载路径") | @ApiModelProperty(value = "数据集挂载路径") | ||||
| private String datasetPath; | |||||
| private String model; | |||||
| @ApiModelProperty(value = "代码") | @ApiModelProperty(value = "代码") | ||||
| private String code; | private String code; | ||||
| @ApiModelProperty(value = "镜像") | |||||
| private String image; | |||||
| @ApiModelProperty(value = "主函数代码文件") | @ApiModelProperty(value = "主函数代码文件") | ||||
| private String mainPy; | private String mainPy; | ||||
| @@ -48,6 +48,8 @@ public class RayServiceImpl implements RayService { | |||||
| ray.setUpdateBy(username); | ray.setUpdateBy(username); | ||||
| ray.setDataset(JacksonUtil.toJSONString(rayVo.getDataset())); | ray.setDataset(JacksonUtil.toJSONString(rayVo.getDataset())); | ||||
| ray.setCode(JacksonUtil.toJSONString(rayVo.getCode())); | ray.setCode(JacksonUtil.toJSONString(rayVo.getCode())); | ||||
| ray.setModel(JacksonUtil.toJSONString(rayVo.getModel())); | |||||
| ray.setImage(JacksonUtil.toJSONString(rayVo.getImage())); | |||||
| ray.setParameters(JacksonUtil.toJSONString(rayVo.getParameters())); | ray.setParameters(JacksonUtil.toJSONString(rayVo.getParameters())); | ||||
| ray.setPointsToEvaluate(JacksonUtil.toJSONString(rayVo.getPointsToEvaluate())); | ray.setPointsToEvaluate(JacksonUtil.toJSONString(rayVo.getPointsToEvaluate())); | ||||
| rayDao.save(ray); | rayDao.save(ray); | ||||
| @@ -67,6 +69,8 @@ public class RayServiceImpl implements RayService { | |||||
| ray.setPointsToEvaluate(JacksonUtil.toJSONString(rayVo.getPointsToEvaluate())); | ray.setPointsToEvaluate(JacksonUtil.toJSONString(rayVo.getPointsToEvaluate())); | ||||
| ray.setDataset(JacksonUtil.toJSONString(rayVo.getDataset())); | ray.setDataset(JacksonUtil.toJSONString(rayVo.getDataset())); | ||||
| ray.setCode(JacksonUtil.toJSONString(rayVo.getCode())); | ray.setCode(JacksonUtil.toJSONString(rayVo.getCode())); | ||||
| ray.setModel(JacksonUtil.toJSONString(rayVo.getModel())); | |||||
| ray.setImage(JacksonUtil.toJSONString(rayVo.getImage())); | |||||
| rayDao.edit(ray); | rayDao.edit(ray); | ||||
| return "修改成功"; | return "修改成功"; | ||||
| } | } | ||||
| @@ -92,6 +96,12 @@ public class RayServiceImpl implements RayService { | |||||
| if (StringUtils.isNotEmpty(ray.getCode())) { | if (StringUtils.isNotEmpty(ray.getCode())) { | ||||
| rayVo.setCode(JsonUtils.jsonToMap(ray.getCode())); | rayVo.setCode(JsonUtils.jsonToMap(ray.getCode())); | ||||
| } | } | ||||
| if (StringUtils.isNotEmpty(ray.getModel())) { | |||||
| rayVo.setModel(JsonUtils.jsonToMap(ray.getModel())); | |||||
| } | |||||
| if (StringUtils.isNotEmpty(ray.getImage())) { | |||||
| rayVo.setImage(JsonUtils.jsonToMap(ray.getImage())); | |||||
| } | |||||
| return rayVo; | return rayVo; | ||||
| } | } | ||||
| @@ -74,6 +74,9 @@ public class RayVo { | |||||
| private Map<String, Object> dataset; | private Map<String, Object> dataset; | ||||
| @ApiModelProperty(value = "数据集挂载路径") | |||||
| private String datasetPath; | |||||
| @ApiModelProperty(value = "模型") | |||||
| private Map<String, Object> model; | |||||
| @ApiModelProperty(value = "镜像") | |||||
| private Map<String, Object> image; | |||||
| } | } | ||||
| @@ -2,13 +2,13 @@ | |||||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||||
| <mapper namespace="com.ruoyi.platform.mapper.RayDao"> | <mapper namespace="com.ruoyi.platform.mapper.RayDao"> | ||||
| <insert id="save"> | <insert id="save"> | ||||
| insert into ray(name, description, dataset, dataset_path, code, main_py, num_samples, parameters, points_to_evaluate, storage_path, | |||||
| insert into ray(name, description, dataset, model, code, main_py, num_samples, parameters, points_to_evaluate, storage_path, | |||||
| search_alg, scheduler, metric, mode, max_t, | search_alg, scheduler, metric, mode, max_t, | ||||
| min_samples_required, resource, create_by, update_by) | |||||
| values (#{ray.name}, #{ray.description}, #{ray.dataset}, #{ray.datasetPath}, #{ray.code}, #{ray.mainPy}, #{ray.numSamples}, #{ray.parameters}, | |||||
| min_samples_required, resource, image, create_by, update_by) | |||||
| values (#{ray.name}, #{ray.description}, #{ray.dataset}, #{ray.model}, #{ray.code}, #{ray.mainPy}, #{ray.numSamples}, #{ray.parameters}, | |||||
| #{ray.pointsToEvaluate}, #{ray.storagePath}, | #{ray.pointsToEvaluate}, #{ray.storagePath}, | ||||
| #{ray.searchAlg}, #{ray.scheduler}, #{ray.metric}, #{ray.mode}, #{ray.maxT}, #{ray.minSamplesRequired}, | #{ray.searchAlg}, #{ray.scheduler}, #{ray.metric}, #{ray.mode}, #{ray.maxT}, #{ray.minSamplesRequired}, | ||||
| #{ray.resource}, #{ray.createBy}, #{ray.updateBy}) | |||||
| #{ray.resource}, #{ray.image}, #{ray.createBy}, #{ray.updateBy}) | |||||
| </insert> | </insert> | ||||
| <update id="edit"> | <update id="edit"> | ||||
| @@ -23,12 +23,15 @@ | |||||
| <if test="ray.dataset != null and ray.dataset !=''"> | <if test="ray.dataset != null and ray.dataset !=''"> | ||||
| dataset = #{ray.dataset}, | dataset = #{ray.dataset}, | ||||
| </if> | </if> | ||||
| <if test="ray.datasetPath != null and ray.datasetPath !=''"> | |||||
| dataset_path = #{ray.datasetPath}, | |||||
| <if test="ray.model != null and ray.model !=''"> | |||||
| model = #{ray.model}, | |||||
| </if> | </if> | ||||
| <if test="ray.code != null and ray.code !=''"> | <if test="ray.code != null and ray.code !=''"> | ||||
| code = #{ray.code}, | code = #{ray.code}, | ||||
| </if> | </if> | ||||
| <if test="ray.image != null and ray.image !=''"> | |||||
| image = #{ray.image}, | |||||
| </if> | |||||
| <if test="ray.mainPy != null and ray.mainPy !=''"> | <if test="ray.mainPy != null and ray.mainPy !=''"> | ||||
| main_py = #{ray.mainPy}, | main_py = #{ray.mainPy}, | ||||
| </if> | </if> | ||||