Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # srt-cloud-data-governance/src/main/java/net/srt/convert/DatastandardConvert.java # srt-cloud-data-governance/src/main/java/net/srt/dao/DatastandardDao.java # srt-cloud-data-governance/src/main/java/net/srt/entity/DatastandardEntity.java # srt-cloud-data-governance/src/main/java/net/srt/service/DatastandardService.java # srt-cloud-data-governance/src/main/java/net/srt/service/impl/DatastandardServiceImpl.javapull/3/head
commit
5fb56a00bc
|
@ -17,5 +17,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
|||
public class GovernanceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(GovernanceApplication.class, args);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|||
@SpringBootApplication
|
||||
@MapperScan("net.srt.Fink.mapper")
|
||||
@MapperScan("net.srt.Hadoop.mapper")
|
||||
@MapperScan("net.srt.disposition.mapper")
|
||||
public class DevelopmentApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DevelopmentApp.class);
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package net.srt.Fink.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.Fink.dto.FinkAddDto;
|
||||
import net.srt.Fink.dto.FinkDto;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.service.FinkService;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Fink.vo.request.AddFink;
|
||||
import net.srt.Fink.vo.request.FinkRequest;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
|
@ -22,57 +22,44 @@ public class FinkController {
|
|||
|
||||
/**
|
||||
* 列表
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param name
|
||||
* @param alias
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
public Result<PageResult<FinkVo>> finkPage(
|
||||
@RequestParam Integer page,
|
||||
@RequestParam Integer limit,
|
||||
@RequestParam(value = "name", required = false) String name,
|
||||
@RequestParam(value = "alias", required = false) String alias) {
|
||||
FinkRequest finkRequest = new FinkRequest();
|
||||
finkRequest.setAlias(alias);
|
||||
finkRequest.setPage(page);
|
||||
finkRequest.setLimit(limit);
|
||||
finkRequest.setName(name);
|
||||
PageResult<FinkVo> pageResult = finkService.finkPage(finkRequest);
|
||||
public Result<PageResult<FinkVo>> finkPage(@Valid FinkDto finkDto) {
|
||||
PageResult<FinkVo> pageResult = finkService.finkPage(finkDto);
|
||||
return Result.ok(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param finkVo
|
||||
* @param finkAddDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public Result devAdd(@RequestBody FinkVo finkVo){
|
||||
finkService.add(finkVo);
|
||||
public Result devAdd(@RequestBody FinkAddDto finkAddDto){
|
||||
finkService.add(finkAddDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param finkVo
|
||||
* 修改
|
||||
* @param finkAddDto
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public Result devUpd(@RequestBody FinkVo finkVo){
|
||||
finkService.upd(finkVo);
|
||||
public Result devUpd(@RequestBody FinkAddDto finkAddDto){
|
||||
finkService.upd(finkAddDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param finkVo
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result devDel(@RequestBody List<FinkVo> finkVo){
|
||||
finkService.del(finkVo);
|
||||
public Result devDel(@RequestBody List<Long> ids){
|
||||
finkService.del(ids);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
@ -82,8 +69,8 @@ public class FinkController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public Result<FinkVo> finkVoResult(@PathVariable Integer id){
|
||||
return Result.ok(finkService.findFinkVo(id));
|
||||
public Result<FinkEntity> FinkEntityResult(@PathVariable Integer id){
|
||||
return Result.ok(finkService.findFinkEntity(id));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,20 @@
|
|||
package net.srt.Fink.convert;
|
||||
|
||||
import net.srt.Fink.dto.FinkAddDto;
|
||||
import net.srt.Fink.dto.FinkDto;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface FinkConvert {
|
||||
List<FinkVo> devList(List<FinkVo> list);
|
||||
FinkConvert INSTANCE = Mappers.getMapper(FinkConvert.class);
|
||||
|
||||
List<FinkVo> devList(List<FinkEntity> list);
|
||||
|
||||
FinkEntity convert(FinkAddDto vo);
|
||||
|
||||
FinkVo convert(FinkEntity entity);
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
package net.srt.Fink.convert;
|
||||
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class FinkConvertImp implements FinkConvert{
|
||||
@Override
|
||||
public List<FinkVo> devList(List<FinkVo> list) {
|
||||
if (list==null){
|
||||
return null;
|
||||
}
|
||||
ArrayList<FinkVo> finkVos = new ArrayList<>();
|
||||
for (FinkVo finkVo : list) {
|
||||
finkVos.add(finkVo);
|
||||
}
|
||||
return finkVos;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package net.srt.Fink.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
public class FinkAddDto {
|
||||
private Integer id;
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private Integer type;
|
||||
private String hosts;
|
||||
private String jobManagerHost;
|
||||
private String flinkVersion;
|
||||
private Integer status;
|
||||
private String note;
|
||||
private Byte autoRegisters;
|
||||
private Integer clusterConfigurationId;
|
||||
private Integer taskId;
|
||||
private boolean enabled;
|
||||
private Integer version;
|
||||
private Integer deleted;
|
||||
private Integer creator;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private Integer updater;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package net.srt.Fink.vo.request;
|
||||
package net.srt.Fink.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.query.Query;
|
||||
|
||||
@Data
|
||||
public class FinkRequest extends Query {
|
||||
public class FinkDto extends Query {
|
||||
private String name;
|
||||
private String alias;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package net.srt.Fink.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
@TableName("cluster_info")
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class FinkEntity extends BaseEntity {
|
||||
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private Integer type;
|
||||
private String hosts;
|
||||
private String jobManagerHost;
|
||||
private String flinkVersion;
|
||||
private Integer status;
|
||||
private String note;
|
||||
private Byte autoRegisters;
|
||||
private Integer clusterConfigurationId;
|
||||
private Integer taskId;
|
||||
private boolean enabled;
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package net.srt.Fink.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
public interface FinkMapper extends BaseMapper<FinkVo> {
|
||||
public interface FinkMapper extends BaseMapper<FinkEntity> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
package net.srt.Fink.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.srt.Fink.dto.FinkAddDto;
|
||||
import net.srt.Fink.dto.FinkDto;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Fink.vo.request.AddFink;
|
||||
import net.srt.Fink.vo.request.FinkRequest;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FinkService extends IService<FinkVo> {
|
||||
PageResult<FinkVo> finkPage(FinkRequest finkRequest);
|
||||
public interface FinkService extends IService<FinkEntity> {
|
||||
PageResult<FinkVo> finkPage(FinkDto finkRequest);
|
||||
|
||||
void add(FinkVo finkVo);
|
||||
void add(FinkAddDto finkAddDto);
|
||||
|
||||
void upd(FinkVo finkVo);
|
||||
void upd(FinkAddDto finkAddDto);
|
||||
|
||||
void del(List<FinkVo> finkVo);
|
||||
void del(List<Long> finkDtos);
|
||||
|
||||
FinkVo findFinkVo(Integer id);
|
||||
FinkEntity findFinkEntity(Integer id);
|
||||
}
|
||||
|
|
|
@ -1,76 +1,66 @@
|
|||
package net.srt.Fink.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.srt.Fink.convert.FinkConvert;
|
||||
import net.srt.Fink.dto.FinkAddDto;
|
||||
import net.srt.Fink.dto.FinkDto;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.mapper.FinkMapper;
|
||||
import net.srt.Fink.service.FinkService;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Fink.vo.request.FinkRequest;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import net.srt.framework.security.cache.TokenStoreCache;
|
||||
import net.srt.framework.security.user.UserDetail;
|
||||
import net.srt.framework.security.utils.TokenUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@Slf4j
|
||||
public class FinkServiceImpl extends BaseServiceImpl<FinkMapper,FinkVo> implements FinkService {
|
||||
public class FinkServiceImpl extends BaseServiceImpl<FinkMapper,FinkEntity> implements FinkService {
|
||||
|
||||
private FinkMapper finkMapper;
|
||||
|
||||
private FinkConvert finkConvert;
|
||||
@Override
|
||||
public PageResult<FinkVo> finkPage(FinkRequest finkRequest) {
|
||||
IPage<FinkVo> page = finkMapper.selectPage(getPage(finkRequest), getWrapper(finkRequest));
|
||||
return new PageResult<>(finkConvert.devList(page.getRecords()), page.getTotal());
|
||||
}
|
||||
public PageResult<FinkVo> finkPage(FinkDto finkRequest) {
|
||||
LambdaQueryWrapper<FinkEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(finkRequest.getName()), FinkEntity::getName, finkRequest.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(finkRequest.getAlias()), FinkEntity::getAlias, finkRequest.getAlias());
|
||||
IPage<FinkEntity> page = baseMapper.selectPage(getPage(finkRequest), wrapper);
|
||||
return new PageResult<>(FinkConvert.INSTANCE.devList(page.getRecords()), page.getTotal());
|
||||
|
||||
private LambdaQueryWrapper<FinkVo> getWrapper(FinkRequest query){
|
||||
LambdaQueryWrapper<FinkVo> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(query.getName()), FinkVo::getName, query.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(query.getAlias()), FinkVo::getAlias, query.getAlias());
|
||||
dataScopeWithoutOrgId(wrapper);
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(FinkVo finkVo) {
|
||||
public void add(FinkAddDto finkAddDto) {
|
||||
Date date = new Date();
|
||||
finkVo.setCreateTime(date);
|
||||
finkMapper.insert(finkVo);
|
||||
finkAddDto.setCreateTime(date);
|
||||
FinkEntity finkEntity = FinkConvert.INSTANCE.convert(finkAddDto);
|
||||
baseMapper.insert(finkEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upd(FinkVo finkVo) {
|
||||
public void upd(FinkAddDto finkAddDto) {
|
||||
Date date = new Date();
|
||||
finkVo.setCreateTime(date);
|
||||
finkMapper.updateById(finkVo);
|
||||
finkAddDto.setCreateTime(date);
|
||||
FinkEntity finkEntity = FinkConvert.INSTANCE.convert(finkAddDto);
|
||||
baseMapper.updateById(finkEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(List<FinkVo> finkVo) {
|
||||
for (FinkVo vo : finkVo) {
|
||||
finkMapper.deleteById(vo.getId());
|
||||
public void del(List<Long> finkAddDtoList) {
|
||||
for (Long l : finkAddDtoList) {
|
||||
baseMapper.deleteById(l);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinkVo findFinkVo(Integer id) {
|
||||
return finkMapper.selectById(id);
|
||||
public FinkEntity findFinkEntity(Integer id) {
|
||||
return baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,9 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("cluster_info")
|
||||
public class FinkVo {
|
||||
@TableId("id")
|
||||
private Integer id;
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package net.srt.Fink.vo.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AddFink {
|
||||
private String name;
|
||||
private String alias;
|
||||
private Integer type;
|
||||
private String hosts;
|
||||
private boolean enabled;
|
||||
private String note;
|
||||
}
|
|
@ -1,9 +1,10 @@
|
|||
package net.srt.Hadoop.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.Hadoop.dto.HadoopAddDto;
|
||||
import net.srt.Hadoop.service.HadoopService;
|
||||
import net.srt.Hadoop.dto.HadoopDto;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import net.srt.Hadoop.vo.request.HadoopRequest;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -21,7 +22,7 @@ public class HadoopController {
|
|||
@RequestParam Integer limit,
|
||||
@RequestParam(value = "name", required = false) String name,
|
||||
@RequestParam(value = "alias", required = false) String alias) {
|
||||
HadoopRequest hadoopRequest = new HadoopRequest();
|
||||
HadoopDto hadoopRequest = new HadoopDto();
|
||||
hadoopRequest.setPage(page);
|
||||
hadoopRequest.setLimit(limit);
|
||||
hadoopRequest.setName(name);
|
||||
|
@ -31,34 +32,34 @@ public class HadoopController {
|
|||
}
|
||||
/**
|
||||
* 添加
|
||||
* @param hadoopVo
|
||||
* @param HadoopAddDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
public Result hadoopAdd(@RequestBody HadoopVo hadoopVo){
|
||||
hadoopService.add(hadoopVo);
|
||||
public Result hadoopAdd(@RequestBody HadoopAddDto HadoopAddDto){
|
||||
hadoopService.add(HadoopAddDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param hadoopVo
|
||||
* @param HadoopAddDto
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public Result hadoopUpd(@RequestBody HadoopVo hadoopVo){
|
||||
hadoopService.upd(hadoopVo);
|
||||
public Result hadoopUpd(@RequestBody HadoopAddDto HadoopAddDto){
|
||||
hadoopService.upd(HadoopAddDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param hadoopVo
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping
|
||||
public Result hadoopDel(@RequestBody List<HadoopVo> hadoopVo){
|
||||
hadoopService.del(hadoopVo);
|
||||
public Result hadoopDel(@RequestBody List<Long> ids){
|
||||
hadoopService.del(ids);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
@ -68,7 +69,7 @@ public class HadoopController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("{id}")
|
||||
public Result<HadoopVo> hadoopVoResult(@PathVariable Integer id){
|
||||
public Result<HadoopVo> HadoopAddDtoResult(@PathVariable Integer id){
|
||||
return Result.ok(hadoopService.findHadoopVo(id));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
package net.srt.Hadoop.convert;
|
||||
|
||||
import net.srt.Fink.convert.FinkConvert;
|
||||
import net.srt.Fink.dto.FinkAddDto;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Hadoop.dto.HadoopAddDto;
|
||||
import net.srt.Hadoop.dto.HadoopDto;
|
||||
import net.srt.Hadoop.entity.HadoopEntity;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface HadoopConvert {
|
||||
List<HadoopVo> hadoopList(List<HadoopVo> list);
|
||||
HadoopConvert INSTANCE = Mappers.getMapper(HadoopConvert.class);
|
||||
List<HadoopVo> hadoopList(List<HadoopEntity> list);
|
||||
|
||||
HadoopEntity convert(HadoopAddDto dto);
|
||||
|
||||
HadoopVo convert(HadoopEntity entity);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package net.srt.Hadoop.convert;
|
||||
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Service
|
||||
public class HadoopConvertImp implements HadoopConvert {
|
||||
|
||||
@Override
|
||||
public List<HadoopVo> hadoopList(List<HadoopVo> list) {
|
||||
if (list==null){
|
||||
return null;
|
||||
}
|
||||
ArrayList<HadoopVo> hadoopVos = new ArrayList<>();
|
||||
for (HadoopVo hadoopVo : list) {
|
||||
hadoopVos.add(hadoopVo);
|
||||
}
|
||||
return hadoopVos;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package net.srt.Hadoop.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class HadoopAddDto {
|
||||
private Integer id;
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private String type;
|
||||
private String configJson;
|
||||
private Boolean isAvailable;
|
||||
private String note;
|
||||
private Boolean enabled;
|
||||
private Integer version;
|
||||
private Integer deleted;
|
||||
private Integer creator;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private Integer updater;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
private String config;
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package net.srt.Hadoop.vo.request;
|
||||
package net.srt.Hadoop.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import net.srt.framework.common.query.Query;
|
||||
|
||||
@Data
|
||||
public class HadoopRequest extends Query {
|
||||
public class HadoopDto extends Query {
|
||||
private String name;
|
||||
private String alias;
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package net.srt.Hadoop.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("hadoop_info")
|
||||
public class HadoopEntity extends BaseEntity {
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private String type;
|
||||
private String configJson;
|
||||
private Boolean isAvailable;
|
||||
private String note;
|
||||
private Boolean enabled;
|
||||
private String config;
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package net.srt.Hadoop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.srt.Hadoop.entity.HadoopEntity;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
public interface HadoopMapper extends BaseMapper<HadoopVo> {
|
||||
public interface HadoopMapper extends BaseMapper<HadoopEntity> {
|
||||
}
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
package net.srt.Hadoop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Hadoop.dto.HadoopAddDto;
|
||||
import net.srt.Hadoop.entity.HadoopEntity;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import net.srt.Hadoop.vo.request.HadoopRequest;
|
||||
import net.srt.Hadoop.dto.HadoopDto;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface HadoopService extends IService<HadoopVo> {
|
||||
PageResult<HadoopVo> hadoopPage(HadoopRequest hadoopRequest);
|
||||
public interface HadoopService extends IService<HadoopEntity> {
|
||||
PageResult<HadoopVo> hadoopPage(HadoopDto hadoopRequest);
|
||||
|
||||
void add(HadoopVo hadoopVo);
|
||||
void add(HadoopAddDto HadoopAddDto);
|
||||
|
||||
HadoopVo findHadoopVo(Integer id);
|
||||
|
||||
void del(List<HadoopVo> hadoopVo);
|
||||
void del(List<Long> ids);
|
||||
|
||||
void upd(HadoopVo hadoopVo);
|
||||
void upd(HadoopAddDto HadoopAddDto);
|
||||
}
|
||||
|
|
|
@ -5,14 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.Fink.vo.FinkVo;
|
||||
import net.srt.Fink.vo.request.FinkRequest;
|
||||
import net.srt.Hadoop.controller.HadoopController;
|
||||
import net.srt.Fink.convert.FinkConvert;
|
||||
import net.srt.Hadoop.convert.HadoopConvert;
|
||||
import net.srt.Hadoop.dto.HadoopAddDto;
|
||||
import net.srt.Hadoop.entity.HadoopEntity;
|
||||
import net.srt.Hadoop.mapper.HadoopMapper;
|
||||
import net.srt.Hadoop.service.HadoopService;
|
||||
import net.srt.Hadoop.vo.HadoopVo;
|
||||
import net.srt.Hadoop.vo.request.HadoopRequest;
|
||||
import net.srt.Hadoop.dto.HadoopDto;
|
||||
import net.srt.framework.common.page.PageResult;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -21,42 +21,39 @@ import java.util.List;
|
|||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class HadoopServiceImpl extends BaseServiceImpl<HadoopMapper, HadoopVo> implements HadoopService {
|
||||
private HadoopMapper hadoopMapper;
|
||||
private HadoopConvert hadoopList;
|
||||
public class HadoopServiceImpl extends BaseServiceImpl<HadoopMapper, HadoopEntity> implements HadoopService {
|
||||
@Override
|
||||
public PageResult<HadoopVo> hadoopPage(HadoopRequest hadoopRequest) {
|
||||
IPage<HadoopVo> page = hadoopMapper.selectPage(getPage(hadoopRequest), getWrapper(hadoopRequest));
|
||||
return new PageResult<>(hadoopList.hadoopList(page.getRecords()), page.getTotal());
|
||||
public PageResult<HadoopVo> hadoopPage(HadoopDto hadoopRequest) {
|
||||
LambdaQueryWrapper<HadoopEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(hadoopRequest.getName()), HadoopEntity::getName, hadoopRequest.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(hadoopRequest.getAlias()), HadoopEntity::getAlias, hadoopRequest.getAlias());
|
||||
IPage<HadoopEntity> page = baseMapper.selectPage(getPage(hadoopRequest), wrapper);
|
||||
return new PageResult<>(HadoopConvert.INSTANCE.hadoopList(page.getRecords()), page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(HadoopVo hadoopVo) {
|
||||
|
||||
public void add(HadoopAddDto hadoopAddDto) {
|
||||
HadoopEntity convert = HadoopConvert.INSTANCE.convert(hadoopAddDto);
|
||||
baseMapper.insert(convert);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HadoopVo findHadoopVo(Integer id) {
|
||||
return hadoopMapper.selectById(id);
|
||||
HadoopEntity hadoopEntity = baseMapper.selectById(id);
|
||||
HadoopVo convert = HadoopConvert.INSTANCE.convert(hadoopEntity);
|
||||
return convert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void del(List<HadoopVo> hadoopVo) {
|
||||
for (HadoopVo vo : hadoopVo) {
|
||||
hadoopMapper.deleteById(vo);
|
||||
public void del(List<Long> ids) {
|
||||
for (Long id : ids) {
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upd(HadoopVo hadoopVo) {
|
||||
hadoopMapper.updateById(hadoopVo);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<HadoopVo> getWrapper(HadoopRequest hadoopRequest){
|
||||
LambdaQueryWrapper<HadoopVo> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.like(StrUtil.isNotBlank(hadoopRequest.getName()), HadoopVo::getName, hadoopRequest.getName());
|
||||
wrapper.like(StrUtil.isNotBlank(hadoopRequest.getAlias()), HadoopVo::getAlias, hadoopRequest.getAlias());
|
||||
dataScopeWithoutOrgId(wrapper);
|
||||
return wrapper;
|
||||
public void upd(HadoopAddDto hadoopAddDto) {
|
||||
HadoopEntity convert = HadoopConvert.INSTANCE.convert(hadoopAddDto);
|
||||
baseMapper.updateById(convert);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,9 +9,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("hadoop_info")
|
||||
public class HadoopVo {
|
||||
@TableId("id")
|
||||
private Integer id;
|
||||
private Integer projectId;
|
||||
private String name;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package net.srt.disposition.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.disposition.service.DataProductionService;
|
||||
import net.srt.disposition.vo.DataProductionTreeVo;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/catalogue")
|
||||
public class DataProductionTreeController {
|
||||
|
||||
private DataProductionService dataProductionService;
|
||||
|
||||
@GetMapping
|
||||
public Result<List<DataProductionTreeVo>> listResult(){
|
||||
List<DataProductionTreeVo> dispositionVos=dataProductionService.dataTreeList();
|
||||
return Result.ok(dispositionVos);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package net.srt.disposition.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.disposition.dto.DispositionDto;
|
||||
import net.srt.disposition.service.DispositionService;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
import net.srt.framework.common.utils.Result;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("sys-config")
|
||||
public class DispositionController {
|
||||
|
||||
private DispositionService dispositionService;
|
||||
|
||||
@GetMapping("/getAll")
|
||||
public Result<DispositionVo> getAll() {
|
||||
DispositionVo dispositionVo=dispositionService.getAll();
|
||||
return Result.ok(dispositionVo);
|
||||
}
|
||||
|
||||
@PostMapping("/updateSysConfigByJson")
|
||||
public Result upd(@RequestBody DispositionDto dispositionDto) {
|
||||
dispositionService.upd(dispositionDto);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package net.srt.disposition.convert;
|
||||
|
||||
import net.srt.disposition.dto.DispositionDto;
|
||||
import net.srt.disposition.entity.DispositionEntity;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface DataProductionTreeConvert {
|
||||
DataProductionTreeConvert INSTANCE = Mappers.getMapper(DataProductionTreeConvert.class);
|
||||
DispositionVo convert(DispositionEntity entity);
|
||||
|
||||
DispositionEntity convert(DispositionDto vo);
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package net.srt.disposition.convert;
|
||||
|
||||
import net.srt.disposition.dto.DispositionDto;
|
||||
import net.srt.disposition.entity.DispositionEntity;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
@Mapper
|
||||
public interface DispositionConvert {
|
||||
DispositionConvert INSTANCE = Mappers.getMapper(DispositionConvert.class);
|
||||
DispositionVo convert(DispositionEntity entity);
|
||||
|
||||
DispositionEntity convert(DispositionDto vo);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package net.srt.disposition.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@TableName("flink_job_configuration")
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DispositionDto {
|
||||
@TableId
|
||||
private Integer id;
|
||||
private String sqlSeparator;
|
||||
private String sqlSubmitJarPath;
|
||||
private String sqlSubmitJarMainAppClass;
|
||||
private boolean useRestAPI;
|
||||
private String jobIdWait;
|
||||
private String sqlSubmitJarParas;
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package net.srt.disposition.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
|
||||
@Data
|
||||
@TableName("data_production_tree")
|
||||
public class DataProductionTreeEntity extends BaseEntity {
|
||||
private Long parentId;
|
||||
private Integer ifLeaf;
|
||||
private Long taskId;
|
||||
private String taskType;
|
||||
private String parentPath;
|
||||
private String path;
|
||||
private Integer orderNo;
|
||||
private String label;
|
||||
private Long metamodelId;
|
||||
private String name;
|
||||
private String icon;
|
||||
private String code;
|
||||
private Boolean builtin;
|
||||
private String description;
|
||||
private Long projectId;
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package net.srt.disposition.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@TableName("flink_job_configuration")
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DispositionEntity {
|
||||
@TableId("id")
|
||||
private Integer id;
|
||||
private String sqlSeparator;
|
||||
private String sqlSubmitJarPath;
|
||||
private String sqlSubmitJarMainAppClass;
|
||||
private boolean useRestAPI;
|
||||
private String jobIdWait;
|
||||
private String sqlSubmitJarParas;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package net.srt.disposition.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.srt.disposition.entity.DataProductionTreeEntity;
|
||||
|
||||
public interface DataProductionMapper extends BaseMapper<DataProductionTreeEntity> {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package net.srt.disposition.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import net.srt.disposition.entity.DispositionEntity;
|
||||
|
||||
public interface DispositionMapper extends BaseMapper<DispositionEntity> {
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package net.srt.disposition.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.srt.disposition.entity.DataProductionTreeEntity;
|
||||
import net.srt.disposition.vo.DataProductionTreeVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DataProductionService extends IService<DataProductionTreeEntity> {
|
||||
List<DataProductionTreeVo> dataTreeList();
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package net.srt.disposition.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import net.srt.disposition.dto.DispositionDto;
|
||||
import net.srt.disposition.entity.DispositionEntity;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
|
||||
public interface DispositionService extends IService<DispositionEntity> {
|
||||
DispositionVo getAll();
|
||||
|
||||
void upd(DispositionDto dispositionDto);
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package net.srt.disposition.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.Fink.entity.FinkEntity;
|
||||
import net.srt.disposition.entity.DataProductionTreeEntity;
|
||||
import net.srt.disposition.mapper.DataProductionMapper;
|
||||
import net.srt.disposition.service.DataProductionService;
|
||||
import net.srt.disposition.vo.DataProductionTreeVo;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DataProductionServiceImpl extends BaseServiceImpl<DataProductionMapper, DataProductionTreeEntity> implements DataProductionService {
|
||||
@Override
|
||||
public List<DataProductionTreeVo> dataTreeList() {
|
||||
List<DataProductionTreeEntity> dataProductionTreeEntities = baseMapper.selectList(null);
|
||||
for (DataProductionTreeEntity dataProductionTreeEntity : dataProductionTreeEntities) {
|
||||
List<DataProductionTreeVo> dataProductionTreeVos=findDataProductTreeVoList(dataProductionTreeEntity);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<DataProductionTreeVo> findDataProductTreeVoList(DataProductionTreeEntity dataProductionTreeEntity) {
|
||||
List<DataProductionTreeVo> dataProductionTreeVos=new ArrayList<>();
|
||||
QueryWrapper<DataProductionTreeEntity> dataProductionTreeEntityQueryWrapper = new QueryWrapper<>();
|
||||
dataProductionTreeEntityQueryWrapper.eq("parent_id",dataProductionTreeEntity.getId());
|
||||
List<DataProductionTreeEntity> dataProductionTreeEntities = baseMapper.selectList(dataProductionTreeEntityQueryWrapper);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package net.srt.disposition.service.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.srt.disposition.convert.DispositionConvert;
|
||||
import net.srt.disposition.dto.DispositionDto;
|
||||
import net.srt.disposition.entity.DispositionEntity;
|
||||
import net.srt.disposition.mapper.DispositionMapper;
|
||||
import net.srt.disposition.service.DispositionService;
|
||||
import net.srt.disposition.vo.DispositionVo;
|
||||
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class DispositionServiceImpl extends BaseServiceImpl<DispositionMapper, DispositionEntity> implements DispositionService {
|
||||
@Override
|
||||
public DispositionVo getAll() {
|
||||
DispositionEntity dispositionEntity = baseMapper.selectOne(null);
|
||||
DispositionVo convert = DispositionConvert.INSTANCE.convert(dispositionEntity);
|
||||
return convert;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void upd(DispositionDto dispositionDto) {
|
||||
DispositionEntity convert = DispositionConvert.INSTANCE.convert(dispositionDto);
|
||||
baseMapper.updateById(convert);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package net.srt.disposition.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import net.srt.framework.mybatis.entity.BaseEntity;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class DataProductionTreeVo {
|
||||
private Long id;
|
||||
private Long parentId;
|
||||
private Integer ifLeaf;
|
||||
private Long taskId;
|
||||
private String taskType;
|
||||
private String parentPath;
|
||||
private String path;
|
||||
private Integer orderNo;
|
||||
private String label;
|
||||
private Long metamodelId;
|
||||
private String name;
|
||||
private String icon;
|
||||
private String code;
|
||||
private Boolean builtin;
|
||||
private String description;
|
||||
private Long projectId;
|
||||
private Long creator;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
private List<DataProductionTreeVo> dataProductionTreeVos;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package net.srt.disposition.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class DispositionVo {
|
||||
private Integer id;
|
||||
private String sqlSeparator;
|
||||
private String sqlSubmitJarPath;
|
||||
private String sqlSubmitJarMainAppClass;
|
||||
private boolean useRestAPI;
|
||||
private String jobIdWait;
|
||||
private String sqlSubmitJarParas;
|
||||
}
|
Loading…
Reference in New Issue