diff --git a/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java b/src/main/java/com/easysoftware/application/domainpackage/DomainPackageServiceImpl.java index df064dc9e71c93a8726f35dab4d50c8a6939bfd9..9f0c1ba22ca457cdc271725329d6489b1dcda1dc 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 4e2a9c5af9a00fa61b2b9fdce60995af54ae9fae..6e9ed6fda11bbce8061b7b5438a4fc76bfe2c054 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 8da38ae08df1bd028aeee32bf1ef647d1c294825..713967f690265832981f5ee58c32746abf2bf4de 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 1d6072951162c8314a2a513d9bc0dc6f47b8a0de..7750d602b03ad1b1285d8f42ccf56000f86aeaec 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 0000000000000000000000000000000000000000..5555f7ef2625d37a27758d37ff2383729ed9094a --- /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 0000000000000000000000000000000000000000..f9c999051a4c783621cdc775dec68eee16087d2b --- /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 0000000000000000000000000000000000000000..ea29bc7cd8c0f36ba8a2781762968a81866730b0 --- /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 feecce0bf378cc79e940fce6758fa7f7bef34377..afe0ded936a448554f3aa1a26f75a802c0e883f7 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 4ced706f1e942022679598abee816bad95cb21f1..16fdfc29da1f5c600c07e1a9f0d09e13b1573d32 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 842edbc4814b49d3fe88043a5e9883ea3225647d..fc1fcfa75bdd4dd81271e8c3d1f1cb1c27e4b078 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 cc8564d816a05532f80ea4e7a8131643c8713750..11344549f6cdab59f6fd364be2a86c6905840452 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 1c2f15d7e2679639e2437a9dfd8fe41befdcb872..ce8fbc023ce4dd02eb0f331e0acdbd4584e19834 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 4bf32c49894a848c18112068e167d4b116acec83..8a622a87bdb40d8dce737c2186e31704061ff9e7 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; }