Skip to content

Commit

Permalink
refine project
Browse files Browse the repository at this point in the history
  • Loading branch information
qdriven committed Jun 13, 2024
1 parent b2b3cf8 commit 35ca10a
Show file tree
Hide file tree
Showing 35 changed files with 633 additions and 26 deletions.
11 changes: 11 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TO DO List


## Absorb Different Project

- [ihub-lib](https://github.com/ihub-pub/libs.git)SSO Module


## DAO Framework

- [doma-framework](https://github.com/domaframework/doma.git)
10 changes: 10 additions & 0 deletions components/fluent-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<artifactId>commons-csv</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.2</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.ozlerhakan</groupId>-->
<!-- <artifactId>poiji</artifactId>-->
<!-- <version>4.5.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.github.liaochong</groupId>-->
<!-- <artifactId>myexcel</artifactId>-->
Expand Down
6 changes: 5 additions & 1 deletion components/fluent-openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
<artifactId>swagger-parser</artifactId>
<version>2.1.22</version>
</dependency>

<!-- <dependency>-->
<!-- <groupId>io.openapiprocessor</groupId>-->
<!-- <artifactId>openapi-processor-{project}</artifactId>-->
<!-- <version>{version}</version>-->
<!-- </dependency>-->
</dependencies>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.fluent.swagger;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class SwaggerParserTest {
SwaggerParser parser = new SwaggerParser();

@Test
public void testParse() {

}
}
9 changes: 8 additions & 1 deletion components/fluent-quickdao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
</parent>

<artifactId>fluent-quickdao</artifactId>

<!-- <properties>-->
<!-- <doma.version>2.60.0</doma.version>-->
<!-- </properties>-->
<dependencies>
<dependency>
<groupId>cn.hutool</groupId>
Expand All @@ -30,5 +32,10 @@
<version>3.42.0.0</version>
<scope>test</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.seasar.doma</groupId>-->
<!-- <artifactId>doma-core</artifactId>-->
<!-- <version>${doma.version}</version>-->
<!-- </dependency>-->
</dependencies>
</project>
10 changes: 5 additions & 5 deletions fluent-apps/qaserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- 代码生成器模块 -->
<dependency>
<groupId>xyz.erupt</groupId>
<artifactId>erupt-generator</artifactId>
<version>${erupt.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>xyz.erupt</groupId>-->
<!-- <artifactId>erupt-generator</artifactId>-->
<!-- <version>${erupt.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>io.hypersistence</groupId>-->
<!-- <artifactId>hypersistence-utils-hibernate-62</artifactId>-->
Expand Down

This file was deleted.

4 changes: 3 additions & 1 deletion fluent-apps/qaserver/src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ erupt:

spring:
datasource:
url: jdbc:postgresql://db.supabase.orb.local:5432/workspace
url: jdbc:postgresql://db.supabase.orb.local:5432/postgres?currentSchema=workspace
username: postgres
password: postgres
jpa:
Expand Down Expand Up @@ -93,6 +93,8 @@ logging:
root: TRACE
io.fluentqa: DEBUG
org.hibernate: DEBUG
io.fluent: DEBUG
xyz.erupt: DEBUG

magic-api:
web: /fluentapi/v1
Expand Down
6 changes: 6 additions & 0 deletions fluent-erupts/fluent-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,11 @@
<artifactId>magic-api-spring-boot-starter</artifactId>
<version>${magic-api.version}</version>
</dependency>
<dependency>
<groupId>io.fluent</groupId>
<artifactId>fluent-quickdao</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@Configuration
@ComponentScan
@EruptScan
public class FluentEruptApiAutoConfiguration implements EruptModule {
public class FluentEruptGeneratorAutoConfiguration implements EruptModule {

public static final String MAGIC_API_MENU_PREFIX = "ERUPT_MAGIC_";

Expand All @@ -29,7 +29,7 @@ public class FluentEruptApiAutoConfiguration implements EruptModule {
public static final String FUNCTION = "FUNCTION";

static {
EruptModuleInvoke.addEruptModule(FluentEruptApiAutoConfiguration.class);
EruptModuleInvoke.addEruptModule(FluentEruptGeneratorAutoConfiguration.class);
}

@Override
Expand All @@ -53,7 +53,7 @@ public List<MetaMenu> initMenus() {
List<MetaMenu> metaMenus = new ArrayList<>();
metaMenus.add(
MetaMenu.createSimpleMenu(
menuKey, "接口配置", MagicApiTpl.MAGIC_API_PERMISSION, null, 50, EruptTplService.TPL));
menuKey, "接口服务配置", MagicApiTpl.MAGIC_API_PERMISSION, null, 50, EruptTplService.TPL));
metaMenus.add(
MetaMenu.createSimpleMenu(
menuKey + "-" + FUNCTION.toLowerCase(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.fluentqa.generator.interceptor;

import io.fluentqa.generator.FluentEruptApiAutoConfiguration;
import io.fluentqa.generator.FluentEruptGeneratorAutoConfiguration;
import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
Expand Down Expand Up @@ -87,7 +87,7 @@ public boolean allowVisit(
throw new EruptWebApiRuntimeException(LOGIN_EXPIRE);
} else if (null
== eruptUserService.getEruptMenuByValue(
FluentEruptApiAutoConfiguration.MAGIC_API_MENU_PREFIX + authorization.name())) {
FluentEruptGeneratorAutoConfiguration.MAGIC_API_MENU_PREFIX + authorization.name())) {
throw new EruptWebApiRuntimeException(NO_PERMISSION);
}
return true;
Expand Down Expand Up @@ -127,15 +127,15 @@ public boolean allowVisit(
if (entity instanceof FunctionInfo) {
if (Authorization.SAVE == authorization || Authorization.DELETE == authorization) {
return eruptUserService.getEruptMenuByValue(
FluentEruptApiAutoConfiguration.MAGIC_API_MENU_PREFIX
+ FluentEruptApiAutoConfiguration.FUNCTION)
FluentEruptGeneratorAutoConfiguration.MAGIC_API_MENU_PREFIX
+ FluentEruptGeneratorAutoConfiguration.FUNCTION)
!= null;
}
} else if (entity instanceof DataSourceInfo) {
if (Authorization.SAVE == authorization || Authorization.DELETE == authorization) {
return eruptUserService.getEruptMenuByValue(
FluentEruptApiAutoConfiguration.MAGIC_API_MENU_PREFIX
+ FluentEruptApiAutoConfiguration.DATASOURCE)
FluentEruptGeneratorAutoConfiguration.MAGIC_API_MENU_PREFIX
+ FluentEruptGeneratorAutoConfiguration.DATASOURCE)
!= null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_erupt.RowOperation;
import xyz.erupt.annotation.sub_erupt.Tree;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.fluentqa.base.handlers.SqlTagFetchHandler;
import io.fluentqa.base.model.ModelWithValidFlag;
import io.fluentqa.base.model.ModelWithValidFlagVo;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package io.fluentqa.generator.model;

import freemarker.ext.beans.BeansWrapper;
import freemarker.template.TemplateHashModel;
import lombok.Getter;
import lombok.Setter;
import lombok.SneakyThrows;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.EruptI18n;
import xyz.erupt.annotation.constant.AnnotationConst;
import xyz.erupt.annotation.sub_erupt.RowOperation;
import xyz.erupt.annotation.sub_erupt.Tpl;
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.Search;
import xyz.erupt.jpa.model.MetaModel;

import javax.persistence.*;
import java.util.Map;
import java.util.Set;

@EruptI18n
@Erupt(name = "生成Erupt代码",
rowOperation = @RowOperation(
title = "代码预览", icon = "fa fa-code",
mode = RowOperation.Mode.SINGLE, type = RowOperation.Type.TPL,
tpl = @Tpl(path = "generation/erupt/erupt-code-skeleton.ftl",
engine = Tpl.Engine.FreeMarker,
tplHandler = GeneratorClass.class)
)
)
@Table(name = "generator_class")
@Entity
@Getter
@Setter
public class GeneratorClass extends MetaModel implements Tpl.TplHandler {

@EruptField(
views = @View(title = "名称"),
edit = @Edit(title = "名称", notNull = true, search = @Search(vague = true))
)
private String name;

@EruptField(
views = @View(title = "实体类名"),
edit = @Edit(title = "实体类名", notNull = true, search = @Search(vague = true))
)
private String className;

@EruptField(
views = @View(title = "表名"),
edit = @Edit(title = "表名", notNull = true, search = @Search(vague = true))
)
private String tableName;

@Column(length = AnnotationConst.REMARK_LENGTH)
@EruptField(
views = @View(title = "简介"),
edit = @Edit(title = "简介", type = EditType.TEXTAREA)
)
private String remark;

// @EruptField(
// views = @View(title = "维护"),
// edit = @Edit(title = "自动维护创建字段与更新字段")
// )
// private Boolean createField;


@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "class_id")
@OrderBy("sort")
@EruptField(
edit = @Edit(title = "字段管理", type = EditType.TAB_TABLE_ADD)
)
private Set<GeneratorField> fields;

@SneakyThrows
@Override
public void bindTplData(Map<String, Object> binding, String[] params) {
TemplateHashModel staticModels = BeansWrapper.getDefaultInstance().getStaticModels();
TemplateHashModel fileStatics = (TemplateHashModel) staticModels.get(GeneratorType.class.getName());
binding.put(GeneratorType.class.getSimpleName(), fileStatics);
}

}
Loading

0 comments on commit 35ca10a

Please sign in to comment.