| @@ -62,7 +62,7 @@ public class DatasetVersionController { | |||||
| * @return 匹配的数据集版本记录列表 | * @return 匹配的数据集版本记录列表 | ||||
| */ | */ | ||||
| @GetMapping("/versions") | @GetMapping("/versions") | ||||
| @ApiOperation("通过数据集id和version查询版本列表") | |||||
| @ApiOperation("通过数据集id和version查询版本文件列表") | |||||
| public AjaxResult queryByDatasetIdAndVersion(@RequestParam("dataset_id") Integer datasetId, | public AjaxResult queryByDatasetIdAndVersion(@RequestParam("dataset_id") Integer datasetId, | ||||
| @RequestParam("version") String version) { | @RequestParam("version") String version) { | ||||
| return AjaxResult.success(this.datasetVersionService.queryByDatasetIdAndVersion(datasetId, version)); | return AjaxResult.success(this.datasetVersionService.queryByDatasetIdAndVersion(datasetId, version)); | ||||
| @@ -41,7 +41,7 @@ public class AssetIconController { | |||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public AjaxResult queryByPage(AssetIcon assetIcon, int page, int size) { | public AjaxResult queryByPage(AssetIcon assetIcon, int page, int size) { | ||||
| PageRequest pageRequest = PageRequest.of(page,size); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return AjaxResult.success(this.assetIconService.queryByPage(assetIcon, pageRequest)); | |||||
| return AjaxResult.success(this.assetIconService.queryByPage(assetIcon, pageRequest)); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -56,6 +56,18 @@ public class AssetIconController { | |||||
| return AjaxResult.success(this.assetIconService.queryById(id)); | return AjaxResult.success(this.assetIconService.queryById(id)); | ||||
| } | } | ||||
| /** | |||||
| * 按图标名字模糊查询 | |||||
| * | |||||
| * @param name 筛选条件 | |||||
| * @return 查询结果 | |||||
| */ | |||||
| @GetMapping("name/{name}") | |||||
| @ApiOperation("按名字模糊查询图标名字") | |||||
| public AjaxResult queryByName(@PathVariable("name") String name) { | |||||
| return AjaxResult.success(this.assetIconService.queryByName(name)); | |||||
| } | |||||
| /** | /** | ||||
| * 新增数据 | * 新增数据 | ||||
| * | * | ||||
| @@ -75,7 +87,7 @@ public class AssetIconController { | |||||
| * @return 编辑结果 | * @return 编辑结果 | ||||
| */ | */ | ||||
| @PutMapping | @PutMapping | ||||
| @ApiOperation("更新") | |||||
| @ApiOperation("更新图标") | |||||
| public AjaxResult edit(@RequestBody AssetIcon assetIcon) { | public AjaxResult edit(@RequestBody AssetIcon assetIcon) { | ||||
| return AjaxResult.success(this.assetIconService.update(assetIcon)); | return AjaxResult.success(this.assetIconService.update(assetIcon)); | ||||
| } | } | ||||
| @@ -126,6 +126,8 @@ public class ImageController { | |||||
| return AjaxResult.success(this.imageService.createImageFromLocal(imageName,imageTag,imageDescription)); | return AjaxResult.success(this.imageService.createImageFromLocal(imageName,imageTag,imageDescription)); | ||||
| } | } | ||||
| /** | /** | ||||
| * 镜像上传 | * 镜像上传 | ||||
| * | * | ||||
| @@ -133,7 +135,6 @@ public class ImageController { | |||||
| * @param files 文件 | * @param files 文件 | ||||
| * @return 上传结果 | * @return 上传结果 | ||||
| */ | */ | ||||
| @PostMapping("/upload") | @PostMapping("/upload") | ||||
| @ApiOperation(value = "上传镜像文件", notes = "上传镜像tar包,返回存储路径") | @ApiOperation(value = "上传镜像文件", notes = "上传镜像tar包,返回存储路径") | ||||
| public AjaxResult uploadImageFiles(@RequestParam("files") MultipartFile[] files) throws Exception { | public AjaxResult uploadImageFiles(@RequestParam("files") MultipartFile[] files) throws Exception { | ||||
| @@ -79,5 +79,7 @@ public interface AssetIconDao { | |||||
| */ | */ | ||||
| int deleteById(Integer id); | int deleteById(Integer id); | ||||
| List<AssetIcon> queryByName(String name); | |||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import com.ruoyi.platform.domain.AssetIcon; | |||||
| import org.springframework.data.domain.Page; | import org.springframework.data.domain.Page; | ||||
| import org.springframework.data.domain.PageRequest; | import org.springframework.data.domain.PageRequest; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * (AssetIcon)表服务接口 | * (AssetIcon)表服务接口 | ||||
| * | * | ||||
| @@ -55,4 +57,6 @@ public interface AssetIconService { | |||||
| String removeById(Integer id); | String removeById(Integer id); | ||||
| List<AssetIcon> queryByName(String name); | |||||
| } | } | ||||
| @@ -14,6 +14,7 @@ import org.springframework.data.domain.PageRequest; | |||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | |||||
| /** | /** | ||||
| * (AssetIcon)表服务实现类 | * (AssetIcon)表服务实现类 | ||||
| @@ -114,4 +115,9 @@ public class AssetIconServiceImpl implements AssetIconService { | |||||
| assetIcon.setState(0); | assetIcon.setState(0); | ||||
| return this.assetIconDao.update(assetIcon)>0?"删除成功":"删除失败"; | return this.assetIconDao.update(assetIcon)>0?"删除成功":"删除失败"; | ||||
| } | } | ||||
| @Override | |||||
| public List<AssetIcon> queryByName(String name) { | |||||
| return this.assetIconDao.queryByName(name); | |||||
| } | |||||
| } | } | ||||
| @@ -183,6 +183,8 @@ public class ImageServiceImpl implements ImageService { | |||||
| // Map<Integer, Object> results = new HashMap<Integer, Object>(); | // Map<Integer, Object> results = new HashMap<Integer, Object>(); | ||||
| // | // | ||||
| // // 验证模型是否存在 | // // 验证模型是否存在 | ||||
| // Models models = this.modelsDao.queryById(id); | // Models models = this.modelsDao.queryById(id); | ||||
| // if (models == null) { | // if (models == null) { | ||||
| // throw new Exception("未找到模型记录"); | // throw new Exception("未找到模型记录"); | ||||
| @@ -23,6 +23,19 @@ | |||||
| where id = #{id} and state = 1 | where id = #{id} and state = 1 | ||||
| </select> | </select> | ||||
| <!--通过图标名字进行模糊查询--> | |||||
| <select id="queryByName" resultMap="AssetIconMap"> | |||||
| select | |||||
| id,name,category_id, path, description, create_by, create_time, update_by, update_time, state | |||||
| from asset_icon | |||||
| <where> | |||||
| state = 1 | |||||
| <if test="name != null and name != ''"> | |||||
| and name like "%"#{name}"%" | |||||
| </if> | |||||
| </where> | |||||
| </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 | ||||