From f21907d70f8995e738f01c1db3b2a2d00c48500b Mon Sep 17 00:00:00 2001 From: gouzhonglin Date: Wed, 28 Feb 2024 18:50:06 +0800 Subject: [PATCH] update rpm package --- .../DomainPackageServiceImpl.java | 16 +- .../rpmpackage/RPMPackageService.java | 2 + .../rpmpackage/RPMPackageServiceImpl.java | 14 +- .../rpmpackage/dto/InputRPMPackage.java | 152 ++++++++---------- .../rpmpackage/vo/RPMPackageDetailVo.java | 66 ++++++++ .../rpmpackage/vo/RPMPackageMenuVo.java | 20 +++ .../common/config/MybatisPlusConfig.java | 27 ++++ .../domain/rpmpackage/RPMPackage.java | 68 ++++---- .../domain/rpmpackage/RPMPackageUnique.java | 8 +- .../rpmpackage/gateway/RPMPackageGateway.java | 5 +- .../gatewayimpl/RPMPackageGatewayImpl.java | 40 +++-- .../converter/RPMPackageConverter.java | 27 ++++ .../gatewayimpl/dataobject/RPMPackageDO.java | 69 ++++---- 13 files changed, 325 insertions(+), 189 deletions(-) create mode 100644 src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageDetailVo.java create mode 100644 src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageMenuVo.java create mode 100644 src/main/java/com/easysoftware/common/config/MybatisPlusConfig.java diff --git a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java b/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java index df064dc..9f0c1ba 100644 --- a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java +++ b/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java @@ -13,16 +13,14 @@ import org.springframework.stereotype.Service; import com.easysoftware.application.applicationpackage.ApplicationPackageService; import com.easysoftware.application.applicationpackage.dto.ApplicationPackageSearchCondition; -import com.easysoftware.application.applicationpackage.dto.InputApplicationPackage; -import com.easysoftware.application.applicationpackage.vo.ApplicationPackageDetailVo; import com.easysoftware.application.applicationpackage.vo.ApplicationPackageMenuVo; import com.easysoftware.application.domainpackage.dto.DomainSearchCondition; import com.easysoftware.application.domainpackage.vo.DomainPackageMenuVo; -import com.easysoftware.common.entity.MessageCode; +import com.easysoftware.application.rpmpackage.RPMPackageService; +import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; import com.easysoftware.common.exception.enumvalid.AppCategoryEnum; import com.easysoftware.common.utils.ResultUtil; -import com.easysoftware.domain.applicationpackage.ApplicationPackage; -import com.easysoftware.domain.applicationpackage.gateway.ApplicationPackageGateway; import jakarta.annotation.Resource; @Service @@ -30,6 +28,9 @@ public class DomainPackageServiceImpl implements DomainPackageService { @Resource ApplicationPackageService appPkgService; + @Resource + RPMPackageService rPMPkgService; + @Override public ResponseEntity searchDomain(DomainSearchCondition condition) { if ("apppkg".equals(condition.getName())) { @@ -48,6 +49,11 @@ public class DomainPackageServiceImpl implements DomainPackageService { List> res = groupByCategory(domainMenuList); return ResultUtil.success(HttpStatus.OK, res); + } else if ("rpmpkg".equals(condition.getName())) { + RPMPackageSearchCondition rPMCon = new RPMPackageSearchCondition(); + BeanUtils.copyProperties(condition, rPMCon); + List appMenuList = rPMPkgService.queryAllRPMPkgMenu(rPMCon); + return ResultUtil.success(HttpStatus.OK, appMenuList); } return null; } diff --git a/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageService.java b/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageService.java index 4e2a9c5..6e9ed6f 100644 --- a/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageService.java +++ b/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageService.java @@ -6,10 +6,12 @@ import org.springframework.http.ResponseEntity; import com.easysoftware.application.rpmpackage.dto.InputRPMPackage; import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; public interface RPMPackageService { ResponseEntity insertRPMPkg(InputRPMPackage inputrPMPackage); ResponseEntity updateRPMPkg(InputRPMPackage inputrPMPackage); ResponseEntity deleteRPMPkg(List names); ResponseEntity searchRPMPkg(RPMPackageSearchCondition condition); + List queryAllRPMPkgMenu(RPMPackageSearchCondition condition); } diff --git a/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageServiceImpl.java b/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageServiceImpl.java index 8da38ae..713967f 100644 --- a/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageServiceImpl.java +++ b/src/main/java/com/easysoftware/application/rpmpackage/RPMPackageServiceImpl.java @@ -8,14 +8,14 @@ import org.springframework.beans.BeanUtils; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import org.springframework.web.bind.MethodArgumentNotValidException; +import com.easysoftware.application.applicationpackage.vo.ApplicationPackageMenuVo; import com.easysoftware.application.rpmpackage.dto.InputRPMPackage; import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition; +import com.easysoftware.application.rpmpackage.vo.RPMPackageDetailVo; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; import com.easysoftware.common.entity.MessageCode; import com.easysoftware.common.utils.ResultUtil; -import com.easysoftware.domain.applicationpackage.ApplicationPackage; -import com.easysoftware.domain.applicationpackage.gateway.ApplicationPackageGateway; import com.easysoftware.domain.rpmpackage.RPMPackage; import com.easysoftware.domain.rpmpackage.RPMPackageUnique; import com.easysoftware.domain.rpmpackage.gateway.RPMPackageGateway; @@ -27,6 +27,12 @@ public class RPMPackageServiceImpl implements RPMPackageService { @Resource RPMPackageGateway rPMPkgGateway; + @Override + public List queryAllRPMPkgMenu(RPMPackageSearchCondition condition) { + List rPMMenu = rPMPkgGateway.queryMenuByName(condition); + return rPMMenu; + } + @Override public ResponseEntity deleteRPMPkg(List ids) { List existedNames = new ArrayList<>(); @@ -74,7 +80,7 @@ public class RPMPackageServiceImpl implements RPMPackageService { @Override public ResponseEntity searchRPMPkg(RPMPackageSearchCondition condition) { - List res = rPMPkgGateway.queryByName(condition); + List res = rPMPkgGateway.queryDetailByName(condition); return ResultUtil.success(HttpStatus.OK, res); } diff --git a/src/main/java/com/easysoftware/application/rpmpackage/dto/InputRPMPackage.java b/src/main/java/com/easysoftware/application/rpmpackage/dto/InputRPMPackage.java index 1d60729..7750d60 100644 --- a/src/main/java/com/easysoftware/application/rpmpackage/dto/InputRPMPackage.java +++ b/src/main/java/com/easysoftware/application/rpmpackage/dto/InputRPMPackage.java @@ -12,89 +12,57 @@ import lombok.NoArgsConstructor; @NoArgsConstructor @AllArgsConstructor public class InputRPMPackage { - @Size(max = 255, message = "the length of headerEnd can not exceed 255") - private String headerEnd; + @Size(max = 255, message = "the length of name can not exceed 255") + @NotBlank + private String name; - @Size(max = 255, message = "the length of sizeInstalled can not exceed 255") - private String sizeInstalled; - - @Size(max = 255, message = "the length of timeFile can not exceed 255") - private String timeFile; - - @Size(max = 255, message = "the length of sizePackage can not exceed 255") - private String sizePackage; + @Size(max = 255, message = "the length of id can not exceed 255") + private String id; - @Size(max = 6000, message = "the length of description can not exceed 6000") - private String description; - - @Size(max = 255, message = "the length of checksumPkgid can not exceed 255") - private String checksumPkgid; - - @Size(max = 255, message = "the length of locationHref can not exceed 255") - private String locationHref; - - @Size(max = 255, message = "the length of rpmBuildhost can not exceed 255") - private String rpmBuildhost; - - @Size(max = 255, message = "the length of checksumType can not exceed 255") - private String checksumType; - - @Size(max = 255, message = "the length of sizeArchive can not exceed 255") - private String sizeArchive; - - @Size(max = 255, message = "the length of rpmVendor can not exceed 255") - private String rpmVendor; - - @Size(max = 255, message = "the length of checksum can not exceed 255") - private String checksum; - - @Size(max = 255, message = "the length of rpmGroup can not exceed 255") - private String rpmGroup; + @Size(max = 255, message = "the length of version can not exceed 255") + private String version; + + @Size(max = 255, message = "the length of os can not exceed 255") + private String os; + + @Size(max = 255, message = "the length of arch can not exceed 255") + private String arch; + + @Size(max = 255, message = "the length of rpmCategory can not exceed 255") + private String rpmCategory; + + @Size(max = 255, message = "the length of rpmUpdateAt can not exceed 255") + private String rpmUpdateAt; + + @Size(max = 255, message = "the length of srcRepo can not exceed 255") + private String srcRepo; + + @Size(max = 255, message = "the length of rpmSize can not exceed 255") + private String rpmSize; + + @Size(max = 255, message = "the length of binDownloadUrl can not exceed 255") + private String binDownloadUrl; + + @Size(max = 255, message = "the length of srcDownloadUrl can not exceed 255") + private String srcDownloadUrl; - @Size(max = 255, message = "the length of headerStart can not exceed 255") - private String headerStart; - @Size(max = 255, message = "the length of summary can not exceed 255") private String summary; - - @Size(max = 255, message = "the length of versionRel can not exceed 255") - private String versionRel; - - @Size(max = 255, message = "the length of versionVer can not exceed 255") - private String versionVer; - - @Size(max = 255, message = "the length of packager can not exceed 255") - private String packager; - - @Size(max = 255, message = "the length of url can not exceed 255") - private String url; - - @Size(max = 255, message = "the length of versionEpoch can not exceed 255") - private String versionEpoch; - - @Size(max = 255, message = "the length of rpmSourcerpm can not exceed 255") - private String rpmSourcerpm; - @Size(max = 1000, message = "the length of rpmLicense can not exceed 255") - private String rpmLicense; + @Size(max = 255, message = "the length of osSupport can not exceed 255") + private String osSupport; - @Size(max = 255, message = "the length of name can not exceed 255") - private String name; - - @Size(max = 255, message = "the length of timeBuild can not exceed 255") - private String timeBuild; - - @Size(max = 255, message = "the length of arch can not exceed 255") - private String arch; + @Size(max = 255, message = "the length of repo can not exceed 255") + private String repo; - @Size(max = 255, message = "the length of osName can not exceed 255") - private String osName; - - @Size(max = 255, message = "the length of osVer can not exceed 255") - private String osVer; - - @Size(max = 255, message = "the length of osType can not exceed 255") - private String osType; + @Size(max = 255, message = "the length of repoType can not exceed 255") + private String repoType; + + @Size(max = 10000, message = "the length of installation can not exceed 10000") + private String installation; + + @Size(max = 10000, message = "the length of description can not exceed 10000") + private String description; @Size(max = 100_0000, message = "the length of requires can not exceed 100_0000") private String requires; @@ -102,15 +70,33 @@ public class InputRPMPackage { @Size(max = 100_0000, message = "the length of provides can not exceed 100_0000") private String provides; - @Size(max = 100_0000, message = "the length of files can not exceed 100_0000") - private String files; + @Size(max = 100_0000, message = "the length of conflicts can not exceed 100_0000") + private String conflicts; - @Size(max = 255, message = "the length of baseUrl can not exceed 255") - private String baseUrl; + @Size(max = 100_0000, message = "the length of changeLog can not exceed 100_0000") + private String changeLog; - @Size(max = 255, message = "the length of rpmCategory can not exceed 255") - private String rpmCategory; + @Size(max = 255, message = "the length of maintanierId can not exceed 255") + private String maintanierId; - @Size(max = 255, message = "the length of id can not exceed 255") - private String id; + @Size(max = 255, message = "the length of maintianerEmail can not exceed 255") + private String maintianerEmail; + + @Size(max = 255, message = "the length of maintainerGiteeId can not exceed 255") + private String maintainerGiteeId; + + @Size(max = 255, message = "the length of maintainerUpdateAt can not exceed 255") + private String maintainerUpdateAt; + + @Size(max = 255, message = "the length of maintainerStatus can not exceed 255") + private String maintainerStatus; + + @Size(max = 255, message = "the length of upStream can not exceed 255") + private String upStream; + + @Size(max = 255, message = "the length of security can not exceed 255") + private String security; + + @Size(max = 1000, message = "the length of similarPkgs can not exceed 1000") + private String similarPkgs; } diff --git a/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageDetailVo.java b/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageDetailVo.java new file mode 100644 index 0000000..5555f7e --- /dev/null +++ b/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageDetailVo.java @@ -0,0 +1,66 @@ +package com.easysoftware.application.rpmpackage.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RPMPackageDetailVo { + private String name; + + private String version; + + private String os; + + private String arch; + + private String rpmCategory; + + private String rpmUpdateAt; + + private String srcRepo; + + private String rpmSize; + + private String binDownloadUrl; + + private String srcDownloadUrl; + + private String summary; + + private String osSupport; + + private String repo; + + private String repoType; + + private String installation; + + private String description; + + private String requires; + + private String provides; + + private String conflicts; + + private String changeLog; + + private String maintanierId; + + private String maintianerEmail; + + private String maintainerGiteeId; + + private String maintainerUpdateAt; + + private String maintainerStatus; + + private String upStream; + + private String security; + + private String similarPkgs; +} diff --git a/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageMenuVo.java b/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageMenuVo.java new file mode 100644 index 0000000..f9c9990 --- /dev/null +++ b/src/main/java/com/easysoftware/application/rpmpackage/vo/RPMPackageMenuVo.java @@ -0,0 +1,20 @@ +package com.easysoftware.application.rpmpackage.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class RPMPackageMenuVo { + private String name; + private String version; + private String os; + private String arch; + private String rpmCategory; + private String rpmUpdateAt; + private String srcRepo; + private String rpmSize; + private String binDownloadUrl; +} diff --git a/src/main/java/com/easysoftware/common/config/MybatisPlusConfig.java b/src/main/java/com/easysoftware/common/config/MybatisPlusConfig.java new file mode 100644 index 0000000..ea29bc7 --- /dev/null +++ b/src/main/java/com/easysoftware/common/config/MybatisPlusConfig.java @@ -0,0 +1,27 @@ +package com.easysoftware.common.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; +import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; + +@Configuration +@EnableTransactionManagement +public class MybatisPlusConfig { + @Bean + public MybatisPlusInterceptor mybatisPlusInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor(); + paginationInnerInterceptor.setOptimizeJoin(true); + paginationInnerInterceptor.setDbType(DbType.MYSQL); + paginationInnerInterceptor.setOverflow(true); + interceptor.addInnerInterceptor(paginationInnerInterceptor); + OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor = new OptimisticLockerInnerInterceptor(); + interceptor.addInnerInterceptor(optimisticLockerInnerInterceptor); + return interceptor; + } +} diff --git a/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackage.java b/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackage.java index feecce0..afe0ded 100644 --- a/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackage.java +++ b/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackage.java @@ -11,70 +11,60 @@ import lombok.NoArgsConstructor; public class RPMPackage { @Serial private static final long serialVersionUID = 1L; - - private String headerEnd; - - private String sizeInstalled; - - private String timeFile; - - private String sizePackage; - - private String description; + + private String name; - private String checksumPkgid; + private String version; - private String locationHref; + private String os; - private String rpmBuildhost; + private String arch; - private String checksumType; + private String rpmCategory; - private String sizeArchive; + private String rpmUpdateAt; - private String rpmVendor; + private String srcRepo; - private String checksum; + private String rpmSize; - private String rpmGroup; + private String binDownloadUrl; - private String headerStart; + private String srcDownloadUrl; private String summary; - private String versionRel; - - private String versionVer; + private String osSupport; - private String packager; + private String repo; - private String url; + private String repoType; - private String versionEpoch; + private String installation; - private String rpmSourcerpm; + private String description; - private String rpmLicense; + private String requires; + + private String provides; - private String name; + private String conflicts; - private String timeBuild; + private String changeLog; - private String arch; + private String maintanierId; - private String osName; + private String maintianerEmail; - private String osVer; - - private String osType; + private String maintainerGiteeId; - private String files; + private String maintainerUpdateAt; - private String provides; + private String maintainerStatus; - private String requires; + private String upStream; - private String baseUrl; + private String security; - private String rpmCategory; + private String similarPkgs; } diff --git a/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackageUnique.java b/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackageUnique.java index 4ced706..16fdfc2 100644 --- a/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackageUnique.java +++ b/src/main/java/com/easysoftware/domain/rpmpackage/RPMPackageUnique.java @@ -9,12 +9,10 @@ import lombok.NoArgsConstructor; @AllArgsConstructor public class RPMPackageUnique { private String name; - private String versionVer; - private String versionRel; - private String osName; - private String osVer; + private String version; + private String os; private String arch; private String rpmCategory; - private String timeFile; + private String rpmUpdateAt; } diff --git a/src/main/java/com/easysoftware/domain/rpmpackage/gateway/RPMPackageGateway.java b/src/main/java/com/easysoftware/domain/rpmpackage/gateway/RPMPackageGateway.java index 842edbc..fc1fcfa 100644 --- a/src/main/java/com/easysoftware/domain/rpmpackage/gateway/RPMPackageGateway.java +++ b/src/main/java/com/easysoftware/domain/rpmpackage/gateway/RPMPackageGateway.java @@ -3,6 +3,8 @@ package com.easysoftware.domain.rpmpackage.gateway; import java.util.List; import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition; +import com.easysoftware.application.rpmpackage.vo.RPMPackageDetailVo; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; import com.easysoftware.domain.rpmpackage.RPMPackage; import com.easysoftware.domain.rpmpackage.RPMPackageUnique; @@ -12,5 +14,6 @@ public interface RPMPackageGateway { boolean save(RPMPackage appPkg); boolean update(RPMPackage appPkg); boolean delete(String id); - List queryByName(RPMPackageSearchCondition condition); + List queryDetailByName(RPMPackageSearchCondition condition); + List queryMenuByName(RPMPackageSearchCondition condition); } diff --git a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/RPMPackageGatewayImpl.java b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/RPMPackageGatewayImpl.java index cc8564d..1134454 100644 --- a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/RPMPackageGatewayImpl.java +++ b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/RPMPackageGatewayImpl.java @@ -14,6 +14,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.easysoftware.application.rpmpackage.dto.RPMPackageSearchCondition; +import com.easysoftware.application.rpmpackage.vo.RPMPackageDetailVo; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; import com.easysoftware.domain.applicationpackage.ApplicationPackage; import com.easysoftware.domain.rpmpackage.RPMPackage; import com.easysoftware.domain.rpmpackage.RPMPackageUnique; @@ -61,22 +63,16 @@ public class RPMPackageGatewayImpl implements RPMPackageGateway { } @Override - public List queryByName(RPMPackageSearchCondition condition) { - int pageNum = condition.getPageNum(); - int pageSize = condition.getPageSize(); - String name = condition.getName(); - - Page page = new Page<>(pageNum, pageSize); + public List queryDetailByName(RPMPackageSearchCondition condition) { + Page page = createPage(condition); QueryWrapper wrapper = new QueryWrapper<>(); - if ("all".equals(name)) { - } else { - wrapper.eq("name", name); - } - + String name = condition.getName(); + wrapper.eq("name", name); + Page resPage = rPMPkgMapper.selectPage(page, wrapper); List rPMDOs = resPage.getRecords(); - List res = RPMPackageConverter.toEntity(rPMDOs); + List res = RPMPackageConverter.toDetail(rPMDOs); return res; } @@ -105,5 +101,25 @@ public class RPMPackageGatewayImpl implements RPMPackageGateway { wrapper.eq("id", id); return rPMPkgMapper.exists(wrapper); } + + @Override + public List queryMenuByName(RPMPackageSearchCondition condition) { + Page page = createPage(condition); + + QueryWrapper wrapper = new QueryWrapper<>(); + + Page resPage = rPMPkgMapper.selectPage(page, wrapper); + List rpmDOs = resPage.getRecords(); + List res = RPMPackageConverter.toMenu(rpmDOs); + + return res; + } + + private Page createPage(RPMPackageSearchCondition condition) { + int pageNum = condition.getPageNum(); + int pageSize = condition.getPageSize(); + Page page = new Page<>(pageNum, pageSize); + return page; + } } diff --git a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/converter/RPMPackageConverter.java b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/converter/RPMPackageConverter.java index 1c2f15d..ce8fbc0 100644 --- a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/converter/RPMPackageConverter.java +++ b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/converter/RPMPackageConverter.java @@ -1,11 +1,15 @@ package com.easysoftware.infrastructure.rpmpackage.gatewayimpl.converter; import java.sql.Timestamp; +import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Date; import java.util.List; import org.springframework.beans.BeanUtils; +import com.easysoftware.application.rpmpackage.vo.RPMPackageDetailVo; +import com.easysoftware.application.rpmpackage.vo.RPMPackageMenuVo; import com.easysoftware.common.utils.UuidUtil; import com.easysoftware.domain.applicationpackage.ApplicationPackage; import com.easysoftware.domain.rpmpackage.RPMPackage; @@ -28,6 +32,29 @@ public class RPMPackageConverter { return res; } + public static List toDetail(List rPMPkgDOs) { + List res = new ArrayList<>(); + for (RPMPackageDO rpm: rPMPkgDOs) { + RPMPackageDetailVo detail = new RPMPackageDetailVo(); + BeanUtils.copyProperties(rpm, detail); + + System.out.println(); + res.add(detail); + } + return res; + } + + public static List toMenu(List rPMPkgDOs) { + List res = new ArrayList<>(); + for (RPMPackageDO rpm: rPMPkgDOs) { + RPMPackageMenuVo menu = new RPMPackageMenuVo(); + BeanUtils.copyProperties(rpm, menu); + res.add(menu); + } + + return res; + } + public static RPMPackageDO toDataObject(RPMPackage rPMPkg) { RPMPackageDO rPMPkgDO = new RPMPackageDO(); BeanUtils.copyProperties(rPMPkg, rPMPkgDO); diff --git a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/dataobject/RPMPackageDO.java b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/dataobject/RPMPackageDO.java index 4bf32c4..8a622a8 100644 --- a/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/dataobject/RPMPackageDO.java +++ b/src/main/java/com/easysoftware/infrastructure/rpmpackage/gatewayimpl/dataobject/RPMPackageDO.java @@ -7,6 +7,7 @@ import javax.persistence.Id; import com.baomidou.mybatisplus.annotation.TableName; import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey; +import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant; import lombok.AllArgsConstructor; import lombok.Data; @@ -18,77 +19,65 @@ import lombok.NoArgsConstructor; @TableName("rpm_pkg_base") public class RPMPackageDO { @Serial - private static final long serialVersionUID = 1L; - private String id; private Timestamp createAt; private Timestamp updateAt; - private String headerEnd; - - private String sizeInstalled; - - private String timeFile; - - private String sizePackage; - - private String description; + private String name; - private String checksumPkgid; + private String version; - private String locationHref; + private String os; - private String rpmBuildhost; + private String arch; - private String checksumType; + private String rpmCategory; - private String sizeArchive; + private String rpmUpdateAt; - private String rpmVendor; + private String srcRepo; - private String checksum; + private String rpmSize; - private String rpmGroup; + private String binDownloadUrl; - private String headerStart; + private String srcDownloadUrl; private String summary; - private String versionRel; - - private String versionVer; + private String osSupport; - private String packager; + private String repo; - private String url; + private String repoType; - private String versionEpoch; + private String installation; - private String rpmSourcerpm; + private String description; - private String rpmLicense; + private String requires; + + private String provides; - private String name; + private String conflicts; - private String timeBuild; + private String changeLog; - private String arch; + private String maintanierId; - private String osName; + private String maintianerEmail; - private String osVer; + private String maintainerGiteeId; - private String osType; + private String maintainerUpdateAt; - private String files; + private String maintainerStatus; - private String provides; - - private String requires; + private String upStream; - private String baseUrl; + private String security; - private String rpmCategory; + private String similarPkgs; } -- Gitee