数据源,规则,任务增删改查完毕
parent
a0846013d5
commit
1a98a81274
File diff suppressed because one or more lines are too long
|
@ -35,8 +35,11 @@ public class Task extends BaseMate {
|
|||
private Integer taskId;
|
||||
|
||||
@NotNull(message = "任务权重不能为空")
|
||||
@ApiModelProperty(value = "任务权重 1-紧急 2-高 3-中 4-低")
|
||||
private Integer taskWeight;
|
||||
@ApiModelProperty(value = "任务权重")
|
||||
private Integer weightId;
|
||||
|
||||
@ApiModelProperty(value = "任务等级")
|
||||
private Integer weightName;
|
||||
|
||||
@NotNull(message = "任务状态不能为空")
|
||||
@ApiModelProperty(value = "任务状态 1-执行中 2-暂停")
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.etl.database.common.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ApiModel(value = "任务权重实体类")
|
||||
@TableName("t_task_weight")
|
||||
public class TaskWeight {
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "任务权重id")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "任务权重")
|
||||
private String weightName;
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,27 @@
|
|||
package com.etl.database.server.controller;
|
||||
|
||||
import com.etl.common.result.Result;
|
||||
import com.etl.database.server.service.TaskWeightService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 任务权重
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value ="/taskweight")
|
||||
@Api(tags = "任务权重-API")
|
||||
public class TaskWeightController {
|
||||
@Autowired
|
||||
private TaskWeightService taskWeightService;
|
||||
|
||||
@GetMapping("/findDataSourceType")
|
||||
@ApiOperation(value = "查询数据源类型")
|
||||
public Result findTaskWeightType() {
|
||||
return taskWeightService.findTaskWeightType();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package com.etl.database.server.mapper;
|
||||
|
||||
import com.etl.database.common.entity.Task;
|
||||
import com.etl.database.common.entity.TaskWeight;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface TaskWeightMapper extends MPJBaseMapper<TaskWeight> {
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.etl.database.server.service;
|
||||
|
||||
import com.etl.common.result.Result;
|
||||
import com.etl.database.common.entity.Task;
|
||||
import com.etl.database.common.entity.TaskWeight;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
|
||||
public interface TaskWeightService extends MPJBaseService<TaskWeight> {
|
||||
|
||||
|
||||
Result findTaskWeightType();
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.etl.database.server.service.impl;
|
||||
|
||||
import com.etl.common.result.Result;
|
||||
import com.etl.database.common.entity.DataSourceType;
|
||||
import com.etl.database.common.entity.DataSources;
|
||||
import com.etl.database.common.entity.TaskWeight;
|
||||
import com.etl.database.server.mapper.DataSourceMapper;
|
||||
import com.etl.database.server.mapper.TaskWeightMapper;
|
||||
import com.etl.database.server.service.DataSouceService;
|
||||
import com.etl.database.server.service.TaskWeightService;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TaskWeightServiceImpl extends MPJBaseServiceImpl<TaskWeightMapper, TaskWeight> implements TaskWeightService {
|
||||
@Autowired
|
||||
private TaskWeightMapper taskWeightMapper;
|
||||
|
||||
@Override
|
||||
public Result findTaskWeightType() {
|
||||
MPJLambdaWrapper<TaskWeight> dataSourceTypeMPJLambdaWrapper = new MPJLambdaWrapper<TaskWeight>()
|
||||
.selectAll(TaskWeight.class);
|
||||
List<TaskWeight> dataSourceTypes = taskWeightMapper.selectJoinList(TaskWeight.class, dataSourceTypeMPJLambdaWrapper);
|
||||
return Result.success(dataSourceTypes);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue