Merge branch 'xiaohucoding'
# Conflicts: # pom.xml
This commit is contained in:
@ -10,4 +10,17 @@
|
|||||||
测试方法不知道怎么写
|
测试方法不知道怎么写
|
||||||
|
|
||||||
### 📅 明日计划
|
### 📅 明日计划
|
||||||
写完删除代码,进行测试
|
写完删除代码,进行测试
|
||||||
|
|
||||||
|
## 2025年5月15日
|
||||||
|
### ✅ 今日完成
|
||||||
|
完成删除数据集增加数据集,部分测试
|
||||||
|
|
||||||
|
### 🚧 进行中
|
||||||
|
测试(或添加具体异常处理)
|
||||||
|
|
||||||
|
### ⚠️ 问题/障碍
|
||||||
|
暂无
|
||||||
|
|
||||||
|
### 📅 明日计划
|
||||||
|
测试完毕,开下一个模块
|
15
pom.xml
15
pom.xml
@ -57,6 +57,12 @@
|
|||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
<version>1.4.7</version>
|
<version>1.4.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--swagger相关依赖,生成接口文档-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>2.3.0</version> <!-- 最新稳定版 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--KingbaseES V8/V9 数据库 JDBC 驱动-->
|
<!--KingbaseES V8/V9 数据库 JDBC 驱动-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -64,15 +70,6 @@
|
|||||||
<artifactId>kingbase8</artifactId>
|
<artifactId>kingbase8</artifactId>
|
||||||
<version>9.0.0</version>
|
<version>9.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringDoc OpenAPI:自动生成 REST API 文档和 Swagger UI -->
|
|
||||||
<!-- 访问路径:http://localhost:8080/swagger-ui.html -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springdoc</groupId>
|
|
||||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
||||||
<version>2.2.0</version> <!-- 最新稳定版 -->
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
package com.bipt.intelligentapplicationorchestrationservice;
|
package com.bipt.intelligentapplicationorchestrationservice;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
@MapperScan("com.bipt.intelligentapplicationorchestrationservice.mapper")//指定扫描Mapper接口的包
|
@MapperScan("com.bipt.intelligentapplicationorchestrationservice.mapper")//指定扫描Mapper接口的包
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@Slf4j
|
||||||
public class IntelligentApplicationOrchestrationServiceApplication {
|
public class IntelligentApplicationOrchestrationServiceApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(IntelligentApplicationOrchestrationServiceApplication.class, args);
|
SpringApplication.run(IntelligentApplicationOrchestrationServiceApplication.class, args);
|
||||||
|
log.info("server started");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.bipt.intelligentapplicationorchestrationservice.constant;
|
||||||
|
|
||||||
|
public class MessageConstant {
|
||||||
|
public static final String UNKNOWN_ERROR = "未知错误";
|
||||||
|
public static final String ALREADY_EXISTS = "数据集已存在";
|
||||||
|
}
|
@ -2,7 +2,6 @@ package com.bipt.intelligentapplicationorchestrationservice.controller;
|
|||||||
|
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.pojo.*;
|
import com.bipt.intelligentapplicationorchestrationservice.pojo.*;
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.service.DatasetService;
|
import com.bipt.intelligentapplicationorchestrationservice.service.DatasetService;
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -28,6 +27,11 @@ public class DatasetController {
|
|||||||
return OptResult.success();
|
return OptResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param dataSetPageQueryDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public OptResult<PageResult> page(DatasetPageQueryDTO dataSetPageQueryDTO) {
|
public OptResult<PageResult> page(DatasetPageQueryDTO dataSetPageQueryDTO) {
|
||||||
log.info("数据集分页查询:{}", dataSetPageQueryDTO);
|
log.info("数据集分页查询:{}", dataSetPageQueryDTO);
|
||||||
@ -38,32 +42,28 @@ public class DatasetController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改数据集
|
* 修改数据集
|
||||||
* @param datasetEntity
|
* @param datasetDTO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public OptResult update(@RequestBody DatasetEntity datasetEntity){
|
public OptResult update(@RequestBody DatasetDTO datasetDTO){
|
||||||
log.info("修改数据集",datasetEntity);
|
log.info("修改数据集",datasetDTO);
|
||||||
datasetService.update(datasetEntity);
|
datasetService.update(datasetDTO);
|
||||||
return OptResult.success();
|
return OptResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除数据集
|
* 批量删除数据集
|
||||||
* @param datasetIds 数据集ID列表
|
* @param datasetIds 数据集ID列表
|
||||||
* @return 操作结果
|
* @return 操作结果
|
||||||
*/
|
*/
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public OptResult<String> deleteBatch(@RequestBody List<Integer> datasetIds) {
|
public OptResult<String> deleteBatch(@RequestBody List<Long> datasetIds) {
|
||||||
log.info("批量删除数据集,ID列表:{}", datasetIds);
|
log.info("批量删除数据集,ID列表:{}", datasetIds);
|
||||||
datasetService.deleteBatch(datasetIds);
|
datasetService.deleteBatch(datasetIds);
|
||||||
return OptResult.success("批量删除成功");
|
return OptResult.success("批量删除成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.bipt.intelligentapplicationorchestrationservice.handler;
|
||||||
|
|
||||||
|
import com.bipt.intelligentapplicationorchestrationservice.constant.MessageConstant;
|
||||||
|
import com.bipt.intelligentapplicationorchestrationservice.pojo.OptResult;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
import java.sql.SQLIntegrityConstraintViolationException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局异常处理器,处理项目中抛出的业务异常
|
||||||
|
*/
|
||||||
|
@RestControllerAdvice
|
||||||
|
@Slf4j
|
||||||
|
public class GlobalExceptionHandler {
|
||||||
|
/*
|
||||||
|
* 捕获SQL异常
|
||||||
|
* */
|
||||||
|
@ExceptionHandler
|
||||||
|
public OptResult exceptionHandler(SQLIntegrityConstraintViolationException ex){
|
||||||
|
String message = ex.getMessage();
|
||||||
|
if(message.contains("Duplicate entry")) {
|
||||||
|
String[] split = message.split(" ");
|
||||||
|
String username = split[2];
|
||||||
|
String msg = username + MessageConstant.ALREADY_EXISTS;
|
||||||
|
return OptResult.error(msg);
|
||||||
|
}else {
|
||||||
|
return OptResult.error(MessageConstant.UNKNOWN_ERROR);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -7,7 +7,6 @@ import com.github.pagehelper.Page;
|
|||||||
import org.apache.ibatis.annotations.*;
|
import org.apache.ibatis.annotations.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DatasetMapper {
|
public interface DatasetMapper {
|
||||||
@ -19,7 +18,7 @@ public interface DatasetMapper {
|
|||||||
Page<DatasetVO> pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO);
|
Page<DatasetVO> pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO);
|
||||||
|
|
||||||
@Select("select * from dataset where dataset_id=#{datasetId}")
|
@Select("select * from dataset where dataset_id=#{datasetId}")
|
||||||
DatasetEntity getById(Integer datasetId);
|
DatasetEntity getById(Long datasetId);
|
||||||
@Delete("delete from dataset where dataset_id = #{datasetId}")
|
|
||||||
void deleteBatch(List<Integer> datasetIds);
|
void deleteBatch(@Param("datasetIds") List<Long> datasetIds);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -9,9 +12,14 @@ import java.util.Map;
|
|||||||
* @author hky
|
* @author hky
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class DatasetDTO implements Serializable {
|
public class DatasetDTO implements Serializable {
|
||||||
private Integer datasetId;
|
private Long datasetId;
|
||||||
private String datasetName;
|
private String datasetName;
|
||||||
private Integer datasetType;
|
private int datasetType;
|
||||||
private Map<String,String> args;
|
private String dsPath;
|
||||||
|
// private Map<String,String> args;
|
||||||
|
private String args;
|
||||||
}
|
}
|
||||||
|
@ -17,12 +17,13 @@ import java.util.Map;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DatasetEntity implements Serializable {
|
public class DatasetEntity implements Serializable {
|
||||||
private Integer datasetId;
|
private Long datasetId;
|
||||||
private String datasetName;
|
private String datasetName;
|
||||||
private Integer datasetType;
|
private int datasetType;
|
||||||
private Integer datasetStatus;
|
private int datasetStatus;
|
||||||
private String dsPath;
|
private String dsPath;
|
||||||
private Map<String,String> args;
|
// private Map<String,String> args;
|
||||||
|
private String args;
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@ -10,9 +13,18 @@ import java.util.Map;
|
|||||||
* @author hky
|
* @author hky
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class DatasetPageQueryDTO implements Serializable{
|
public class DatasetPageQueryDTO implements Serializable{
|
||||||
private int page;
|
private int page;
|
||||||
private int pageSize;
|
private int pageSize;
|
||||||
private Integer datasetType;
|
private String datasetName;
|
||||||
private Integer datasetStatus;
|
private int datasetType;
|
||||||
|
private int datasetStatus;
|
||||||
|
private String dsPath;
|
||||||
|
private String args;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -7,12 +12,17 @@ import java.util.Map;
|
|||||||
/**
|
/**
|
||||||
* @author hky
|
* @author hky
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class DatasetVO implements Serializable {
|
public class DatasetVO implements Serializable {
|
||||||
private String datasetName;
|
private String datasetName;
|
||||||
private Integer datasetType;
|
private Integer datasetType;
|
||||||
private Integer datasetStatus;
|
private Integer datasetStatus;
|
||||||
private String dsPath;
|
private String dsPath;
|
||||||
private Map<String,String> args;
|
// private Map<String,String> args;
|
||||||
|
private String args;
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
}
|
}
|
||||||
|
@ -4,16 +4,17 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页
|
* 分页
|
||||||
* @param <T>
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class PageResult<T> {
|
@NoArgsConstructor
|
||||||
private Long total;
|
public class PageResult implements Serializable {
|
||||||
private List<T> rows;
|
private long total;
|
||||||
|
private List records;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.bipt.intelligentapplicationorchestrationservice.service;
|
package com.bipt.intelligentapplicationorchestrationservice.service;
|
||||||
|
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetDTO;
|
import com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetDTO;
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetEntity;
|
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetPageQueryDTO;
|
import com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetPageQueryDTO;
|
||||||
import com.bipt.intelligentapplicationorchestrationservice.pojo.PageResult;
|
import com.bipt.intelligentapplicationorchestrationservice.pojo.PageResult;
|
||||||
|
|
||||||
@ -13,9 +12,9 @@ import java.util.List;
|
|||||||
public interface DatasetService {
|
public interface DatasetService {
|
||||||
void save(DatasetDTO datasetDTO);
|
void save(DatasetDTO datasetDTO);
|
||||||
|
|
||||||
void update(DatasetEntity datasetEntity);
|
void update(DatasetDTO datasetDTO);
|
||||||
|
|
||||||
PageResult pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO);
|
PageResult pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO);
|
||||||
|
|
||||||
void deleteBatch(List<Integer> datasetIds);
|
void deleteBatch(List<Long> datasetIds);
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -26,20 +26,22 @@ public class DatasetServiceImpl implements DatasetService {
|
|||||||
* @param datasetDTO
|
* @param datasetDTO
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional
|
||||||
public void save(DatasetDTO datasetDTO) {
|
public void save(DatasetDTO datasetDTO) {
|
||||||
//判断数据集类型,如果是本地上传则保存,若用调用数据仓库进入下一步
|
//判断数据集类型,如果是本地上传则保存,若用调用数据仓库进入下一步
|
||||||
if (datasetDTO.getDatasetType()==0){
|
if (datasetDTO.getDatasetType()==0){
|
||||||
//TODO 保存到分布式文件系统
|
//TODO 保存到分布式文件系统
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
Map<String,String> args = datasetDTO.getArgs();
|
// Map<String,String> args = datasetDTO.getArgs();
|
||||||
Integer datasetType = datasetDTO.getDatasetType();
|
String args = datasetDTO.getArgs();
|
||||||
|
int datasetType = datasetDTO.getDatasetType();
|
||||||
//TODO 根据筛选条件调用数据仓库中的数据
|
//TODO 根据筛选条件调用数据仓库中的数据
|
||||||
|
|
||||||
//TODO 调用数据仓库保存到分布式文件系统
|
//TODO 调用数据仓库保存到分布式文件系统
|
||||||
}
|
}
|
||||||
DatasetEntity datasetEntity = new DatasetEntity();
|
DatasetEntity datasetEntity = new DatasetEntity();
|
||||||
BeanUtils.copyProperties(datasetEntity,datasetDTO);
|
BeanUtils.copyProperties(datasetDTO,datasetEntity);
|
||||||
datasetEntity.setDatasetStatus(1);
|
datasetEntity.setDatasetStatus(1);
|
||||||
datasetEntity.setCreateTime(LocalDateTime.now());
|
datasetEntity.setCreateTime(LocalDateTime.now());
|
||||||
datasetEntity.setUpdateTime(LocalDateTime.now());
|
datasetEntity.setUpdateTime(LocalDateTime.now());
|
||||||
@ -50,12 +52,14 @@ public class DatasetServiceImpl implements DatasetService {
|
|||||||
/**
|
/**
|
||||||
* 修改数据集
|
* 修改数据集
|
||||||
*
|
*
|
||||||
* @param datasetEntity
|
* @param datasetDTO
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void update(DatasetEntity datasetEntity) {
|
public void update(DatasetDTO datasetDTO) {
|
||||||
if (datasetEntity.getDatasetType()==0){
|
/*DatasetEntity datasetEntity = new DatasetEntity();
|
||||||
|
BeanUtils.copyProperties(datasetDTO,datasetEntity);*/
|
||||||
|
if (datasetDTO.getDatasetType()==0){
|
||||||
//TODO 覆盖保存到分布式文件系统中
|
//TODO 覆盖保存到分布式文件系统中
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
@ -63,9 +67,12 @@ public class DatasetServiceImpl implements DatasetService {
|
|||||||
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
datasetEntity.setUpdateTime(LocalDateTime.now());
|
|
||||||
datasetMapper.updata(datasetEntity);
|
|
||||||
}
|
}
|
||||||
|
DatasetEntity datasetEntity = new DatasetEntity();
|
||||||
|
BeanUtils.copyProperties(datasetDTO,datasetEntity);
|
||||||
|
datasetEntity.setUpdateTime(LocalDateTime.now());
|
||||||
|
datasetMapper.updata(datasetEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,9 +82,7 @@ public class DatasetServiceImpl implements DatasetService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO) {
|
public PageResult pageQuery(DatasetPageQueryDTO dataSetPageQueryDTO) {
|
||||||
int pageNum = dataSetPageQueryDTO.getPage();
|
PageHelper.startPage(dataSetPageQueryDTO.getPage(), dataSetPageQueryDTO.getPageSize());
|
||||||
int pageSize = dataSetPageQueryDTO.getPageSize();
|
|
||||||
PageHelper.startPage(pageNum, pageSize);
|
|
||||||
Page<DatasetVO> page = datasetMapper.pageQuery(dataSetPageQueryDTO);
|
Page<DatasetVO> page = datasetMapper.pageQuery(dataSetPageQueryDTO);
|
||||||
return new PageResult(page.getTotal(), page.getResult());
|
return new PageResult(page.getTotal(), page.getResult());
|
||||||
}
|
}
|
||||||
@ -88,16 +93,16 @@ public class DatasetServiceImpl implements DatasetService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void deleteBatch(List<Integer> datasetIds) {
|
public void deleteBatch(List<Long> datasetIds) {
|
||||||
for (Integer datasetId : datasetIds) {
|
for (Long datasetId : datasetIds) {
|
||||||
DatasetEntity datasetEntity = datasetMapper.getById(datasetId);
|
DatasetEntity datasetEntity = datasetMapper.getById(datasetId);
|
||||||
if (datasetEntity == null) {
|
if (datasetEntity == null) {
|
||||||
throw new IllegalArgumentException("数据集不存在,ID:" + datasetId);
|
throw new IllegalArgumentException("数据集不存在,ID:" + datasetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//TODO 在分布式文件系统中删除
|
//TODO 在分布式文件系统中删除
|
||||||
|
|
||||||
datasetMapper.deleteBatch(datasetIds);
|
datasetMapper.deleteBatch(datasetIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,15 +25,19 @@
|
|||||||
<if test="args != null">
|
<if test="args != null">
|
||||||
args=#{args},
|
args=#{args},
|
||||||
</if>
|
</if>
|
||||||
<if test="create_time != null">
|
<if test="updateTime != null">
|
||||||
create_time=#{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="update_time != null">
|
|
||||||
update_time=#{updateTime}
|
update_time=#{updateTime}
|
||||||
</if>
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where dataset_id = #{datasetId}
|
where dataset_id = #{datasetId}
|
||||||
</update>
|
</update>
|
||||||
|
<delete id="deleteBatch">
|
||||||
|
DELETE FROM dataset
|
||||||
|
WHERE dataset_id IN
|
||||||
|
<foreach collection="datasetIds" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
<select id="pageQuery" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetVO">
|
<select id="pageQuery" resultType="com.bipt.intelligentapplicationorchestrationservice.pojo.DatasetVO">
|
||||||
SELECT * FROM dataset
|
SELECT * FROM dataset
|
||||||
<where>
|
<where>
|
||||||
@ -49,8 +53,8 @@
|
|||||||
<if test="dsPath != null">
|
<if test="dsPath != null">
|
||||||
and ds_path=#{dsPath}
|
and ds_path=#{dsPath}
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="args != null">
|
||||||
and create_time=#{createTime}
|
and args=#{args}
|
||||||
</if>
|
</if>
|
||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
and create_time=#{createTime}
|
and create_time=#{createTime}
|
||||||
|
Reference in New Issue
Block a user