pull/3/head
fjj 2023-12-24 22:19:18 +08:00
parent 78264f9ace
commit d201050250
21 changed files with 632 additions and 51 deletions

View File

@ -1,5 +1,6 @@
package net.srt; package net.srt;
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.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

View File

@ -0,0 +1,70 @@
package net.srt.controller;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import net.srt.convert.StandardStopwatchConvert;
import net.srt.entity.StandardStopwatchEntity;
import net.srt.framework.common.page.PageResult;
import net.srt.framework.common.utils.Result;
import net.srt.query.StandardStopwatchQuery;
import net.srt.service.StandardStopwatchService;
import net.srt.vo.StandardStopwatchVo;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
/**
* @ClassName : StandardStopwatchController
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:32
*/
@RestController
@RequestMapping("/standard-code")
@Tag(name="数据治理-标准码表数据")
@AllArgsConstructor
public class StandardStopwatchController {
private final StandardStopwatchService standardStopwatchService;
@GetMapping("page")
@Operation(summary = "分页")
public Result<PageResult<StandardStopwatchVo>> page(@Valid StandardStopwatchQuery query){
PageResult<StandardStopwatchVo> page = standardStopwatchService.page(query);
return Result.ok(page);
}
@GetMapping("{id}")
@Operation(summary = "信息")
public Result<StandardStopwatchVo> get(@PathVariable("id") Long id){
StandardStopwatchEntity entity = standardStopwatchService.getById(id);
return Result.ok(StandardStopwatchConvert.INSTANCE.convert(entity));
}
@PostMapping
@Operation(summary = "保存")
public Result<String> save(@RequestBody StandardStopwatchVo vo){
standardStopwatchService.save(vo);
return Result.ok();
}
@PutMapping
@Operation(summary = "修改")
public Result<String> update(@RequestBody @Valid StandardStopwatchVo vo){
standardStopwatchService.update(vo);
return Result.ok();
}
@DeleteMapping
@Operation(summary = "删除")
public Result<String> delete(@RequestBody List<Long> idList){
standardStopwatchService.delete(idList);
return Result.ok();
}
}

View File

@ -0,0 +1,25 @@
package net.srt.convert;
import net.srt.entity.StandardStopwatchEntity;
import net.srt.vo.StandardStopwatchVo;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* @ClassName : StandardStopwatchConvert
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:33
*/
@Mapper
public interface StandardStopwatchConvert {
StandardStopwatchConvert INSTANCE = Mappers.getMapper(StandardStopwatchConvert.class);
StandardStopwatchEntity convert(StandardStopwatchVo vo);
StandardStopwatchVo convert(StandardStopwatchEntity entity);
List<StandardStopwatchVo> convertList(List<StandardStopwatchEntity> list);
}

View File

@ -0,0 +1,17 @@
package net.srt.dao;
import net.srt.entity.StandardStopwatchEntity;
import net.srt.framework.mybatis.dao.BaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @ClassName : StandardStopwatchDao
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:33
*/
@Mapper
public interface StandardStopwatchDao extends BaseDao<StandardStopwatchEntity> {
void updateCodeNumByStandardId(@Param("standardId") Long standardId);
}

View File

@ -0,0 +1,37 @@
package net.srt.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.srt.framework.mybatis.entity.BaseEntity;
/**
* @ClassName : StandardStopwatchEntity
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:30
*/
@EqualsAndHashCode(callSuper = false)
@Data
@TableName("data_standard_stopwatch")
public class StandardStopwatchEntity extends BaseEntity {
/**
* id
*/
private Long standardId;
/**
* id
*/
private String dataId;
/**
* name
*/
private String dataName;
private Long projectId;
}

View File

@ -0,0 +1,21 @@
package net.srt.query;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.srt.framework.common.query.Query;
/**
* @ClassName : StandardStopwatchQuery
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:29
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(description = "数据治理-标准码表数据查询")
public class StandardStopwatchQuery extends Query {
private Integer standardId;
private String dataId;
private String dataName;
}

View File

@ -0,0 +1,25 @@
package net.srt.service;
import net.srt.entity.StandardStopwatchEntity;
import net.srt.framework.common.page.PageResult;
import net.srt.framework.mybatis.service.BaseService;
import net.srt.query.StandardStopwatchQuery;
import net.srt.vo.StandardStopwatchVo;
import java.util.List;
/**
* @ClassName : StandardStopwatchService
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:32
*/
public interface StandardStopwatchService extends BaseService<StandardStopwatchEntity> {
PageResult<StandardStopwatchVo> page(StandardStopwatchQuery query);
void save(StandardStopwatchVo vo);
void update(StandardStopwatchVo vo);
void delete(List<Long> idList);
}

View File

@ -0,0 +1,67 @@
package net.srt.service.impl;
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.convert.StandardStopwatchConvert;
import net.srt.dao.StandardStopwatchDao;
import net.srt.entity.StandardStopwatchEntity;
import net.srt.framework.common.page.PageResult;
import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
import net.srt.query.StandardStopwatchQuery;
import net.srt.service.StandardStopwatchService;
import net.srt.vo.StandardStopwatchVo;
import org.springframework.stereotype.Service;
import srt.cloud.framework.dbswitch.common.util.StringUtil;
import java.util.List;
/**
* @ClassName : StandardStopwatchServiceImpl
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:32
*/
@Service
@AllArgsConstructor
public class StandardStopwatchServiceImpl extends BaseServiceImpl<StandardStopwatchDao, StandardStopwatchEntity> implements StandardStopwatchService {
private final StandardStopwatchDao standardStopwatchDao;
@Override
public PageResult<StandardStopwatchVo> page(StandardStopwatchQuery query) {
IPage<StandardStopwatchEntity> page = baseMapper.selectPage(getPage(query), getWrapper(query));
return new PageResult<>(StandardStopwatchConvert.INSTANCE.convertList(page.getRecords()), page.getTotal());
}
private LambdaQueryWrapper<StandardStopwatchEntity> getWrapper(StandardStopwatchQuery query) {
LambdaQueryWrapper<StandardStopwatchEntity> wrapper = Wrappers.lambdaQuery();
wrapper.eq(query.getStandardId() != null, StandardStopwatchEntity::getStandardId, query.getStandardId())
.eq(StringUtil.isNotBlank(query.getDataId()), StandardStopwatchEntity::getDataId, query.getDataId())
.eq(StringUtil.isNotBlank(query.getDataName()), StandardStopwatchEntity::getDataName, query.getDataName());
return wrapper;
}
@Override
public void save(StandardStopwatchVo vo) {
StandardStopwatchEntity entity =StandardStopwatchConvert.INSTANCE.convert(vo);
entity.setProjectId(getProjectId());
baseMapper.insert(entity);
standardStopwatchDao.updateCodeNumByStandardId(vo.getStandardId());
}
@Override
public void update(StandardStopwatchVo vo) {
StandardStopwatchEntity entity = StandardStopwatchConvert.INSTANCE.convert(vo);
entity.setProjectId(getProjectId());
updateById(entity);
}
@Override
public void delete(List<Long> idList) {
Long id = idList.get(0);
StandardStopwatchEntity standardCodeEntity = baseMapper.selectById(id);
removeByIds(idList);
standardStopwatchDao.updateCodeNumByStandardId(standardCodeEntity.getStandardId());
}
}

View File

@ -0,0 +1,56 @@
package net.srt.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.srt.framework.common.utils.DateUtils;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName : StandardStopwatchVo
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 10:26
*/
@Data
@Schema(description = "数据治理-标准码表数据")
public class StandardStopwatchVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "主键id")
private Long id;
@Schema(description = "标准码表id")
private Long standardId;
@Schema(description = "码表数据的id")
private String dataId;
@Schema(description = "码表数据的name")
private String dataName;
private Long projectId;
@Schema(description = "版本号")
private Integer version;
@Schema(description = "删除标识 0正常 1已删除")
private Integer deleted;
@Schema(description = "创建者")
private Long creator;
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(description = "更新者")
private Long updater;
@Schema(description = "更新时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date updateTime;
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.srt.dao.StandardStopwatchDao">
<update id="updateCodeNumByStandardId">
UPDATE data_governance_standard SET code_num=(SELECT COUNT(1)
FROM data_governance_standard_code
WHERE standard_id=#{standardId} AND deleted=0)
WHERE id=#{standardId}
</update>
</mapper>

View File

@ -79,6 +79,12 @@
<groupId>io.minio</groupId> <groupId>io.minio</groupId>
<artifactId>minio</artifactId> <artifactId>minio</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.1</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -3,18 +3,16 @@ package net.srt.controller;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import net.srt.convert.DataServiceAppConvert; import net.srt.convert.DataServiceAppConvert;
import net.srt.entity.DataServiceApppEntity; import net.srt.entity.DataServiceAppEntity;
import net.srt.framework.common.page.PageResult; import net.srt.framework.common.page.PageResult;
import net.srt.framework.common.utils.Result; import net.srt.framework.common.utils.Result;
import net.srt.query.DataServiceAppQuery; import net.srt.query.DataServiceAppQuery;
import net.srt.service.DataServiceAppService; import net.srt.service.DataServiceAppService;
import net.srt.vo.DataServiceAppVo; import net.srt.vo.DataServiceAppVo;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
* @ClassName : DataServiceAppController * @ClassName : DataServiceAppController
@ -37,7 +35,50 @@ public class DataServiceAppController {
@GetMapping("{id}") @GetMapping("{id}")
@Operation(summary = "信息") @Operation(summary = "信息")
public Result<DataServiceAppVo> get(@PathVariable("id") Long id){ public Result<DataServiceAppVo> get(@PathVariable("id") Long id){
DataServiceApppEntity dataServiceApppEntity = dataServiceAppService.getById(id); DataServiceAppEntity dataServiceAppEntity = dataServiceAppService.getById(id);
return Result.ok(DataServiceAppConvert.INSTANCE.convert(dataServiceApppEntity)); return Result.ok(DataServiceAppConvert.INSTANCE.convert(dataServiceAppEntity));
}
@PostMapping
@Operation(summary = "保存")
public Result<String> save(@RequestBody DataServiceAppVo vo){
dataServiceAppService.save1(vo);
return Result.ok();
}
@PutMapping
@Operation(summary = "修改")
public Result<String> update(@RequestBody @Valid DataServiceAppVo vo){
dataServiceAppService.update1(vo);
return Result.ok();
}
@DeleteMapping
@Operation(summary = "删除")
public Result<String> delete(@RequestBody List<Long> idList){
dataServiceAppService.delete(idList);
return Result.ok();
}
@PostMapping("/auth")
@Operation(summary = "添加授权")
public Result<String> addAuth(@RequestBody DataServiceAppVo authVO){
dataServiceAppService.addAuth(authVO);
return Result.ok();
}
@PutMapping("/auth")
@Operation(summary = "修改授权")
public Result<String> upAuth(@RequestBody DataServiceAppVo authVO){
dataServiceAppService.upAuth(authVO);
return Result.ok();
}
@DeleteMapping("/cancel-auth/{authId}")
@Operation(summary = "取消授权")
public Result<String> cancelAuth(@PathVariable Long authId){
dataServiceAppService.cancelAuth(authId);
return Result.ok();
} }
} }

View File

@ -1,8 +1,8 @@
package net.srt.convert; package net.srt.convert;
import net.srt.entity.DataServiceApppEntity; import net.srt.entity.DataServiceAppEntity;
import net.srt.vo.DataServiceAppVo; import net.srt.vo.DataServiceAppVo;
import org.apache.ibatis.annotations.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
import java.util.List; import java.util.List;
@ -17,9 +17,9 @@ import java.util.List;
public interface DataServiceAppConvert { public interface DataServiceAppConvert {
DataServiceAppConvert INSTANCE = Mappers.getMapper(DataServiceAppConvert.class); DataServiceAppConvert INSTANCE = Mappers.getMapper(DataServiceAppConvert.class);
DataServiceApppEntity convert(DataServiceAppVo vo); DataServiceAppEntity convert(DataServiceAppVo vo);
DataServiceAppVo convert(DataServiceApppEntity entity); DataServiceAppVo convert(DataServiceAppEntity entity);
List<DataServiceAppVo> convertList(List<DataServiceApppEntity> list); List<DataServiceAppVo> convertList(List<DataServiceAppEntity> list);
} }

View File

@ -1,6 +1,6 @@
package net.srt.dao; package net.srt.dao;
import net.srt.entity.DataServiceApppEntity; import net.srt.entity.DataServiceAppEntity;
import net.srt.framework.mybatis.dao.BaseDao; import net.srt.framework.mybatis.dao.BaseDao;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -12,6 +12,6 @@ import org.apache.ibatis.annotations.Param;
* @Date: 2023-12-23 08:59 * @Date: 2023-12-23 08:59
*/ */
@Mapper @Mapper
public interface DataServiceAppDao extends BaseDao<DataServiceApppEntity> { public interface DataServiceAppDao extends BaseDao<DataServiceAppEntity> {
DataServiceApppEntity selectByApplyId(@Param("applyId") Long applyId); DataServiceAppEntity selectByApplyId(@Param("applyId") Long applyId);
} }

View File

@ -0,0 +1,70 @@
//package net.srt.entity;
//
//import com.baomidou.mybatisplus.annotation.FieldFill;
//import com.baomidou.mybatisplus.annotation.FieldStrategy;
//import com.baomidou.mybatisplus.annotation.TableField;
//import com.baomidou.mybatisplus.annotation.TableName;
//import lombok.Data;
//import lombok.EqualsAndHashCode;
//import net.srt.framework.mybatis.entity.BaseEntity;
//
//import java.util.Date;
//
///**
// * @ClassName : DataServiceApiAuthEnitiy
// * @Description :
// * @Author : FJJ
// * @Date: 2023-12-24 11:30
// */
//@EqualsAndHashCode(callSuper=false)
//@Data
//@TableName("data_service_api_auth1")
//public class DataServiceApiAuthEnitiy extends BaseEntity {
//
// /**
// * app的id
// */
// private Long appId;
//
// /**
// * 分组id
// */
// private Long groupId;
//
// /**
// * api的id
// */
// private Long apiId;
//
// /**
// * 调用次数 不限次数为-1
// */
// private Integer requestTimes;
//
// @TableField(updateStrategy = FieldStrategy.IGNORED)
// private Date startTime;
// @TableField(updateStrategy = FieldStrategy.IGNORED)
// private Date endTime;
//
// /**
// * 已调用次数
// */
// @TableField(updateStrategy = FieldStrategy.NEVER)
// private Integer requestedTimes;
// @TableField(updateStrategy = FieldStrategy.NEVER)
// private Integer requestedSuccessTimes;
// @TableField(updateStrategy = FieldStrategy.NEVER)
// private Integer requestedFailedTimes;
//
// /**
// * 所属项目id
// */
// private Long projectId;
//
// /**
// * 真删
// */
// @TableField(fill = FieldFill.INSERT)
// private Integer deleted;
//
//}

View File

@ -1,11 +1,16 @@
package net.srt.entity; package net.srt.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import net.srt.framework.mybatis.entity.BaseEntity; import net.srt.framework.mybatis.entity.BaseEntity;
import java.util.Date;
/** /**
* @ClassName : DataServiceApppEntity * @ClassName : DataServiceApppEntity
* @Description : * @Description :
@ -15,21 +20,30 @@ import net.srt.framework.mybatis.entity.BaseEntity;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Data @Data
@TableName("data_service_app") @TableName("data_service_app")
public class DataServiceApppEntity extends BaseEntity { public class DataServiceAppEntity extends BaseEntity {
/**
@Schema(description = "名称") *
*/
private String name; private String name;
@Schema(description = "备注") /**
*
*/
private String note; private String note;
@Schema(description = "app_key") /**
* app_key
*/
private String appKey; private String appKey;
@Schema(description = "app_secret") /**
* app_secret
*/
private String appSecret; private String appSecret;
@Schema(description = "过期描述") /**
*
*/
private String expireDesc; private String expireDesc;
/** /**
@ -39,6 +53,13 @@ public class DataServiceApppEntity extends BaseEntity {
private Integer ifMarket; private Integer ifMarket;
@Schema(description = "所属项目id") /**
* id
*/
private Long projectId; private Long projectId;
} }

View File

@ -1,17 +1,31 @@
package net.srt.service; package net.srt.service;
import net.srt.entity.DataServiceApppEntity; import net.srt.entity.DataServiceAppEntity;
import net.srt.framework.common.page.PageResult; import net.srt.framework.common.page.PageResult;
import net.srt.framework.mybatis.service.BaseService; import net.srt.framework.mybatis.service.BaseService;
import net.srt.query.DataServiceAppQuery; import net.srt.query.DataServiceAppQuery;
import net.srt.vo.DataServiceAppVo; import net.srt.vo.DataServiceAppVo;
import java.util.List;
/** /**
* @ClassName : DataServiceAppService * @ClassName : DataServiceAppService
* @Description : * @Description :
* @Author : FJJ * @Author : FJJ
* @Date: 2023-12-23 08:53 * @Date: 2023-12-23 08:53
*/ */
public interface DataServiceAppService extends BaseService<DataServiceApppEntity> { public interface DataServiceAppService extends BaseService<DataServiceAppEntity> {
PageResult<DataServiceAppVo> page(DataServiceAppQuery query); PageResult<DataServiceAppVo> page(DataServiceAppQuery query);
void save1(DataServiceAppVo vo);
void update1(DataServiceAppVo vo);
void delete(List<Long> idList);
void addAuth(DataServiceAppVo authVO);
void upAuth(DataServiceAppVo authVO);
void cancelAuth(Long authId);
} }

View File

@ -6,7 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import net.srt.convert.DataServiceAppConvert; import net.srt.convert.DataServiceAppConvert;
import net.srt.dao.DataServiceAppDao; import net.srt.dao.DataServiceAppDao;
import net.srt.entity.DataServiceApppEntity; import net.srt.entity.DataServiceAppEntity;
import net.srt.framework.common.exception.ServerException;
import net.srt.framework.common.page.PageResult; import net.srt.framework.common.page.PageResult;
import net.srt.framework.mybatis.service.impl.BaseServiceImpl; import net.srt.framework.mybatis.service.impl.BaseServiceImpl;
import net.srt.framework.security.user.SecurityUser; import net.srt.framework.security.user.SecurityUser;
@ -27,32 +28,57 @@ import java.util.List;
*/ */
@Service @Service
@AllArgsConstructor @AllArgsConstructor
public class DataServiceAppServiceImpl extends BaseServiceImpl<DataServiceAppDao, DataServiceApppEntity> implements DataServiceAppService { public class DataServiceAppServiceImpl extends BaseServiceImpl<DataServiceAppDao, DataServiceAppEntity> implements DataServiceAppService {
private final DataServiceAppDao dataServiceAppDao;
@Override @Override
public PageResult<DataServiceAppVo> page(DataServiceAppQuery query) { public PageResult<DataServiceAppVo> page(DataServiceAppQuery query) {
if (query.getApplyId()!=null){ IPage<DataServiceAppEntity> page=baseMapper.selectPage(getPage(query),null);
DataServiceApppEntity dataServiceApppEntity=baseMapper.selectByApplyId(query.getApplyId());
List<DataServiceApppEntity> list=new ArrayList<>(1);
if (dataServiceApppEntity!=null){
list.add(dataServiceApppEntity);
return new PageResult<>(DataServiceAppConvert.INSTANCE.convertList(list),1);
}
return new PageResult<>(new ArrayList<>(),0);
}
IPage<DataServiceApppEntity> page=baseMapper.selectPage(getPage(query),getWrapper(query));
return new PageResult<>(DataServiceAppConvert.INSTANCE.convertList(page.getRecords()),page.getTotal()); return new PageResult<>(DataServiceAppConvert.INSTANCE.convertList(page.getRecords()),page.getTotal());
} }
@Override
public void save1(DataServiceAppVo vo) {
DataServiceAppEntity app = DataServiceAppConvert.INSTANCE.convert(vo);
baseMapper.insert(app);
}
private LambdaQueryWrapper<DataServiceApppEntity> getWrapper(DataServiceAppQuery query) {
LambdaQueryWrapper<DataServiceApppEntity> wrapper = Wrappers.lambdaQuery();
wrapper.like(StringUtil.isNotBlank(query.getName()), DataServiceApppEntity::getName, query.getName()) @Override
.eq(DataServiceApppEntity::getIfMarket, query.getIfMarket() != null ? query.getIfMarket() : 0) public void update1(DataServiceAppVo vo) {
.eq(query.getIfMarket() != null, DataServiceApppEntity::getCreator, SecurityUser.getUserId()) DataServiceAppEntity app = DataServiceAppConvert.INSTANCE.convert(vo);
.eq(StringUtil.isNotBlank(query.getAppKey()), DataServiceApppEntity::getAppKey, query.getAppKey()) updateById(app);
.orderByDesc(DataServiceApppEntity::getCreateTime).orderByDesc(DataServiceApppEntity::getId);
dataScopeWithoutOrgId(wrapper);
return wrapper;
} }
@Override
public void delete(List<Long> idList) {
removeByIds(idList);
}
@Override
public void addAuth(DataServiceAppVo authVO) {
authVO.setProjectId(getProjectId());
dataServiceAppDao.insert(DataServiceAppConvert.INSTANCE.convert(authVO));
}
@Override
public void upAuth(DataServiceAppVo authVO) {
dataServiceAppDao.updateById(DataServiceAppConvert.INSTANCE.convert(authVO));
}
@Override
public void cancelAuth(Long authId) {
dataServiceAppDao.deleteById(authId);
}
// private LambdaQueryWrapper<DataServiceAppEntity> getWrapper(DataServiceAppQuery query) {
// LambdaQueryWrapper<DataServiceAppEntity> wrapper = Wrappers.lambdaQuery();
// wrapper.like(StringUtil.isNotBlank(query.getName()), DataServiceAppEntity::getName, query.getName())
// .eq(DataServiceAppEntity::getIfMarket, query.getIfMarket() != null ? query.getIfMarket() : 0)
// .eq(query.getIfMarket() != null, DataServiceAppEntity::getCreator, SecurityUser.getUserId())
// .eq(StringUtil.isNotBlank(query.getAppKey()), DataServiceAppEntity::getAppKey, query.getAppKey())
// .orderByDesc(DataServiceAppEntity::getCreateTime).orderByDesc(DataServiceAppEntity::getId);
// return wrapper;
// }
} }

View File

@ -0,0 +1,70 @@
package net.srt.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.srt.framework.common.utils.DateUtils;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName : DataServiceApiAuthVo
* @Description :
* @Author : FJJ
* @Date: 2023-12-24 11:29
*/
@Data
@Schema(description = "数据服务-权限关联表")
public class DataServiceApiAuthVo implements Serializable {
private static final long serialVersionUID = 1L;
@Schema(description = "主键id")
private Long id;
@Schema(description = "app的id")
private Long appId;
@Schema(description = "分组id")
private Long groupId;
@Schema(description = "api的id")
private Long apiId;
@Schema(description = "调用次数 不限次数为-1")
private Integer requestTimes;
@Schema(description = "已调用次数")
private Integer requestedTimes;
private Integer requestedSuccessTimes;
private Integer requestedFailedTimes;
@Schema(description = "所属项目id")
private Long projectId;
@Schema(description = "版本号")
private Integer version;
@Schema(description = "删除标识 0正常 1已删除")
private Integer deleted;
@Schema(description = "创建者")
private Long creator;
@Schema(description = "创建时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date createTime;
@Schema(description = "更新者")
private Long updater;
@Schema(description = "更新时间")
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date updateTime;
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date startTime;
@JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
private Date endTime;
}

View File

@ -5,7 +5,7 @@
<mapper namespace="net.srt.dao.DataServiceAppDao"> <mapper namespace="net.srt.dao.DataServiceAppDao">
<select id="selectByApplyId" resultType="net.srt.entity.DataServiceApppEntity"> <select id="selectByApplyId" resultType="net.srt.entity.DataServiceAppEntity">
SELECT dsa.* FROM data_service_app dsa INNER JOIN data_market_resource_apply dmra ON dsa.id=dmra.app_id WHERE dmra.id=#{applyId} SELECT dsa.* FROM data_service_app dsa INNER JOIN data_market_resource_apply dmra ON dsa.id=dmra.app_id WHERE dmra.id=#{applyId}
</select> </select>
</mapper> </mapper>

View File

@ -11,8 +11,8 @@ import java.util.List;
@Data @Data
public class DataProductionTreeVo { public class DataProductionTreeVo {
private Integer id; private Long id;
private Integer parentId; private Long parentId;
private Integer ifLeaf; private Integer ifLeaf;
private Long taskId; private Long taskId;
private String taskType; private String taskType;