任务管理
parent
76761de5e8
commit
b33b59222e
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.domain.rule;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @PackageName:com.muyu.domain.rule
|
||||||
|
* @ClassName:Rule
|
||||||
|
* @Description:
|
||||||
|
* @author: ¥陈思豪¥
|
||||||
|
* @date: 2024/8/22 2:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name = "规则")
|
||||||
|
public class Rule {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则类型
|
||||||
|
*/
|
||||||
|
private String ruleType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否激活
|
||||||
|
*/
|
||||||
|
private String isActivate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则描述
|
||||||
|
*/
|
||||||
|
private String ruleDesc;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.domain.serialize;
|
package com.muyu.domain.serialize;
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
|
||||||
import cn.hutool.core.util.DesensitizedUtil;
|
import cn.hutool.core.util.DesensitizedUtil;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.databind.BeanProperty;
|
import com.fasterxml.jackson.databind.BeanProperty;
|
||||||
|
@ -64,6 +63,7 @@ public class DesensitizationSerialize extends JsonSerializer<String> implements
|
||||||
@Override
|
@Override
|
||||||
public JsonSerializer<?> createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) throws JsonMappingException {
|
public JsonSerializer<?> createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) throws JsonMappingException {
|
||||||
if (beanProperty != null) {
|
if (beanProperty != null) {
|
||||||
|
System.out.println("aaa");
|
||||||
// 判断数据类型是否为String类型
|
// 判断数据类型是否为String类型
|
||||||
if (Objects.equals(beanProperty.getType().getRawClass(), String.class)) {
|
if (Objects.equals(beanProperty.getType().getRawClass(), String.class)) {
|
||||||
// 获取定义的注解
|
// 获取定义的注解
|
||||||
|
@ -84,4 +84,6 @@ public class DesensitizationSerialize extends JsonSerializer<String> implements
|
||||||
}
|
}
|
||||||
return serializerProvider.findNullValueSerializer(null);
|
return serializerProvider.findNullValueSerializer(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,261 @@
|
||||||
|
package com.muyu.domain.util;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感数据脱敏工具类
|
||||||
|
*/
|
||||||
|
public class Desensitization {
|
||||||
|
/**
|
||||||
|
* 身份证号脱敏
|
||||||
|
*
|
||||||
|
* @param idCard
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String idCardDesensitization(String idCard) {
|
||||||
|
if (StringUtils.isNotEmpty(idCard)) {
|
||||||
|
// 身份证号脱敏规则一:保留前六后三
|
||||||
|
if (idCard.length() == 15) {
|
||||||
|
idCard = idCard.replaceAll("(\\w{6})\\w*(\\w{3})", "$1******$2");
|
||||||
|
} else if (idCard.length() == 18) {
|
||||||
|
idCard = idCard.replaceAll("(\\w{6})\\w*(\\w{3})", "$1*********$2");
|
||||||
|
}
|
||||||
|
// 身份证号脱敏规则二:保留前三后四
|
||||||
|
// idCard = idCard.replaceAll("(?<=\\w{3})\\w(?=\\w{4})", "*");
|
||||||
|
}
|
||||||
|
return idCard;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号码脱敏
|
||||||
|
*
|
||||||
|
* @param mobilePhone
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String mobilePhoneDesensitization(String mobilePhone) {
|
||||||
|
// 手机号码保留前三后四
|
||||||
|
if (StringUtils.isNotEmpty(mobilePhone)) {
|
||||||
|
mobilePhone = mobilePhone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
|
||||||
|
}
|
||||||
|
return mobilePhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子邮箱脱敏
|
||||||
|
*
|
||||||
|
* @param email
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String emailDesensitization(String email) {
|
||||||
|
// 电子邮箱隐藏@前面的3个字符
|
||||||
|
if (StringUtils.isEmpty(email)) {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
String encrypt = email.replaceAll("(\\w+)\\w{3}@(\\w+)", "$1***@$2");
|
||||||
|
if (email.equalsIgnoreCase(encrypt)) {
|
||||||
|
encrypt = email.replaceAll("(\\w*)\\w{1}@(\\w+)", "$1*@$2");
|
||||||
|
}
|
||||||
|
return encrypt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行账号脱敏
|
||||||
|
*
|
||||||
|
* @param acctNo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String acctNoDesensitization(String acctNo) {
|
||||||
|
// 银行账号保留前六后四
|
||||||
|
if (StringUtils.isNotEmpty(acctNo)) {
|
||||||
|
String regex = "(\\w{6})(.*)(\\w{4})";
|
||||||
|
Matcher m = Pattern.compile(regex).matcher(acctNo);
|
||||||
|
if (m.find()) {
|
||||||
|
String rep = m.group(2);
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < rep.length(); i++) {
|
||||||
|
sb.append("*");
|
||||||
|
}
|
||||||
|
acctNo = acctNo.replaceAll(rep, sb.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return acctNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户名称脱敏
|
||||||
|
*
|
||||||
|
* @param custName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String custNameDesensitization(String custName) {
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(custName)) {
|
||||||
|
char[] chars = custName.toCharArray();
|
||||||
|
if (chars.length < 5) {// 表示姓名
|
||||||
|
if (chars.length > 1) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = 0; i < chars.length - 2; i++) {
|
||||||
|
sb.append("*");
|
||||||
|
}
|
||||||
|
custName = custName.replaceAll(custName.substring(1, chars.length - 1), sb.toString());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int start = 4;
|
||||||
|
String str1 = custName.substring(0, start);
|
||||||
|
String str2 = "";
|
||||||
|
if (chars.length == 5) {
|
||||||
|
str2 = "*";
|
||||||
|
} else if (chars.length == 6) {
|
||||||
|
str2 = "**";
|
||||||
|
} else if (chars.length == 7) {
|
||||||
|
str2 = "***";
|
||||||
|
} else if (chars.length == 8) {
|
||||||
|
str2 = "****";
|
||||||
|
} else if (chars.length == 9) {
|
||||||
|
str2 = "*****";
|
||||||
|
} else {
|
||||||
|
str2 = "******";
|
||||||
|
}
|
||||||
|
// 通过计算得到第三部分需要从第几个字符截取
|
||||||
|
int subIndex = start + str2.length();
|
||||||
|
// 第三部分
|
||||||
|
String str3 = custName.substring(subIndex);
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(str1);
|
||||||
|
sb.append(str2);
|
||||||
|
sb.append(str3);
|
||||||
|
custName = sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return custName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 家庭地址脱敏
|
||||||
|
*
|
||||||
|
* @param address
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String addressDesensitization(String address) {
|
||||||
|
// 规则说明:从第4位开始隐藏,隐藏8位。
|
||||||
|
if (StringUtils.isNotEmpty(address)) {
|
||||||
|
char[] chars = address.toCharArray();
|
||||||
|
if (chars.length > 11) {// 由于需要从第4位开始,隐藏8位,因此数据长度必须大于11位
|
||||||
|
// 获取第一部分内容
|
||||||
|
String str1 = address.substring(0, 4);
|
||||||
|
// 获取第二部分
|
||||||
|
String str2 = "********";
|
||||||
|
// 获取第三部分
|
||||||
|
String str3 = address.substring(12);
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(str1);
|
||||||
|
sb.append(str2);
|
||||||
|
sb.append(str3);
|
||||||
|
address = sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
//下面代码是从别人博客看到的。
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义所有常量
|
||||||
|
*/
|
||||||
|
public static final int ONE = 1;
|
||||||
|
public static final int TWO = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名脱敏
|
||||||
|
*
|
||||||
|
* @param realName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String desensitizedName(String realName) {
|
||||||
|
if (realName == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (realName.length() == ONE) {
|
||||||
|
return realName;
|
||||||
|
} else if (realName.length() == TWO) {
|
||||||
|
return realName.substring(0, 1) +"*";
|
||||||
|
} else {
|
||||||
|
Integer length = realName.length();
|
||||||
|
StringBuffer middle = new StringBuffer();
|
||||||
|
for (int i = 0; i < realName.substring(1, length - 1).length(); i++) {
|
||||||
|
middle.append("*");
|
||||||
|
}
|
||||||
|
return realName.substring(0, 1) + middle + realName.substring(length - 1, length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址脱敏
|
||||||
|
*
|
||||||
|
* @param address
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String desensitizedAddress(String address){
|
||||||
|
//江西省宜春市丰城市剑南街道人才教育小区41号丰城住总运营有限公司-->江西省宜春市丰城市剑南街道人才教育小区*************
|
||||||
|
if (StringUtils.isNotEmpty(address)) {
|
||||||
|
int length = address.length();
|
||||||
|
int indes = address.indexOf("区");
|
||||||
|
if (indes == -1) {
|
||||||
|
indes = address.indexOf("市");
|
||||||
|
}
|
||||||
|
address = address.substring(0, indes + 1);
|
||||||
|
StringBuffer middle = new StringBuffer();
|
||||||
|
for (int i = 0; i < length - indes; i++) {
|
||||||
|
middle.append("*");
|
||||||
|
}
|
||||||
|
return address + middle;
|
||||||
|
}
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对字符串进行脱敏操作
|
||||||
|
*
|
||||||
|
* @param origin 原始字符串
|
||||||
|
* @param prefixNoMaskLen 左侧需要保留几位明文字段
|
||||||
|
* @param suffixNoMaskLen 右侧需要保留几位明文字段
|
||||||
|
* @param maskStr 用于遮罩的字符串, 如'*'
|
||||||
|
* @return 脱敏后结果
|
||||||
|
*/
|
||||||
|
public static String desValue(String origin, int prefixNoMaskLen, int suffixNoMaskLen, String maskStr) {
|
||||||
|
if (origin == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0, n = origin.length(); i < n; i++) {
|
||||||
|
if (i < prefixNoMaskLen) {
|
||||||
|
sb.append(origin.charAt(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (i > (n - suffixNoMaskLen - 1)) {
|
||||||
|
sb.append(origin.charAt(i));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
sb.append(maskStr);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中文姓名,只显示最后一个汉字,其他隐藏为星号,比如:**梦
|
||||||
|
*
|
||||||
|
* @param fullName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String chineseName(String fullName) {
|
||||||
|
if (fullName == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return desValue(fullName, 0, 1, "*");
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,4 +18,7 @@ public class SensitiveController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AnnotationDTOService annotationDTOService;
|
private AnnotationDTOService annotationDTOService;
|
||||||
|
|
||||||
|
// Desensitization
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
package com.muyu.cloud.etl.controller;
|
package com.muyu.cloud.etl.controller;
|
||||||
|
|
||||||
import com.muyu.cloud.etl.service.SysJobService;
|
import com.muyu.cloud.etl.service.SysJobService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.muyu.domain.job.SysJob;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static io.netty.handler.codec.http.multipart.DiskFileUpload.prefix;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @PackageName:com.muyu.cloud.etl.controller
|
* @PackageName:com.muyu.cloud.etl.controller
|
||||||
|
@ -14,9 +23,37 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/monitor/job")
|
@RequestMapping("/monitor/job")
|
||||||
public class SysJobController {
|
public class SysJobController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysJobService sysJobService;
|
private SysJobService jobService;
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String job()
|
||||||
|
{
|
||||||
|
return prefix + "/job";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresPermissions("monitor:job:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<TableDataInfo<SysJob>> list(SysJob job)
|
||||||
|
{
|
||||||
|
List<SysJob> list = jobService.selectJobList(job);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务调度状态修改
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("monitor:job:changeStatus")
|
||||||
|
@PostMapping("/changeStatus")
|
||||||
|
public Result changeStatus(SysJob job)
|
||||||
|
{
|
||||||
|
SysJob newJob = jobService.selectJobById(job.getJobId());
|
||||||
|
newJob.setStatus(job.getStatus());
|
||||||
|
return Result.success(jobService.changeStatus(newJob));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.cloud.etl.controller;
|
package com.muyu.cloud.etl.controller;
|
||||||
|
|
||||||
import com.muyu.domain.DesensitizationAdmin;
|
import com.muyu.domain.DesensitizationAdmin;
|
||||||
|
import com.muyu.domain.dto.AnnotationDTO;
|
||||||
import com.muyu.domain.enumerate.Desensitization;
|
import com.muyu.domain.enumerate.Desensitization;
|
||||||
import com.muyu.domain.util.DesensitizationUtil;
|
import com.muyu.domain.util.DesensitizationUtil;
|
||||||
import org.apache.catalina.User;
|
import org.apache.catalina.User;
|
||||||
|
@ -18,11 +19,14 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class Text2Controller {
|
public class Text2Controller {
|
||||||
@Desensitization //意思为当前返回的数据要进行脱敏
|
@Desensitization //意思为当前返回的数据要进行脱敏
|
||||||
@RequestMapping("/datase")
|
@RequestMapping("/datase")
|
||||||
public String test(){
|
public AnnotationDTO test(AnnotationDTO annotationDTO){
|
||||||
DesensitizationAdmin desensitizationAdmin = new DesensitizationAdmin();
|
|
||||||
desensitizationAdmin.setUserName("单薄好");
|
String s = DesensitizationUtil.chineseName(annotationDTO.getName());
|
||||||
String s = DesensitizationUtil.chineseName("陈思豪");
|
annotationDTO.setName(s);
|
||||||
return s;
|
annotationDTO.setEmail(DesensitizationUtil.email(annotationDTO.getEmail()));
|
||||||
|
annotationDTO.setTel(DesensitizationUtil.email(annotationDTO.getTel()));
|
||||||
|
annotationDTO.setIdCard(DesensitizationUtil.email(annotationDTO.getIdCard()));
|
||||||
|
return annotationDTO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class TextController {
|
||||||
|
|
||||||
@GetMapping("/test-annotation")
|
@GetMapping("/test-annotation")
|
||||||
public AnnotationDTO testAnnotation(AnnotationDTO annotationDTO) {
|
public AnnotationDTO testAnnotation(AnnotationDTO annotationDTO) {
|
||||||
annotationDTO.setPhone("1111111111111");
|
annotationDTO.setTel("1111111111111");
|
||||||
annotationDTO.setEmail("1437200980@qq.com");
|
annotationDTO.setEmail("1437200980@qq.com");
|
||||||
annotationDTO.setIdCard("1342543654544322754635");
|
annotationDTO.setIdCard("1342543654544322754635");
|
||||||
return annotationDTO;
|
return annotationDTO;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.muyu.cloud.etl.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.domain.job.SysJob;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface SysJobMapper extends BaseMapper<SysJob> {
|
||||||
|
}
|
|
@ -1,5 +1,11 @@
|
||||||
package com.muyu.cloud.etl.service;
|
package com.muyu.cloud.etl.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.domain.SourceType;
|
||||||
|
import com.muyu.domain.job.SysJob;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @PackageName:com.muyu.cloud.etl.service
|
* @PackageName:com.muyu.cloud.etl.service
|
||||||
* @ClassName:SysJobService
|
* @ClassName:SysJobService
|
||||||
|
@ -7,5 +13,32 @@ package com.muyu.cloud.etl.service;
|
||||||
* @author: ¥陈思豪¥
|
* @author: ¥陈思豪¥
|
||||||
* @date: 2024/8/21 22:42
|
* @date: 2024/8/21 22:42
|
||||||
*/
|
*/
|
||||||
public class SysJobService {
|
public interface SysJobService extends IService<SysJob> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取quartz调度器的计划任务
|
||||||
|
*
|
||||||
|
* @param job 调度信息
|
||||||
|
* @return 调度任务集合
|
||||||
|
*/
|
||||||
|
public List<SysJob> selectJobList(SysJob job);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过调度任务ID查询调度信息
|
||||||
|
*
|
||||||
|
* @param jobId 调度任务ID
|
||||||
|
* @return 调度任务对象信息
|
||||||
|
*/
|
||||||
|
public SysJob selectJobById(Long jobId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务调度状态修改
|
||||||
|
*
|
||||||
|
* @param job 调度信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int changeStatus(SysJob job);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.cloud.etl.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.etl.mapper.SourceTypeMapper;
|
||||||
|
import com.muyu.cloud.etl.mapper.SysJobMapper;
|
||||||
|
import com.muyu.cloud.etl.service.SourceTypeService;
|
||||||
|
import com.muyu.cloud.etl.service.SysJobService;
|
||||||
|
import com.muyu.domain.SourceType;
|
||||||
|
import com.muyu.domain.job.SysJob;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @PackageName:com.muyu.cloud.etl.service.impl
|
||||||
|
* @ClassName:SysJobServiceImpl
|
||||||
|
* @Description:
|
||||||
|
* @author: ¥陈思豪¥
|
||||||
|
* @date: 2024/8/22 0:35
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysJobServiceImpl extends ServiceImpl<SysJobMapper, SysJob> implements SysJobService {
|
||||||
|
@Override
|
||||||
|
public List<SysJob> selectJobList(SysJob job) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysJob selectJobById(Long jobId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int changeStatus(SysJob job) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.muyu.cloud.rule.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.domain.rule.Rule;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @PackageName:com.muyu.cloud.rule
|
||||||
|
* @ClassName:RuleController
|
||||||
|
* @Description:
|
||||||
|
* @author: ¥陈思豪¥
|
||||||
|
* @date: 2024/8/22 2:10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/rule")
|
||||||
|
public class RuleController {
|
||||||
|
@Autowired
|
||||||
|
private RuleService ruleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "查看规则", description = "规则")
|
||||||
|
public Result<List<Rule>> select(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.select(rule));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则修改
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/update")
|
||||||
|
public Result update(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.updateById(rule));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则删除
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/delete")
|
||||||
|
public Result delete(@RequestParam Integer id) {
|
||||||
|
return Result.success(ruleService.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则添加
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/insert")
|
||||||
|
public Result insert(@RequestBody Rule rule) {
|
||||||
|
return Result.success(ruleService.save(rule));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.muyu.cloud.rule.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.domain.rule.Rule;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RuleMapper extends BaseMapper<Rule> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.muyu.cloud.rule.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.domain.rule.Rule;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface RuleService extends IService<Rule> {
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
* @param rule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Rule> select(Rule rule);
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.cloud.rule.service.impl
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
|
||||||
|
import com.muyu.cloud.rule.mapper.RuleMapper
|
||||||
|
import com.muyu.cloud.rule.service.RuleService
|
||||||
|
import com.muyu.domain.SourceType
|
||||||
|
import com.muyu.domain.rule.Rule
|
||||||
|
import org.springframework.stereotype.Service
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class RuleServiceImpl extends ServiceImpl<RuleMapper, Rule> implements RuleService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Rule> select(Rule rule) {
|
||||||
|
LambdaQueryWrapper<Rule> sourceTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
return this.list(sourceTypeLambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
}
|
17866
logs/cloud-etl/error.log
17866
logs/cloud-etl/error.log
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue