Skip to content

Commit 30afb2b

Browse files
committed
#19 add different modules
1 parent b32a1f9 commit 30afb2b

File tree

4 files changed

+75
-3
lines changed

4 files changed

+75
-3
lines changed

fluent-apps/qaserver/src/main/java/io/fluentqa/github/model/GithubStarredRepo.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public class GithubStarredRepo extends MetaModelVo {
3434

3535

3636
@EruptField(views = @View(title = "主题"), edit = @Edit(title = "主题", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType))
37-
3837
private String topics;
3938

4039
@EruptField(views = @View(title = "语言"), edit = @Edit(title = "语言", type = EditType.INPUT, search = @Search, notNull = true, inputType = @InputType))

fluent-apps/qaserver/src/main/java/io/fluentqa/jobs/GithubStarredCollectorJob.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ public String exec(String code, String param) {
3333
}else {
3434
parameters = JSONUtil.toBean(param, GithubJobFetchParameters.class);
3535
}
36+
//TODO: make it async
3637
userNames=StringUtils.split(parameters.getUserNames(),",");
3738
for (String userName : userNames) {
3839
githubService.saveUserStarredRepo(userName,parameters.getFromPage());
3940
}
4041
return "success";
4142
}
4243

44+
4345
@Override
4446
public void success(String result, String param) {
4547
log.info(String.format("success result %s", result));
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
package io.fluentqa.qtm.api;
2+
3+
4+
import io.fluentqa.github.FluentGithubModule;
5+
import io.fluentqa.github.model.GithubStarredRepo;
6+
import org.springframework.boot.autoconfigure.domain.EntityScan;
7+
import org.springframework.boot.context.properties.EnableConfigurationProperties;
8+
import org.springframework.context.annotation.ComponentScan;
9+
import org.springframework.context.annotation.Configuration;
10+
import xyz.erupt.core.annotation.EruptScan;
11+
import xyz.erupt.core.constant.MenuTypeEnum;
12+
import xyz.erupt.core.module.EruptModule;
13+
import xyz.erupt.core.module.EruptModuleInvoke;
14+
import xyz.erupt.core.module.MetaMenu;
15+
import xyz.erupt.core.module.ModuleInfo;
16+
17+
import java.util.ArrayList;
18+
import java.util.List;
19+
20+
21+
@Configuration
22+
@ComponentScan
23+
@EntityScan
24+
@EruptScan
25+
@EnableConfigurationProperties
26+
public class FluentQAApiModule implements EruptModule {
27+
public FluentQAApiModule() {
28+
}
29+
30+
@Override
31+
public ModuleInfo info() {
32+
return ModuleInfo.builder().name("QA-API").build();
33+
}
34+
35+
@Override
36+
public void run() {
37+
EruptModule.super.run();
38+
}
39+
40+
/**
41+
* API管理:
42+
*
43+
* 1. API 仓库管理
44+
* 2. API 接口定义
45+
* 3. API 接口录制记录
46+
* 4. API 接口测试
47+
* @return
48+
*/
49+
@Override
50+
public List<MetaMenu> initMenus() {
51+
List<MetaMenu> menus = new ArrayList<>();
52+
menus.add(MetaMenu.createRootMenu("$APIMgr", "接口管理", "fa-exchange", 1));
53+
MetaMenu starredMenu =MetaMenu.createEruptClassMenu(GithubStarredRepo.class, menus.get(0), 0, MenuTypeEnum.TABLE);
54+
starredMenu.setIcon("fa fa-star");
55+
starredMenu.setName("github收藏");
56+
starredMenu.setCode("$github-starred");
57+
menus.add(starredMenu);
58+
return menus;
59+
}
60+
61+
static {
62+
EruptModuleInvoke.addEruptModule(FluentGithubModule.class);
63+
}
64+
65+
@Override
66+
public void initFun() {
67+
EruptModule.super.initFun();
68+
}
69+
}

fluent-apps/qaserver/src/main/resources/application-dev.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ erupt:
2323

2424
spring:
2525
datasource:
26-
url: jdbc:postgresql://supabase_db_dev-stacks.orb.local:5432/workspace?schema=qa
26+
url: jdbc:postgresql://supabase_db_dev-stacks.orb.local:5432/workspace
2727
username: postgres
2828
password: postgres
2929
jpa:
@@ -90,7 +90,9 @@ server:
9090
port: 9090
9191
logging:
9292
level:
93-
root: debug
93+
root: TRACE
94+
io.fluentqa: DEBUG
95+
org.hibernate: DEBUG
9496

9597
magic-api:
9698
web: /fluentapi/v1

0 commit comments

Comments
 (0)