From 053700fc6b06d27ed232a5983efcb3a22b9412e1 Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 14 Sep 2024 11:44:43 +0800 Subject: [PATCH] cleanup some files --- .../cb/model/ConvertibleBondInfo.java | 115 ------------------ .../java/io/fluentqa/cb/package-info.java | 1 - .../fluentqa/github/FluentGithubModule.java | 60 --------- .../github/model/AwesomeResource.java | 29 ----- .../github/model/GithubStarredRepo.java | 45 ------- .../java/io/fluentqa/github/package-info.java | 1 - .../github/service/GithubService.java | 17 --- .../jobs/GithubStarredCollectorJob.java | 56 --------- .../jobs/github/GithubJobFetchParameters.java | 11 -- package.sh | 1 - pom.xml | 2 +- 11 files changed, 1 insertion(+), 337 deletions(-) delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/cb/model/ConvertibleBondInfo.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/cb/package-info.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/github/FluentGithubModule.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/AwesomeResource.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/GithubStarredRepo.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/github/package-info.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/github/service/GithubService.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/GithubStarredCollectorJob.java delete mode 100644 fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/github/GithubJobFetchParameters.java diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/model/ConvertibleBondInfo.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/model/ConvertibleBondInfo.java deleted file mode 100644 index 78561c2..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/model/ConvertibleBondInfo.java +++ /dev/null @@ -1,115 +0,0 @@ -package io.fluentqa.cb.model; - -import lombok.Data; -import xyz.erupt.annotation.Erupt; -import xyz.erupt.annotation.sub_erupt.Power; -import xyz.erupt.jpa.model.MetaModelVo; - -import javax.persistence.*; -import java.math.BigDecimal; - -@Entity -@Table(name = "convertible_bond_info") -@Data -@Erupt(name = "CB数据", power = @Power(importable = true, export = true)) - -public class ConvertibleBondInfo extends MetaModelVo { - - @Column(name = "code", nullable = false) - private String code; - - @Column(name = "name") - private String name; - - @Column(name = "trade_date") - private String tradeDate; - - @Column(name = "pre_close_price") - private BigDecimal preClosePrice; - - @Column(name = "open_price") - private BigDecimal openPrice; - - @Column(name = "high_price") - private BigDecimal highPrice; - - @Column(name = "low_price") - private BigDecimal lowPrice; - - @Column(name = "close_price") - private BigDecimal closePrice; - - @Column(name = "change") - private BigDecimal change; - - @Column(name = "change_rate") - private BigDecimal changeRate; - - @Column(name = "accrued_days") - private Integer accruedDays; - - @Column(name = "accrued_interest") - private BigDecimal accruedInterest; - - @Column(name = "remaining_term") - private BigDecimal remainingTerm; - - @Column(name = "current_yield") - private BigDecimal currentYield; - - @Column(name = "pure_bond_yield") - private BigDecimal pureBondYield; - - @Column(name = "pure_bond_value") - private BigDecimal pureBondValue; - - @Column(name = "pure_bond_premium") - private BigDecimal pureBondPremium; - - @Column(name = "pure_bond_premium_rate") - private BigDecimal pureBondPremiumRate; - - @Column(name = "conversion_price") - private BigDecimal conversionPrice; - - @Column(name = "conversion_ratio") - private BigDecimal conversionRatio; - - @Column(name = "conversion_value") - private BigDecimal conversionValue; - - @Column(name = "conversion_premium") - private BigDecimal conversionPremium; - - @Column(name = "conversion_premium_rate") - private BigDecimal conversionPremiumRate; - - @Column(name = "conversion_pe_ratio") - private BigDecimal conversionPeRatio; - - @Column(name = "conversion_pb_ratio") - private BigDecimal conversionPbRatio; - - @Column(name = "arbitrage_space") - private BigDecimal arbitrageSpace; - - @Column(name = "parity_bottom_price") - private BigDecimal parityBottomPrice; - - @Column(name = "term") - private BigDecimal term; - - @Column(name = "issue_date") - private String issueDate; - - @Column(name = "coupon_rate_issue_reference_rate") - private BigDecimal couponRateIssueReferenceRate; - - @Column(name = "trading_market") - private String tradingMarket; - - @Column(name = "bond_type") - private String bondType; - - // Constructors, getters, setters -} diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/package-info.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/package-info.java deleted file mode 100644 index 03c2c91..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/cb/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package io.fluentqa.cb; \ No newline at end of file diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/FluentGithubModule.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/github/FluentGithubModule.java deleted file mode 100644 index ed5d62f..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/FluentGithubModule.java +++ /dev/null @@ -1,60 +0,0 @@ -package io.fluentqa.github; - -import io.fluentqa.github.model.AwesomeResource; -import io.fluentqa.github.model.GithubStarredRepo; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; -import xyz.erupt.core.annotation.EruptScan; -import xyz.erupt.core.constant.MenuTypeEnum; -import xyz.erupt.core.module.EruptModule; -import xyz.erupt.core.module.EruptModuleInvoke; -import xyz.erupt.core.module.MetaMenu; -import xyz.erupt.core.module.ModuleInfo; - -import java.util.ArrayList; -import java.util.List; - -@Configuration -@ComponentScan -@EntityScan -@EruptScan -@EnableConfigurationProperties -public class FluentGithubModule implements EruptModule { - - public FluentGithubModule() { - } - - @Override - public ModuleInfo info() { - return ModuleInfo.builder().name("fluent-github").build(); - } - - @Override - public void run() { - EruptModule.super.run(); - } - - @Override - public List initMenus() { - List menus = new ArrayList<>(); - menus.add(MetaMenu.createRootMenu("$github", "github管理", "fa fa-github", 1000)); - MetaMenu starredMenu = MetaMenu.createEruptClassMenu(GithubStarredRepo.class, menus.get(0), 0, MenuTypeEnum.TABLE); - starredMenu.setIcon("fa fa-star"); - starredMenu.setName("github收藏"); - starredMenu.setCode("$github-starred"); - menus.add(starredMenu); - - MetaMenu awesomeModule = MetaMenu.createEruptClassMenu(AwesomeResource.class, menus.get(0), 1, MenuTypeEnum.TABLE); - awesomeModule.setIcon("fa fa-font-awesome"); - awesomeModule.setName("awesomes"); - awesomeModule.setCode("$awesomes"); - menus.add(awesomeModule); - return menus; - } - - static { - EruptModuleInvoke.addEruptModule(FluentGithubModule.class); - } -} diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/AwesomeResource.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/AwesomeResource.java deleted file mode 100644 index c9205b0..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/AwesomeResource.java +++ /dev/null @@ -1,29 +0,0 @@ -package io.fluentqa.github.model; - -import lombok.Data; -import xyz.erupt.annotation.Erupt; -import xyz.erupt.annotation.EruptField; -import xyz.erupt.annotation.sub_erupt.Power; -import xyz.erupt.annotation.sub_field.Edit; -import xyz.erupt.annotation.sub_field.EditType; -import xyz.erupt.annotation.sub_field.View; -import xyz.erupt.annotation.sub_field.sub_edit.InputType; -import xyz.erupt.annotation.sub_field.sub_edit.Search; -import xyz.erupt.jpa.model.MetaModel; - -import javax.persistence.Entity; - -@Data -@Entity -@Erupt(name = "Awesome Resource", power = @Power(importable = true, export = true)) -public class AwesomeResource extends MetaModel { - @EruptField(views = @View(title = "名称"), edit = @Edit(title = "名称", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String name; - @EruptField(views = @View(title = "URL"), edit = @Edit(title = "URL", type = EditType.TEXTAREA, - search = @Search, notNull = true, inputType = @InputType)) - private String url; - - @EruptField(views = @View(title = "content"), edit = @Edit(title = "content", type = EditType.HTML_EDITOR, - search = @Search, notNull = true, inputType = @InputType)) - private String content; -} diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/GithubStarredRepo.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/GithubStarredRepo.java deleted file mode 100644 index df1a82f..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/GithubStarredRepo.java +++ /dev/null @@ -1,45 +0,0 @@ -package io.fluentqa.github.model; - -import lombok.Data; -import xyz.erupt.annotation.Erupt; -import xyz.erupt.annotation.EruptField; -import xyz.erupt.annotation.sub_erupt.Layout; -import xyz.erupt.annotation.sub_erupt.Power; -import xyz.erupt.annotation.sub_field.Edit; -import xyz.erupt.annotation.sub_field.EditType; -import xyz.erupt.annotation.sub_field.View; -import xyz.erupt.annotation.sub_field.sub_edit.InputType; -import xyz.erupt.annotation.sub_field.sub_edit.Search; -import xyz.erupt.jpa.model.MetaModelVo; - -import javax.persistence.Entity; - -@Data -@Entity -@Erupt(name = "starred Github Repos", - power = @Power(importable = true, export = true), layout = @Layout( - tableLeftFixed = 3, - pageSize = 30)) -public class GithubStarredRepo extends MetaModelVo { - @EruptField(views = @View(title = "名称"), edit = @Edit(title = "名称", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String name; - @EruptField(views = @View(title = "URL"), edit = @Edit(title = "URL", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String url; - @EruptField(views = @View(title = "全名"), edit = @Edit(title = "全名", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String fullName; - - private String nodeId; - @EruptField(views = @View(title = "描述"), edit = @Edit(title = "描述", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String description; - @EruptField(views = @View(title = "fork数量"), edit = @Edit(title = "fork数量", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private int forksCount; - @EruptField(views = @View(title = "star数量"), edit = @Edit(title = "star数量", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private int stargazersCount; - - - @EruptField(views = @View(title = "主题"), edit = @Edit(title = "主题", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String topics; - - @EruptField(views = @View(title = "语言"), edit = @Edit(title = "语言", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType)) - private String language; -} diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/package-info.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/github/package-info.java deleted file mode 100644 index 92c9212..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package io.fluentqa.github; \ No newline at end of file diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/service/GithubService.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/github/service/GithubService.java deleted file mode 100644 index c80b6ae..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/github/service/GithubService.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.fluentqa.github.service; - -import io.fluent.git.github.GithubUserService; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -@Service -@Slf4j -public class GithubService { - GithubUserService userService = new GithubUserService(); - - public void saveUserStarredRepo(String userName,int page){ - log.info("start save all starred repos"); - userService.saveUserStarredRepo(userName,page); - log.info("complete saved user starred repo"); - } -} diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/GithubStarredCollectorJob.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/GithubStarredCollectorJob.java deleted file mode 100644 index 12d132b..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/GithubStarredCollectorJob.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.fluentqa.jobs; - -import cn.hutool.json.JSONUtil; -import io.fluent.builtin.StringUtils; -import io.fluentqa.github.service.GithubService; -import io.fluentqa.jobs.github.GithubJobFetchParameters; -import lombok.extern.slf4j.Slf4j; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; -import xyz.erupt.core.annotation.EruptHandlerNaming; -import xyz.erupt.job.handler.EruptJobHandler; - -import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; - -@Service -@Slf4j -@EruptHandlerNaming("Github Starred Repo Job") // 如果不添加此配置,类名会作为前端展示依据 -public class GithubStarredCollectorJob implements EruptJobHandler { - @Resource - private GithubService githubService; - /** - * @param code 任务编码 - * @param param 任务参数 - */ - - @Override - public String exec(String code, String param) { - log.info("start job %s with parameter %s".formatted(code,param)); - GithubJobFetchParameters parameters ; - if(StringUtils.isAllEmpty(param)){ - parameters = new GithubJobFetchParameters(); - }else { - parameters = JSONUtil.toBean(param, GithubJobFetchParameters.class); - } - List userNames=StringUtils.split(parameters.getUserNames(),","); - for (String userName : userNames) { - githubService.saveUserStarredRepo(userName,parameters.getFromPage()); - } - return "success"; - } - - - @Override - public void success(String result, String param) { - log.info(String.format("success result %s", result)); - EruptJobHandler.super.success(result, param); - } - - @Override - public void error(Throwable throwable, String param) { - EruptJobHandler.super.error(throwable, param); - } - -} \ No newline at end of file diff --git a/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/github/GithubJobFetchParameters.java b/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/github/GithubJobFetchParameters.java deleted file mode 100644 index 0cfd142..0000000 --- a/fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/github/GithubJobFetchParameters.java +++ /dev/null @@ -1,11 +0,0 @@ -package io.fluentqa.jobs.github; - -import lombok.Data; -//https://olakit.cn/box/quartz_cron_build_check -//0 0 23 ? * * * -@Data -public class GithubJobFetchParameters { - private String userNames="qdriven"; - private int fromPage=0; - private int pageSize=50; -} diff --git a/package.sh b/package.sh index 8a39808..f03e338 100644 --- a/package.sh +++ b/package.sh @@ -1,2 +1 @@ mvn clean package -Dmaven.test.skip=true - cp -rf server/target/*.jar . \ No newline at end of file diff --git a/pom.xml b/pom.xml index eb3ee7e..bc1c6e1 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ - 1.12.14 + 1.12.15 1.0-SNAPSHOT 42.5.1 UTF-8