Skip to content

Commit

Permalink
Merge branch 'feature/ElderTitan' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
trydofor committed Aug 24, 2023
2 parents 62d19e7 + eb321a1 commit 262d8f2
Show file tree
Hide file tree
Showing 574 changed files with 6,743 additions and 4,956 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class AdminController {
private WarlockUserAuthnService authnService;

@PostMapping("/admin/disable-root.json")
public R<Boolean> rootNeverLogin() {
public R<Void> rootNeverLogin() {
authnService.disable(DefaultUserId.Root, WarlockAuthType.USERNAME);
log.info("disable root");
return R.ok();
return R.OK;
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
############## BGN: 仅过测试使用,发布是需要移除 ##############
############## BGN: For testing only, to be removed before release ##############
wings.warlock.security.mem-user[winx-admin].user-id=99
wings.warlock.security.mem-user[winx-admin].username=winx-admin@fessional.pro
wings.warlock.security.mem-user[winx-admin].password={noop-md5}Make-CnDota-Great-Again!
wings.warlock.security.mem-auth[winx-admin].user-id=99
wings.warlock.security.mem-auth[winx-admin].auth-perm=ROLE_ADMIN
############## END: 仅过测试使用,发布是需要移除 ##############
############## END: For testing only, to be removed before release ##############
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.springframework.web.bind.annotation.ResponseBody;

/**
* Rpc风格,接口定义SchemaId,basePath指定SchemaId
* Rpc style, interface define SchemaId , basePath specify SchemaId
*
* @author trydofor
* @since 2022-08-04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CommonEnabledProp {
public static final String Key = "spring.winx.common.enabled";

/**
* 是否默认配置 fedex
* Whether to config fedex
*
* @see #Key$fedex
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring.datasource.url=jdbc:mysql://localhost:3306/wings_example\

#spring.datasource.url=jdbc:h2:./wings-example\
#;USER=trydofor;PASSWORD=moilioncircle\
#;MODE=MySQL;CASE_INSENSITIVE_IDENTIFIERS=TRUE\
#;MODE=MySQL;CASE_INSENSITIVE_IDENTIFIERS=TRUE;IGNORECASE=TRUE\
#;AUTO_RECONNECT=TRUE;AUTO_SERVER=TRUE

spring.datasource.username=trydofor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# 是否默认配置 fedex
## Whether to config fedex
spring.winx.common.enabled.fedex=true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 不同于 sentry.properties,此配置有 sentry starter使用
## Unlike sentry.properties, this config is used by the Sentry Starter.
sentry.dsn=${SENTRY_DSN:}
# Set traces-sample-rate to 1.0 to capture 100% of transactions for performance monitoring.
# We recommend adjusting this value in production.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 默认不监控邮件,以免应用无法启动
## Mail is not monitored by default in case the application fails to start
management.health.mail.enabled=false
management.metrics.tags.application=wings-winx

Expand Down Expand Up @@ -27,6 +27,6 @@ wings.warlock.security.mem-user[boot-admin-client].user-id=79
wings.warlock.security.mem-user[boot-admin-client].username=${spring.boot.admin.client.instance.metadata.user.name}
wings.warlock.security.mem-user[boot-admin-client].password={basic}${spring.boot.admin.client.instance.metadata.user.password}

# 内存用户权限,key授权说明,重复时覆盖,建议以类型和用途
## Memory user permissions, key is auth info, overwrite if duplicated, recommend to use type and purpose.
wings.warlock.security.mem-auth[boot-admin-client].user-id=79
wings.warlock.security.mem-auth[boot-admin-client].auth-perm=ROLE_ACTUATOR
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# 自行修改集群名字,因社区版无安全设置,仅通过集群名便可加入,因此建议使用密码强度的名字,如32字符随机数,避开扫描。
## Modify the cluster name on your own, as the community version has no security settings and joining is only based on the cluster name.
## Therefore, it is recommended to use a strong and password-like name, such as a 32-character random string, to avoid scanning.
wings.slardar.hazelcast.cluster-name=wings-example-${git.commit.id.full:NEED_SAFE_HASH}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 总开关
## Whether enable watching
spring.wings.warlock.enabled.watching=true
# -1表示关闭,0表示全开,毫秒值
## -1 means disable, 0 means enable, otherwise number in millis
#wings.warlock.watching.jooq-threshold=-1
#wings.warlock.watching.service-threshold=-1
#wings.warlock.watching.controller-threshold=-1
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public static void initProject(Info info, Consumer<String> message) throws IOExc
String dstAbsPath = info.dstDir.getAbsolutePath();

if (dstAbsPath.contains(srcAbsPath) || srcAbsPath.contains(dstAbsPath)) {
throw new IOException("新工程路径和wings-example有重合,重选");
throw new IOException("Path overlaps with wings-example, please choose a different one.");
}

if (!info.srcDir.exists()) {
message.accept("创建新工程目录");
message.accept("Create new project dir.");
info.srcDir.mkdirs();
}

Expand Down Expand Up @@ -113,7 +113,7 @@ private static void makeWings(File root, String code, String pkg, Consumer<Strin
private static void copyTree(Info info, File src, Predicate<String> exc, Consumer<String> message) throws IOException {

final String path = src.getAbsolutePath();
// 忽略
// ignore
if (exc.test(path)) {
return;
}
Expand Down Expand Up @@ -163,14 +163,14 @@ else if (path.endsWith(".java") ||
}

if (bytes.length > 0) {
message.accept("写入 " + dstName);
message.accept("Write to " + dstName);
FileOutputStream fos = new FileOutputStream(dstFile);
fos.write(bytes);
fos.flush();
fos.close();
}
else {
message.accept("新建 " + dstName);
message.accept("Create New " + dstName);
dstFile.createNewFile();
}
}
Expand Down
6 changes: 3 additions & 3 deletions example/winx-devops/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ server.port=8093
spring.application.name=winx-devops

#debug=true
# disable CONDITIONS EVALUATION REPORT
## disable CONDITIONS EVALUATION REPORT
logging.level.org.springframework.boot.autoconfigure=INFO
#logging.file.name=winx-devops.log

#wings.warlock.security.session-maximum=10

# IDEA的默认启动参数,增加 `-Dspring.jmx.enabled=true`,此参数无效
# 需要手动 Disable JMX agent
## add `-Dspring.jmx.enabled=true` to IDEA start args
## Need manually Disable JMX agent
spring.jmx.enabled=false
wings.silencer.inspect.properties=true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ private static void showWings(String[] args) {
project.initWings(args);

project.pack();
project.setLocationRelativeTo(null); // 居中
// 焦点
project.setLocationRelativeTo(null); // center
// focus
project.setState(Frame.NORMAL);
project.toFront();
project.requestFocus();
Expand All @@ -295,8 +295,8 @@ private void initWings(String[] args) {
txtWingsVer.setText(args[2]);
}

btnWingsPath.addActionListener(evt -> chooseDir("wings-example工程目录", txtWingsPath));
btnProjectPath.addActionListener(evt -> chooseDir("新建工程目录", txtProjectPath));
btnWingsPath.addActionListener(evt -> chooseDir("wings-example project dir", txtWingsPath));
btnProjectPath.addActionListener(evt -> chooseDir("new project dir", txtProjectPath));
btnGenerate.addActionListener(evt -> generatePrj());

FocusAdapter txtFocus = new FocusAdapter() {
Expand All @@ -316,7 +316,7 @@ public void focusGained(FocusEvent e) {
private void chooseDir(String name, JTextField field) {
JFileChooser jfc = new JFileChooser();
jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
jfc.showDialog(new JLabel(), "选择" + name);
jfc.showDialog(new JLabel(), "Select" + name);
File dir = jfc.getSelectedFile();
if (dir != null) {
field.setText(dir.getAbsolutePath());
Expand All @@ -327,7 +327,7 @@ private void generatePrj() {

try {
pgbGenerate.setStringPainted(true);
pgbGenerate.setString("嗖一下,就完事");
pgbGenerate.setString("Done, so easy :)");
pgbGenerate.setIndeterminate(true);

WingsInitProjectUtil.Info info = new WingsInitProjectUtil.Info();
Expand All @@ -339,14 +339,14 @@ private void generatePrj() {
info.dstPackage = txtPackage.getText().trim();
info.version = txtWingsVer.getText().trim();

WingsInitProjectUtil.initProject(info, it -> message("复制:" + it));
message("完成了 ¯\\_()_/¯");
pgbGenerate.setString("完成了,¯\\_()_/¯");
WingsInitProjectUtil.initProject(info, it -> message("Copy:" + it));
message("Done ¯\\_(\"/)_/¯");
pgbGenerate.setString("Done ¯\\_(\"/)_/¯");
}
catch (Exception e) {
e.printStackTrace();
message("出错了 " + e.getMessage());
pgbGenerate.setString("出错了!");
message("Error " + e.getMessage());
pgbGenerate.setString("Error");
pgbGenerate.setIndeterminate(false);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.moilioncircle.wings.devops.project;

/**
* 注意在IDEA默认情况下,Main函数与TestCase启动的Workdir不同
* - Main是根工程路径,目标中设置
* - TestCase是当前工程,$MODULE_WORKING_DIR$
* <pre>
* Note that by default in IDEA, the Workdir launched by `main` and TestCase are different.
* - `main` refers to the root project path, which can be set in configuration.
* - TestCase refers to the current project and uses $MODULE_WORKING_DIR$.
* </pre>
*
* @author trydofor
* @since 2021-02-22
Expand All @@ -17,7 +19,7 @@ public interface Devops0ProjectConstant {
String JDBC_USER = "trydofor";
String JDBC_PASS = "moilioncircle";

// 需要设置 Working Directory=$MODULE_WORKING_DIR$
// Need set Working Directory=$MODULE_WORKING_DIR$
String JAVA_MAIN = "../winx-codegen/src/main/java/";

String PKG_ENUM = "com.moilioncircle.wings.codegen.enums";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @author trydofor
* @since 2021-02-22
*/
@Disabled("数据库版本")
@Disabled("Database Version")
@SpringBootTest(properties = {
"spring.datasource.url=" + Devops0ProjectConstant.JDBC_URL,
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author trydofor
* @since 2021-02-22
*/
@Disabled("生成代码")
@Disabled("Code Gen")
public class Devops2CodeGeneratorTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.util.List;

/**
* ⑤ 使用wings的flywave,生成trigger和跟踪表
* Generate trigger and trace table by wings flywave
*
* @author trydofor
* @since 2019-12-26
Expand All @@ -24,7 +24,7 @@
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
"spring.datasource.password=" + Devops0ProjectConstant.JDBC_PASS,
})
@Disabled("日志表管理")
@Disabled("Journal Manage")
@Slf4j
public class Devops5JournalManagerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import pro.fessional.wings.faceless.flywave.SchemaShardingManager;

/**
* ⑥ 使用wings的flywave,生成trigger和跟踪表
*
* @author trydofor
* @since 2019-12-26
*/
Expand All @@ -19,7 +17,7 @@
"spring.datasource.username=" + Devops0ProjectConstant.JDBC_USER,
"spring.datasource.password=" + Devops0ProjectConstant.JDBC_PASS,
})
@Disabled("分表分库")
@Disabled("Sharding table")
public class Devops6ShardingManagerTest {

@Setter(onMethod_ = {@Autowired})
Expand All @@ -30,7 +28,7 @@ public void test1SplitTable() {
schemaShardingManager.publishShard("win_user", 2);
}

// 需要 sharding config
// need sharding config
// @Test
// public void test2MoveDate() {
// schemaShardingManager.shardingData("win_user", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
import java.util.Map;

/**
* ⑥ 使用wings的flywave,生成trigger和跟踪表
*
* @author trydofor
* @since 2019-12-26
*/

@SpringBootTest
@Disabled("枚举类导出")
@Disabled("Dump Enums")
public class Devops7EnumsDumperTest {

@Setter(onMethod_ = {@Autowired})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

@SpringBootTest
@Disabled("查看Web映射关系")
@Disabled("List Web RequestMapping")
@Slf4j
public class Devops7RequestMapperTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


@SpringBootTest
@Disabled("数据库导出")
@Disabled("Dump database")
@Slf4j
public class Devops7SchemaDumperTest {

Expand All @@ -32,22 +32,22 @@ public class Devops7SchemaDumperTest {
@Test
public void dumpSchema() {
Function1<List<String>, List<String>> ddl = SchemaFulldumpManager.groupedTable(false,
"-- ==================== Basement-4(B4/10#):基础 =======================",
"sys_schema_version", // 101/表结构版本
"sys_schema_journal", // 102/数据触发器
"sys_light_sequence", // 103/序号生成器
"sys_commit_journal", // 104/数据变更集
"sys_constant_enum", // 105/常量枚举:自动生成enum类
"sys_standard_i18n", // 106/标准多国语
"-- ==================== Floor-1(F1/12#-13#):用户 =======================",
"win_user_basis", // 120/用户基本表
"win_user_authn", // 121/用户验证表
"win_user_login", // 122/用户登录表
"win_perm_entry", // 130/权限条目表
"win_role_entry", // 131/角色条目表
"win_role_grant", // 134/角色权限映射表
"win_user_grant", // 135/角色权限映射表
"-- ==================== Floor-10(F11/90#):辅助 ======================="
"-- ==================== Basement-4(B4/10#): Base =======================",
"sys_schema_version", // 101/schema version
"sys_schema_journal", // 102/schema journal
"sys_light_sequence", // 103/sequence
"sys_commit_journal", // 104/data changeset
"sys_constant_enum", // 105/enum const: auto gen enum
"sys_standard_i18n", // 106/i18n message
"-- ==================== Floor-1(F1/12#-13#): User =======================",
"win_user_basis", // 120/user basis
"win_user_authn", // 121/user authn
"win_user_login", // 122/user login
"win_perm_entry", // 130/perm entry
"win_role_entry", // 131/role entry
"win_role_grant", // 134/grant to role
"win_user_grant", // 135/grant to user
"-- ==================== Floor-10(F11/90#): Help ======================="
);
String root = Devops0ProjectConstant.DUMP_PATH + Devops0ProjectConstant.DUMP_TYPE;
log.info("===== dump ddl to " + root);
Expand All @@ -62,14 +62,14 @@ public void dumpRecord() {
"sys_light_.*",
"sys_constant_.*",
"sys_standard_.*",
"win_user_basis", // 120/用户基本表
"win_user_authn", // 121/用户验证表
"win_user_login", // 122/用户登录表
"win_perm_entry", // 130/权限条目表
"win_role_entry", // 131/角色条目表
"win_role_grant", // 134/角色权限映射表
"win_user_grant" // 135/角色权限映射表
);
"win_user_basis",
"win_user_authn",
"win_user_login",
"win_perm_entry",
"win_role_entry",
"win_role_grant",
"win_user_grant"
);

String root = Devops0ProjectConstant.DUMP_PATH + Devops0ProjectConstant.DUMP_TYPE;
log.info("===== dump rec to " + root);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Map;

/**
* 统计git代码,按年月和作者
* Statistics Git code, grouping it by year, month, and author.
*
* @author trydofor
* @since 2019-12-26
Expand Down
2 changes: 1 addition & 1 deletion observe/docs
Submodule docs updated 57 files
+1 −1 .markdownlint.yml
+911 −879 package-lock.json
+4 −4 package.json
+1 −1 src/0-wings/0a-code-style.md
+6 −1 src/0-wings/0e-qa-config.md
+1 −1 src/0-wings/0h-prop-index.md
+54 −0 src/0-wings/0i-i18n-message.md
+45 −0 src/0-wings/0j-code-pattern.md
+4 −2 src/0-wings/README.md
+4 −4 src/1-silencer/1d-prop-silencer.md
+1 −1 src/2-faceless/2c-shard.md
+2 −2 src/2-faceless/2d-mysql-h2.md
+2 −1 src/2-faceless/2f-qa-jooq.md
+1 −1 src/2-faceless/2g-qa-shard.md
+15 −7 src/2-faceless/2i-prop-faceless.md
+2 −2 src/2-faceless/2k-prop-jooq.md
+2 −2 src/3-slardar/3b-hazelcast.md
+9 −3 src/3-slardar/3d-i18n-zone.md
+36 −7 src/3-slardar/3f-cache-event.md
+2 −2 src/3-slardar/3g-fun-server.md
+10 −10 src/3-slardar/3j-prop-webmvc.md
+3 −3 src/3-slardar/3k-prop-function.md
+44 −38 src/4-warlock/4d-prop-warlock.md
+30 −4 src/4-warlock/4f-api-oauth.md
+2 −2 src/8-radiant/8b-prop-tinytask.md
+1 −1 src/8-radiant/8c-tinymail.md
+2 −2 src/8-radiant/8d-prop-tinymail.md
+18 −2 src/9-example/9a.wings-change/9a0.notable.md
+1 −1 src/9-example/9a.wings-change/9a2.266-210.md
+63 −0 src/9-example/9a.wings-change/9a5.30x-30x.md
+1 −0 src/9-example/9a.wings-change/README.md
+1 −1 src/9-example/9b.spring-boot/9b5.prop-bind.md
+1 −1 src/9-example/9c.server-manual/9c1.mysql-dump-restore.md
+10 −8 src/9-example/README.md
+1 −2 src/README.md
+4 −5 src/b-meepo/b1.meepo.md
+5 −1 src/zh/0-wings/0e-qa-config.md
+1 −1 src/zh/0-wings/0h-prop-index.md
+54 −0 src/zh/0-wings/0i-i18n-message.md
+45 −0 src/zh/0-wings/0j-code-pattern.md
+4 −2 src/zh/0-wings/README.md
+4 −4 src/zh/1-silencer/1d-prop-silencer.md
+1 −1 src/zh/2-faceless/2d-mysql-h2.md
+15 −7 src/zh/2-faceless/2i-prop-faceless.md
+2 −2 src/zh/2-faceless/2k-prop-jooq.md
+8 −2 src/zh/3-slardar/3d-i18n-zone.md
+33 −6 src/zh/3-slardar/3f-cache-event.md
+1 −1 src/zh/3-slardar/3g-fun-server.md
+11 −11 src/zh/3-slardar/3j-prop-webmvc.md
+3 −3 src/zh/3-slardar/3k-prop-function.md
+44 −38 src/zh/4-warlock/4d-prop-warlock.md
+26 −0 src/zh/4-warlock/4f-api-oauth.md
+1 −1 src/zh/9-example/9a.wings-change/9a0.notable.md
+61 −0 src/zh/9-example/9a.wings-change/9a5.30x-30x.md
+1 −0 src/zh/9-example/9a.wings-change/README.md
+10 −8 src/zh/9-example/README.md
+1 −1 src/zh/README.md
Loading

0 comments on commit 262d8f2

Please sign in to comment.