diff --git a/README.md b/README.md
index 3aad86a..a76512a 100644
--- a/README.md
+++ b/README.md
@@ -1,221 +1,8 @@
-## 项目结构
-```
-- cmd
- - demo
- - main.go // demo 项目启动入口
-- demo
- - schema // type 声明
- - db.go // db 相关的 type 声明
- - api.go // api response type 声明
- - error.go // error 信息
- - other.go // 其他模块对应的 type 声明
- - api.go // restful 接口实现
- - demo.go // 入口函数
- - jobs.go // 定时任务实现
- - wdb.go // 关系型数据库读写方法实现
- - cache.go // 缓存
- - other.go // 独立的处理方法
-- example // 用例
- - xxx.go
-- .drone.yml // ci/cd 配置文件
-- Dockerfile
-- README.md // demo 项目 readme
-- mod.go
-- Makefile // make all, make test
-- test.sh
-```
-[project-example](./project)
-### 基准
-- 每个 package 独立可用,对外接口尽量简洁,最好具备复用性
-- package 文件夹名称和里面的入口文件命名一致
-- 入口文件不宜有太多编码
-- 应将外部函数放在入口文件,业务自顶向下实现,入口能表现 package 的核心功能
-- 入口文件一般包含三个外部函数,分别是:New(), Run(), Close()
-- 提交代码之前必须运行 make all 和 make test 并通过之后才能提交
-- 命名风格参考之前的项目进行统一
-- cmd/main.go 中监听 signals 信号之后必须要调用 CLose() 进行安全退出
-
-## 通用三方库
-- cli: github.com/urfave/cli
-- api: github.com/gin-gonic/gin
-- job: github.com/go-co-op/gocron
-- log: github.com/inconshreveable/log15
-- test: github.com/stretchr/testify
-- json: github.com/tidwall/gjson
-- http-cli: gopkg.in/h2non/gentleman.v2
-- decimal library: github.com/shopspring/decimal
-- ethereumRPC: github.com/everFinance/ethrpc
-- ethereumSDK: github.com/everFinance/goether
-- arweaveSDK: github.com/everFinance/goar
-- web-framework: github.com/gin-gonic/gin
-- redis-cli: github.com/go-redis/redis
-- mysql-cli: gorm.io/gorm
-
-## 日志
-### 封装
-```
-func NewLog(serverName string) log15.Logger {
- lg := log15.New("module", serverName)
-
- // 默认的 logger handle
- h := lg.GetHandler()
- // 集成 sentry 的 logger handle
- sentryHandle := log15.FuncHandler(func(r *log15.Record) error {
- if r.Lvl == log15.LvlError {
- msg := string(log15.JsonFormat().Format(r))
- go func(m string) {
- sentry.CaptureMessage(m)
- }(msg)
- }
- return nil
- })
-
- lg.SetHandler(log15.MultiHandler(h, sentryHandle))
-
- return lg
-}
-```
-### 使用
-```
-var log = NewLog("demo")
-
-log.Info(msg, "var1",var1,"var2",var2)
-log.Debug(msg, "var1",var1,"var2",var2)
-log.Warn(msg, "var1",var1,"var2",var2)
-log.Error(msg, "err",err,"var1",var1)
-```
-### 使用规范
-#### 内容简洁
-日志 msg 必须简洁明确,不相干数据严重干扰日志分析。比如在打印 tx 日志中,不要输出 tx 所有字段,只需要打印需要的字段。
-#### 重复输出
-在开发过程中,经常出现日志打印重复的情况。比如如下:
-```
-func A() {
- err := b()
- if err != nil {
- log.Error("b() failed","err",err)
-
- }
-
-}
-
-func b() error {
- _, err := strconv.Atoi("111")
- if err != nil {
- log.Error("strconv.Atoi("111")","err",err)
- return err
- }
- return nil
-}
-
-```
-b() 中打印过 err msg,但是 A() 中又会打印一次 b() 返回的error, 所以出现了重复打印的情况。这种情况严重干扰对日志的分析。
-正确的做法是在 b() 中不打印,只要在最外层调用函数中打印。
-#### 正确使用日志级别
-在 log5 中主要使用到 Debug, Info, Warn, Error 这四个级别来打印日志。
-1. Debug 使用场景
- 代码调试、输出关键信息用于判断程序状态。
-2. Info 使用场景
- 程序启动打印初始化数据信息、关键状态正常改变之后的信息输出。
-3. Warn 使用场景
- 对系统整体运行影响不大但是不可忽略的错误,需要通过 warn 级别输出。比如读取外部服务的定时任务某次读取失败的情况。
-4. Error 使用场景
- 服务出现 Error 并影响服务正常运行都必须使用 Error 级别输出。
-
-#### error 信息声明
-error 信息统一在 error.go 中声明,命名方式为蛇形命名法,如:
-```
-var ERR_INVALID_SIGNATURE = "err_invalid_signature"
-```
-
-## 编码规范
-参考 [Uber-go 规范](https://github.com/xxjwxc/uber_go_guide_cn#uber-go-%E8%AF%AD%E8%A8%80%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83)
-
-### 补充
-- 在 demo.go 中原则上只实现三个方法 New(), Run(), Close()
-- 在 **.go 文件中,只有需要被其他文件调用的方法首字符才大写。
-- 文件中 public 方法统一写在 private 方法之前。
- ```go
- AA(){}
- BB(){}
- aa(){}
- bb(){}
- ```
-- 方法命令必须为驼峰,并且必须简洁
- ```go
- bad:
- UpdateBlockChainStableBlock(){}
- Good:
- UpdateStableBlock(){}
- ```
-- 相同属性的传参写到一起,返回值如此
- ```go
- AA(ethRpc, moonRpc, cfxRpc string, db *Db) {}
- ```
-- 存在 error 返回值,error 写在返回值最后一位
- ```go
- AA(ethRpc, moonRpc, cfxRpc string, db *Db) (string,int,error) {}
- ```
-- 函数参数避免指针类型。如果是 slice, map 传参之前可以 copy 一份
-- 避免使用多重 if- else if -else, 请替换成 switch
-- 不要使用闭包,因为你没法控制闭包中调用的外部变量是如何变化
- ```
- bad:
- for i:=0; i <10; i ++ {
- go func() {
- t.Log(i) // 闭包中的 i 会随着 for 循环改变,最后打印的都是 10
- }()
- }
- good:
- for i:=0; i <10; i ++ {
- go func(i int) { // 通过确定性的传参
- t.Log(i)
- }(i)
- }
- ```
-- 使用 locker.Lock() 之后必须立即声明 defer locker.Unlocker()
- ```go
- bad:
- func AA() {
- locker.Lock()
- ...
- locker.UnLock()
- }
-
- good:
- func AA() {
- locker.Lock()
- defer locker.UnLock()
- ...
- }
- ```
-- 尽量避免使用 init() 函数,因为加载 init() 函数中路径不可控,并且 init() 中逻辑不显式调用执行。请把 init() 中的处理放在 demo.go/New() 或者 Run() 中。
-- 使用 slice 或者 map,请在 make 的时候指定 cap, 这样 append 的时候会更高效以及节省代码运行时开辟的内存空间。
- ```go
- tokenList := make([]severSchema.TokenInfo, 0, 50)
- ```
-- 正常情况下不会使用到缓冲 channel, 如果必须要使用缓冲 channel, 请备注好为什么 cap 设置为该值。
-- 需要重命名 import package 的时候需要遵循就近原则,本模块的不需要重命名,名字冲突的其他模块命名需要加上模块名。
- ```go
- import (
- confSchema "github.com/everFinance/everpay/config/schema" // config 模块
- paySchema "github.com/everFinance/everpay/pay/schema" // pay 模块
- "github.com/everFinance/everpay/server/schema" // 同一模块
- )
- ```
-- api 返回结果必须使用 struct 形式
- ```go
- bad:
- c.JSON(http.StatusOK, gin.H{
- "total": total,
- "txs": txs,
- })
-
- good:
- c.JSON(http.StatusOK, schema.RespTxs{
- Total: total,
- Txs: txs,
- })
- ```
-- 代码中声明整数类型都使用 int64
----
+# Permadao Coding Guidelines
+## golang
+- [golang 规范 中文](./golang/README_zh.md)
+- [golang Coding Guidelines EN](./golang/README_en.md)
+
+## Java
+- [Java 规范 中文](./java/README_zh.md)
+- [Java Coding Guidelines EN](./java/README_en.md)
\ No newline at end of file
diff --git a/golang/README_en.md b/golang/README_en.md
new file mode 100644
index 0000000..6c3a68e
--- /dev/null
+++ b/golang/README_en.md
@@ -0,0 +1,218 @@
+# Golang Code Guidelines
+## Project Structure
+```
+- cmd
+ - demo
+ - main.go // Entry point for the demo project
+- demo
+ - schema // Type declarations
+ - db.go // Type declarations related to the database
+ - api.go // Type declarations for API responses
+ - error.go // Error messages
+ - other.go // Type declarations for other modules
+ - api.go // Implementation of RESTful interfaces
+ - demo.go // Entry function
+ - jobs.go // Implementation of scheduled tasks
+ - wdb.go // Implementation of relational database read/write methods
+ - cache.go // Cache
+ - other.go // Independent processing methods
+- example // Examples
+ - xxx.go
+- .drone.yml // CI/CD configuration file
+- Dockerfile
+- README.md // Readme for the demo project
+- mod.go
+- Makefile // make all, make test
+- test.sh
+
+```
+[project-example](./project)
+### Benchmarks
+- Each package should be independently usable, with externally facing interfaces kept concise and ideally reusable.
+- Package folder names should match the names of their entry files.
+- Entry files should not be overly complex.
+- External functions should be placed in entry files, with business logic implemented from top to bottom, showcasing the core functionality of the package.
+- Entry files generally include three external functions: New(), Run(), and Close().
+- Before committing code, run make all and make test, ensuring they pass before submission.
+- Follow the naming style established in previous projects for consistency.
+- In cmd/main.go, after listening for signals, it's mandatory to call Close() for a safe exit.
+
+## Common Third-party Libraries
+- cli: github.com/urfave/cli
+- api: github.com/gin-gonic/gin
+- job: github.com/go-co-op/gocron
+- log: github.com/inconshreveable/log15
+- test: github.com/stretchr/testify
+- json: github.com/tidwall/gjson
+- http-cli: gopkg.in/h2non/gentleman.v2
+- decimal library: github.com/shopspring/decimal
+- ethereumRPC: github.com/everFinance/ethrpc
+- ethereumSDK: github.com/everFinance/goether
+- arweaveSDK: github.com/everFinance/goar
+- web-framework: github.com/gin-gonic/gin
+- redis-cli: github.com/go-redis/redis
+- mysql-cli: gorm.io/gorm
+
+## Logging
+### Packing
+```
+func NewLog(serverName string) log15.Logger {
+ lg := log15.New("module", serverName)
+
+ // Default logger handle
+ h := lg.GetHandler()
+ // Sentry integrated logger handle
+ sentryHandle := log15.FuncHandler(func(r *log15.Record) error {
+ if r.Lvl == log15.LvlError {
+ msg := string(log15.JsonFormat().Format(r))
+ go func(m string) {
+ sentry.CaptureMessage(m)
+ }(msg)
+ }
+ return nil
+ })
+
+ lg.SetHandler(log15.MultiHandler(h, sentryHandle))
+
+ return lg
+}
+```
+### Usage
+```
+var log = NewLog("demo")
+
+log.Info(msg, "var1",var1,"var2",var2)
+log.Debug(msg, "var1",var1,"var2",var2)
+log.Warn(msg, "var1",var1,"var2",var2)
+log.Error(msg, "err",err,"var1",var1)
+```
+### Usage Guidelines
+#### Keep Content Concise
+Log messages must be concise and clear, avoiding irrelevant data that can significantly interfere with log analysis. For example, when logging transaction details, only print the necessary fields.
+#### Avoid Duplicate Output
+It's common to encounter duplicate log prints. For example:
+```
+func A() {
+ err := b()
+ if err != nil {
+ log.Error("b() failed","err",err)
+
+ }
+
+}
+
+func b() error {
+ _, err := strconv.Atoi("111")
+ if err != nil {
+ log.Error("strconv.Atoi("111")","err",err)
+ return err
+ }
+ return nil
+}
+
+```
+In this case, the error message is printed both in function A and function b, leading to unnecessary duplication. It's preferable to only log at the outermost function.
+#### Use the Correct Log Levels
+In log15, use Debug, Info, Warn, and Error for logging.
+1. Debug: Code debugging, outputting key information for program state judgment.
+2. Info: Print initialization data information when the program starts, and output information after key state changes.
+3. Warn: For errors that do not significantly impact the overall system operation but cannot be ignored, output through the warn level. For example, a periodic task reading from an external service fails for a specific iteration.
+4. Error: Any error affecting service operation must be output at the Error level.
+
+#### Declare Error Information
+Error information should be declared uniformly in error.go, using snake_case naming convention:
+```
+var ERR_INVALID_SIGNATURE = "err_invalid_signature"
+```
+
+## Coding Guidelines
+Refer to [Uber-go](https://github.com/xxjwxc/uber_go_guide_cn#uber-go-%E8%AF%AD%E8%A8%80%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83)
+
+### Additional Points
+- In demo.go, implement only three methods: New(), Run(), and Close() as a principle.
+- In .go files, only methods that need to be called by other files should have an uppercase first character.
+- Public methods in files should be written before private methods.
+ ```go
+ AA(){}
+ BB(){}
+ aa(){}
+ bb(){}
+ ```
+- Method names should follow camelCase and be concise.
+ ```go
+ bad:
+ UpdateBlockChainStableBlock(){}
+ Good:
+ UpdateStableBlock(){}
+ ```
+- Group parameters with the same properties together, and return values accordingly.
+ ```go
+ AA(ethRpc, moonRpc, cfxRpc string, db *Db) {}
+ ```
+- If an error is returned, place the error at the end of the return values.
+ ```go
+ AA(ethRpc, moonRpc, cfxRpc string, db *Db) (string,int,error) {}
+ ```
+- Avoid using pointer types for function parameters. If it's a slice or map, consider copying before passing.
+- Avoid using nested if-else structures; replace them with switch statements.
+- Avoid using closures since you cannot control how external variables called in closures change.
+ ```
+ bad:
+ for i:=0; i <10; i ++ {
+ go func() {
+ t.Log(i) // The 'i' in the closure changes with the for loop, and the final print is always 10.
+ }()
+ }
+ good:
+ for i:=0; i <10; i ++ {
+ go func(i int) { // Use deterministic parameter passing
+ t.Log(i)
+ }(i)
+ }
+ ```
+- When using `locker.Lock()`, immediately `defer locker.Unlock()`
+ ```go
+ bad:
+ func AA() {
+ locker.Lock()
+ ...
+ locker.UnLock()
+ }
+
+ good:
+ func AA() {
+ locker.Lock()
+ defer locker.UnLock()
+ ...
+ }
+ ```
+- Avoid using init() functions, as the loading order of init() functions is uncontrollable, and the logic in init() is not explicitly invoked. Place the logic in demo.go/New() or Run() instead.
+- When using slices or maps, specify the capacity during make to make append more efficient and save memory space during runtime.
+ ```go
+ tokenList := make([]severSchema.TokenInfo, 0, 50)
+ ```
+- Normally, avoid using buffered channels. If a buffered channel is necessary, provide a comment - explaining why the capacity is set to that value.
+When renaming imported packages, follow the principle of proximity. No need to rename within the same module, but other modules with naming conflicts should include the module name.
+ ```go
+ import (
+ confSchema "github.com/everFinance/everpay/config/schema" // config package
+ paySchema "github.com/everFinance/everpay/pay/schema" // pay package
+ "github.com/everFinance/everpay/server/schema" // current package
+ )
+ ```
+- API response results must use the struct form.
+ ```go
+ bad:
+ c.JSON(http.StatusOK, gin.H{
+ "total": total,
+ "txs": txs,
+ })
+
+ good:
+ c.JSON(http.StatusOK, schema.RespTxs{
+ Total: total,
+ Txs: txs,
+ })
+ ```
+- Declare integer types in code using int64.
+
diff --git a/golang/README_zh.md b/golang/README_zh.md
new file mode 100644
index 0000000..0444710
--- /dev/null
+++ b/golang/README_zh.md
@@ -0,0 +1,222 @@
+# Golang 代码规范
+## 项目结构
+```
+- cmd
+ - demo
+ - main.go // demo 项目启动入口
+- demo
+ - schema // type 声明
+ - db.go // db 相关的 type 声明
+ - api.go // api response type 声明
+ - error.go // error 信息
+ - other.go // 其他模块对应的 type 声明
+ - api.go // restful 接口实现
+ - demo.go // 入口函数
+ - jobs.go // 定时任务实现
+ - wdb.go // 关系型数据库读写方法实现
+ - cache.go // 缓存
+ - other.go // 独立的处理方法
+- example // 用例
+ - xxx.go
+- .drone.yml // ci/cd 配置文件
+- Dockerfile
+- README.md // demo 项目 readme
+- mod.go
+- Makefile // make all, make test
+- test.sh
+```
+[project-example](./project)
+### 基准
+- 每个 package 独立可用,对外接口尽量简洁,最好具备复用性
+- package 文件夹名称和里面的入口文件命名一致
+- 入口文件不宜有太多编码
+- 应将外部函数放在入口文件,业务自顶向下实现,入口能表现 package 的核心功能
+- 入口文件一般包含三个外部函数,分别是:New(), Run(), Close()
+- 提交代码之前必须运行 make all 和 make test 并通过之后才能提交
+- 命名风格参考之前的项目进行统一
+- cmd/main.go 中监听 signals 信号之后必须要调用 CLose() 进行安全退出
+
+## 通用三方库
+- cli: github.com/urfave/cli
+- api: github.com/gin-gonic/gin
+- job: github.com/go-co-op/gocron
+- log: github.com/inconshreveable/log15
+- test: github.com/stretchr/testify
+- json: github.com/tidwall/gjson
+- http-cli: gopkg.in/h2non/gentleman.v2
+- decimal library: github.com/shopspring/decimal
+- ethereumRPC: github.com/everFinance/ethrpc
+- ethereumSDK: github.com/everFinance/goether
+- arweaveSDK: github.com/everFinance/goar
+- web-framework: github.com/gin-gonic/gin
+- redis-cli: github.com/go-redis/redis
+- mysql-cli: gorm.io/gorm
+
+## 日志
+### 封装
+```
+func NewLog(serverName string) log15.Logger {
+ lg := log15.New("module", serverName)
+
+ // 默认的 logger handle
+ h := lg.GetHandler()
+ // 集成 sentry 的 logger handle
+ sentryHandle := log15.FuncHandler(func(r *log15.Record) error {
+ if r.Lvl == log15.LvlError {
+ msg := string(log15.JsonFormat().Format(r))
+ go func(m string) {
+ sentry.CaptureMessage(m)
+ }(msg)
+ }
+ return nil
+ })
+
+ lg.SetHandler(log15.MultiHandler(h, sentryHandle))
+
+ return lg
+}
+```
+### 使用
+```
+var log = NewLog("demo")
+
+log.Info(msg, "var1",var1,"var2",var2)
+log.Debug(msg, "var1",var1,"var2",var2)
+log.Warn(msg, "var1",var1,"var2",var2)
+log.Error(msg, "err",err,"var1",var1)
+```
+### 使用规范
+#### 内容简洁
+日志 msg 必须简洁明确,不相干数据严重干扰日志分析。比如在打印 tx 日志中,不要输出 tx 所有字段,只需要打印需要的字段。
+#### 重复输出
+在开发过程中,经常出现日志打印重复的情况。比如如下:
+```
+func A() {
+ err := b()
+ if err != nil {
+ log.Error("b() failed","err",err)
+
+ }
+
+}
+
+func b() error {
+ _, err := strconv.Atoi("111")
+ if err != nil {
+ log.Error("strconv.Atoi("111")","err",err)
+ return err
+ }
+ return nil
+}
+
+```
+b() 中打印过 err msg,但是 A() 中又会打印一次 b() 返回的error, 所以出现了重复打印的情况。这种情况严重干扰对日志的分析。
+正确的做法是在 b() 中不打印,只要在最外层调用函数中打印。
+#### 正确使用日志级别
+在 log5 中主要使用到 Debug, Info, Warn, Error 这四个级别来打印日志。
+1. Debug 使用场景
+ 代码调试、输出关键信息用于判断程序状态。
+2. Info 使用场景
+ 程序启动打印初始化数据信息、关键状态正常改变之后的信息输出。
+3. Warn 使用场景
+ 对系统整体运行影响不大但是不可忽略的错误,需要通过 warn 级别输出。比如读取外部服务的定时任务某次读取失败的情况。
+4. Error 使用场景
+ 服务出现 Error 并影响服务正常运行都必须使用 Error 级别输出。
+
+#### error 信息声明
+error 信息统一在 error.go 中声明,命名方式为蛇形命名法,如:
+```
+var ERR_INVALID_SIGNATURE = "err_invalid_signature"
+```
+
+## 编码规范
+参考 [Uber-go 规范](https://github.com/xxjwxc/uber_go_guide_cn#uber-go-%E8%AF%AD%E8%A8%80%E7%BC%96%E7%A0%81%E8%A7%84%E8%8C%83)
+
+### 补充
+- 在 demo.go 中原则上只实现三个方法 New(), Run(), Close()
+- 在 **.go 文件中,只有需要被其他文件调用的方法首字符才大写。
+- 文件中 public 方法统一写在 private 方法之前。
+ ```go
+ AA(){}
+ BB(){}
+ aa(){}
+ bb(){}
+ ```
+- 方法命令必须为驼峰,并且必须简洁
+ ```go
+ bad:
+ UpdateBlockChainStableBlock(){}
+ Good:
+ UpdateStableBlock(){}
+ ```
+- 相同属性的传参写到一起,返回值如此
+ ```go
+ AA(ethRpc, moonRpc, cfxRpc string, db *Db) {}
+ ```
+- 存在 error 返回值,error 写在返回值最后一位
+ ```go
+ AA(ethRpc, moonRpc, cfxRpc string, db *Db) (string,int,error) {}
+ ```
+- 函数参数避免指针类型。如果是 slice, map 传参之前可以 copy 一份
+- 避免使用多重 if- else if -else, 请替换成 switch
+- 不要使用闭包,因为你没法控制闭包中调用的外部变量是如何变化
+ ```
+ bad:
+ for i:=0; i <10; i ++ {
+ go func() {
+ t.Log(i) // 闭包中的 i 会随着 for 循环改变,最后打印的都是 10
+ }()
+ }
+ good:
+ for i:=0; i <10; i ++ {
+ go func(i int) { // 通过确定性的传参
+ t.Log(i)
+ }(i)
+ }
+ ```
+- 使用 locker.Lock() 之后必须立即声明 defer locker.Unlocker()
+ ```go
+ bad:
+ func AA() {
+ locker.Lock()
+ ...
+ locker.UnLock()
+ }
+
+ good:
+ func AA() {
+ locker.Lock()
+ defer locker.UnLock()
+ ...
+ }
+ ```
+- 尽量避免使用 init() 函数,因为加载 init() 函数中路径不可控,并且 init() 中逻辑不显式调用执行。请把 init() 中的处理放在 demo.go/New() 或者 Run() 中。
+- 使用 slice 或者 map,请在 make 的时候指定 cap, 这样 append 的时候会更高效以及节省代码运行时开辟的内存空间。
+ ```go
+ tokenList := make([]severSchema.TokenInfo, 0, 50)
+ ```
+- 正常情况下不会使用到缓冲 channel, 如果必须要使用缓冲 channel, 请备注好为什么 cap 设置为该值。
+- 需要重命名 import package 的时候需要遵循就近原则,本模块的不需要重命名,名字冲突的其他模块命名需要加上模块名。
+ ```go
+ import (
+ confSchema "github.com/everFinance/everpay/config/schema" // config 模块
+ paySchema "github.com/everFinance/everpay/pay/schema" // pay 模块
+ "github.com/everFinance/everpay/server/schema" // 同一模块
+ )
+ ```
+- api 返回结果必须使用 struct 形式
+ ```go
+ bad:
+ c.JSON(http.StatusOK, gin.H{
+ "total": total,
+ "txs": txs,
+ })
+
+ good:
+ c.JSON(http.StatusOK, schema.RespTxs{
+ Total: total,
+ Txs: txs,
+ })
+ ```
+- 代码中声明整数类型都使用 int64
+---
diff --git a/project/.drone.yml b/golang/project/.drone.yml
similarity index 100%
rename from project/.drone.yml
rename to golang/project/.drone.yml
diff --git a/project/Dockerfile b/golang/project/Dockerfile
similarity index 100%
rename from project/Dockerfile
rename to golang/project/Dockerfile
diff --git a/project/cmd/demo/main.go b/golang/project/cmd/demo/main.go
similarity index 100%
rename from project/cmd/demo/main.go
rename to golang/project/cmd/demo/main.go
diff --git a/project/demo/api.go b/golang/project/demo/api.go
similarity index 100%
rename from project/demo/api.go
rename to golang/project/demo/api.go
diff --git a/project/demo/demo.go b/golang/project/demo/demo.go
similarity index 100%
rename from project/demo/demo.go
rename to golang/project/demo/demo.go
diff --git a/project/demo/error.go b/golang/project/demo/error.go
similarity index 100%
rename from project/demo/error.go
rename to golang/project/demo/error.go
diff --git a/project/demo/jobs.go b/golang/project/demo/jobs.go
similarity index 100%
rename from project/demo/jobs.go
rename to golang/project/demo/jobs.go
diff --git a/project/demo/schema/db.go b/golang/project/demo/schema/db.go
similarity index 100%
rename from project/demo/schema/db.go
rename to golang/project/demo/schema/db.go
diff --git a/project/demo/wdb.go b/golang/project/demo/wdb.go
similarity index 100%
rename from project/demo/wdb.go
rename to golang/project/demo/wdb.go
diff --git a/project/example/demo.go b/golang/project/example/demo.go
similarity index 100%
rename from project/example/demo.go
rename to golang/project/example/demo.go
diff --git a/project/go.mod b/golang/project/go.mod
similarity index 100%
rename from project/go.mod
rename to golang/project/go.mod
diff --git a/project/test.sh b/golang/project/test.sh
similarity index 100%
rename from project/test.sh
rename to golang/project/test.sh
diff --git a/java/README_en.md b/java/README_en.md
new file mode 100644
index 0000000..c0cdf85
--- /dev/null
+++ b/java/README_en.md
@@ -0,0 +1,171 @@
+# java Code Guidelines
+## Project Structure
+```
+/project-root
+ /src
+ /main
+ /java
+ /com
+ /example
+ /demo
+ DemoApplication.java // spring boot entry point
+ /config // Configuration information
+ DemoConfig.java
+ /controller // Store controller class
+ StudentController.java
+ /service // Storage service class
+ StudentService.java
+ /mapper // Stores data access interfaces
+ StudentMapper.java
+ /entity // Stores table data objects
+ StudentDO.java
+ /model // Stores the data model classes
+ Student.java
+ /vo // Store view objects
+ StudentVO.java
+ /utils // Storage utility class
+ DemoUtil.java
+ /enums // Store enumeration class
+ DemoEnum.java
+ /resources
+ application.properties
+
+ /test // Store test code
+ /java
+ /com
+ /example
+ /controller
+ SampleControllerTest.java
+ /service
+ SampleServiceTest.java
+ /target // Build output directory
+ README.md // Documentation of the project
+ .gitignore // Git ignores file configuration
+ pom.xml // Maven project configuration file
+```
+[demo](./demo)
+
+If it is a small entrepreneurial project, we recommend using the single application in the demo or even serverless, lambda. For large java projects, we recommend the cola architecture shown in the following figure
+
+
+
+### Application Development Benchmarks
+- Hierarchical architecture, as shown in the figure above, the upper layer depends on the lower layer, and the lower layer shields the processing details of the upper layer, and each layer performs its own duties and separates the concerns
+- Don't add entities if you don't have to. Domain model has high requirements for design ability, and if it is not used well, a wrong abstraction is better than no abstraction
+- Do not rely on SNAPSHOT versions for online applications
+- When relying on a two-square library, a uniform version variable must be defined to avoid inconsistent version numbers
+- Keep code styles consistent within the same project
+- During system design, the system should rely on abstract classes and interfaces as much as possible according to the dependency inversion principle, which is conducive to expansion and maintenance
+
+### Framework Development Benchmark
+- Modular design, each module is responsible for relatively independent functions, such as network is responsible for network,exception module is responsible for exception processing
+- Consider scalability, abstract interfaces for important modules, provide plug-ins or SPI forms, and facilitate other developers to add extensions later
+- Design robust error handling mechanisms that provide meaningful error information for easy troubleshooting
+- Take into account that users may use different versions of Java and other related libraries to ensure that the framework can run properly in a variety of environments
+- Write adequate unit tests and integration tests to ensure that all parts of the framework are working properly
+- Provide development demo to reduce user access
+
+## Common Third-party Libraries
+- Application development framework: spring boot
+- Scheduled task: quartz
+- log: log4j2
+- test: mockito
+- arweave sdk: arseedingsdk4j-sdk
+- ethereum sdk: web3j
+- json: jackson
+- data source: druid
+- http: OkHttp
+- redis: jedis
+- config: nacos
+- MQ: rocketMQ
+- RPC: spring cloud
+
+## log
+The application cannot directly use the API in the log system (Log4j, Logback), but should rely on the API in the log framework SLF4J, and use the log framework in the facade mode, which is conducive to maintenance and the unity of log processing methods of each class
+
+```agsl
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+private static final Logger logger = LoggerFactory.getLogger(Test.class);
+```
+
+### 使用
+```agsl
+private static final Logger logger = LoggerFactory.getLogger(Test.class);
+
+// debug level
+logger.debug("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// info level
+logger.info("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// warn level
+logger.warn("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// error level
+logger.error(msg + "_" + e.getMessage(), e);
+```
+
+### Usage specification
+* All log files are saved for at least 15 days, because some exceptions have a "weekly" frequency
+* For log output at the trace/debug level, you must enable and disable the log level
+```agsl
+if (logger.isDebugEnabled()) {
+ logger.debug("Current ID is: {} and name is: {}", id, getName());
+}
+```
+* Avoid wasting disk space by printing logs repeatedly
+* Exception information should include two types of information: crime scene information and exception stack information
+* debug level logs cannot be output in the production environment. Output info level logs selectively
+* The warn level log can be used to record user input parameter errors to avoid user complaints
+* Try to describe log error messages in English
+
+#### Use log levels correctly
+In java, common log levels are from low to high: trace、debug、info、warn、error、fatal
+1. trace: The lowest level log is used to track the execution of the program. In general, it is only used in the debugging phase to output some detailed debugging information.
+
+2. debug: Output debugging information to help developers locate problems. In production environments, the debug level is generally not recommended because of the large amount of log output.
+
+3. info: info logs are used to output important running information, such as program startup information and the results of critical operations. Info logs are used in production environments to monitor the running status of programs.
+
+4. warn: Warning information indicates that there may be a potential problem in the program, but it does not affect the normal running of the program. For example, if the parameters of a method do not meet expectations, the program can continue to execute.
+
+5. error: Output an error message indicating that a recoverable error occurred in the program. When an error occurs in the program. Generally, logs of the error level are recorded and handled accordingly.
+
+6. fatal: Logs of the highest level are used to output fatal error messages. When an unrecoverable error occurs in the program, a fatal level log is logged and the execution of the program is terminated.
+
+In actual applications, you can set the log level as required. Normally, the development environment can be set to debug level and the production environment can be set to info level to avoid excessive log output
+
+## Coding Guidelines
+
+Refer to [alibaba java coding guidelines](https://github.com/alibaba/Alibaba-Java-Coding-Guidelines)
+
+alibaba java coding guidelines written very detailed, here to write some daily development often encounter the situation
+
+### Naming style
+
+- None of the names in the code can start with an underscore or dollar sign, nor can they end with an underscore or dollar sign
+- The naming in the code is strictly forbidden to use the combination of pinyin and English, and it is not allowed to directly use the Chinese way
+- The class name uses the UpperCamelCase style except for the following cases: DO/BO/DTO/VO/AO/PO, and so on
+- Method names, parameter names, member variables, and local variables use the lowerCamelCase style and must follow the hump form
+- Constant names are all uppercase, words are separated by underscores, and the semantic expression is complete and clear, and the name is not too long
+- The name of an Abstract class starts with abstract or Base; Exception class names end with exception; A Test class name starts with the name of the class it is testing and ends with test
+- Package names are all lowercase, with one and only one natural English word between dot separators. Package names are singular, but class names can be plural if they have plural meanings
+
+
+### Security protocol
+- The pages or functions that belong to the user must be checked for permission control
+- Sensitive user data is not allowed to be displayed directly, and display data must be desensitized
+- SQL parameters entered by users are strictly limited by parameter binding or METADATA field values, preventing SQL injection
+- The user requests that any parameters passed in must be validated
+
+### Database design
+- Table name Field names must use lowercase characters or numbers; Do not start with a digit or have only a digit between two underscores
+- Disable reserved words, such as desc, range, match, and delayed
+- Primary key index name pk_ field name; Unique index name uk_ field name; The common index name is the idx_ field name
+- The decimal type is decimal. float and double are prohibited
+- varchar is a variable length character string with a maximum length of 5000. If the stored length exceeds this value, use text and list it independently
+- Three required fields in the table are id, create_time, update_time
+- Do not use count(column name) or count(constant) instead of count(\*), count(*) is the syntax for the standard count of rows defined in SQL92, independent of the database, NULL and non-null
+- If all the values in a column are NULL, count(col) returns 0, but sum(col) returns NULL. Therefore, pay attention to NPE problems when using sum()
+ If the -in operation can be avoided, avoid it. If it cannot be avoided, carefully evaluate the number of set elements behind the in operation and control it within 1000
\ No newline at end of file
diff --git a/java/README_zh.md b/java/README_zh.md
new file mode 100644
index 0000000..3544d23
--- /dev/null
+++ b/java/README_zh.md
@@ -0,0 +1,168 @@
+# java 代码规范
+## 项目结构
+```
+/project-root
+ /src
+ /main
+ /java
+ /com
+ /example
+ /demo
+ DemoApplication.java // spring boot 启动入口
+ /config // 配置信息
+ DemoConfig.java
+ /controller // 存放控制器类
+ StudentController.java
+ /service // 存放服务类
+ StudentService.java
+ /mapper // 存放数据访问接口
+ StudentMapper.java
+ /entity // 存放数据表对象
+ StudentDO.java
+ /model // 存放数据模型类
+ Student.java
+ /vo // 存放展示对象
+ StudentVO.java
+ /utils // 存放工具类
+ DemoUtil.java
+ /enums // 存放枚举类
+ DemoEnum.java
+ /resources
+ application.properties
+
+ /test // 存放测试代码
+ /java
+ /com
+ /example
+ /controller
+ SampleControllerTest.java
+ /service
+ SampleServiceTest.java
+ /target // 构建输出目录
+ README.md // 项目的说明文档
+ .gitignore // Git忽略文件配置
+ pom.xml // Maven项目配置文件
+```
+[demo](./demo)
+
+如果是小型创业项目, 我们建议使用demo中的单体应用甚至serverless、lambda. 如果是大型java项目,我们建议下图中的cola架构(alibaba)
+
+
+
+### 应用开发基准
+- 分层架构,如上图,上层依赖下层,下层对上层屏蔽处理细节,每一层各司其职,分离关注点
+- 如无必要勿增实体. 领域模型对设计能力要求很高,没把握用好,一个错误的抽象还不如不抽象
+- 线上应用不要依赖 SNAPSHOT 版本
+- 依赖于一个二方库群时,必须定义一个统一的版本变量,避免版本号不一致
+- 同一个项目中代码风格保持一致
+- 系统设计时,根据依赖倒置原则,尽量依赖抽象类与接口,有利于扩展与维护
+
+### 框架开发基准
+- 模块化设计,每个模块要负责相对独立的功能,如network专门负责网络,exception模块专门负责异常处理
+- 考虑可扩展性,对重要模块抽象接口,提供插件或者SPI的形式,方便后续其他开发者添加扩展
+- 设计健壮的错误处理机制,提供有意义的错误信息,方便用户排查问题
+- 考虑到用户可能使用不同版本的Java和其他相关库,确保框架能够在多种环境下正常运行
+- 编写充分的单元测试和集成测试,确保框架的各个部分都能正常工作
+- 提供开发demo, 减低用户使用门槛
+
+## 通用三方库
+- 应用开发框架: spring boot
+- 定时任务: quartz
+- 日志: log4j2
+- 测试: mockito
+- arweave sdk: arseedingsdk4j-sdk
+- ethereum sdk: web3j
+- json: jackson
+- 数据源: druid
+- http: OkHttp
+- redis: jedis
+- 配置: nacos
+- MQ: rocketMQ
+- RPC: spring cloud
+
+## 日志
+应用中不可直接使用日志系统(Log4j、Logback)中的 API,而应依赖使用日志框架 SLF4J 中的 API,使用门面模式的日志框架,有利于维护和各个类的日志处理方式统一
+
+```agsl
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+private static final Logger logger = LoggerFactory.getLogger(Test.class);
+```
+
+### 使用
+```agsl
+private static final Logger logger = LoggerFactory.getLogger(Test.class);
+
+// debug level
+logger.debug("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// info level
+logger.info("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// warn level
+logger.warn("Processing trade with id: {} and symbol: {}", id, symbol);
+
+// error level
+logger.error(msg + "_" + e.getMessage(), e);
+```
+
+### 使用规范
+* 所有日志文件至少保存 15 天,因为有些异常具备以“周”为频次发生的特点
+* 对于 trace/debug 级别的日志输出,必须进行日志级别的开关判断
+```agsl
+if (logger.isDebugEnabled()) {
+ logger.debug("Current ID is: {} and name is: {}", id, getName());
+}
+```
+* 避免重复打印日志,浪费磁盘空间
+* 异常信息应该包括两类信息: 案发现场信息和异常堆栈信息
+* 生产环境禁止输出 debug 日志; 有选择地输出 info 日志
+* 可以使用 warn 日志级别来记录用户输入参数错误的情况,避免用户投诉时,无所适从
+* 尽量用英文来描述日志错误信息
+
+#### 正确使用日志级别
+在java中,常见的日志级别由低到高分别是trace、debug、info、warn、error和fatal
+1. trace: 最低级别的日志,用于追踪程序的执行过程. 一般情况下,只在调试阶段使用,用于输出一些详细的调试信息.
+
+2. debug: 用于输出调试信息,帮助开发人员定位问题. 在生产环境中,一般不建议使用debug级别,因为会产生大量的日志输出.
+
+3. info: 用于输出一些重要的运行信息,如程序启动信息,关键操作的结果等. info级别的日志通常在生产环境中使用,用于监控程序的运行状态.
+
+4. warn: 用于输出一些警告信息,表示程序可能存在潜在的问题,但不会影响程序的正常运行. 比如,某个方法的参数不符合预期,但程序仍然可以继续执行.
+
+5. error: 用于输出错误信息,表示程序发生了可恢复的错误. 当程序出现错误时.一般会记录error级别的日志,并进行相应的处理.
+
+6. fatal: 最高级别的日志,用于输出致命错误信息. 当程序发生无法恢复的错误时,会记录fatal级别的日志,并终止程序的执行.
+
+在实际应用中,可以根据具体需求设置日志级别。通常情况下,开发环境可以设置为debug级别,生产环境可以设置为info级别,以避免产生过多的日志输出
+
+## 编码规范
+参考 [阿里巴巴java开发规范](https://github.com/alibaba/Alibaba-Java-Coding-Guidelines)
+
+阿里巴巴java开发规范写的非常详细,这里写一些日常开发经常碰到的情况
+
+### 命名风格
+- 代码中的命名均不能以下划线或美元符号开始,也不能以下划线或美元符号结束
+- 代码中的命名严禁使用拼音与英文混合的方式,更不允许直接使用中文的方式
+- 类名使用UpperCamelCase风格,但以下情形例外:DO / BO / DTO / VO / AO / PO等
+- 方法名、参数名、成员变量、局部变量都统一使用lowerCamelCase风格,必须遵从驼峰形式
+- 常量命名全部大写,单词间用下划线隔开,力求语义表达完整清楚,不要嫌名字长
+- 抽象类命名使用Abstract或Base开头;异常类命名使用Exception结尾;测试类命名以它要测试的类名开始,以Test结尾
+- 包名统一使用小写,点分隔符之间有且仅有一个自然语义的英语单词。包名统一使用单数形式,但是类名如果有复数含义,类名可以使用复数形式
+
+### 安全规约
+- 隶属于用户个人的页面或者功能必须进行权限控制校验
+- 用户敏感数据禁止直接展示,必须对展示数据进行脱敏
+- 用户输入的 SQL 参数严格使用参数绑定或者 METADATA 字段值限定,防止 SQL 注入
+- 用户请求传入的任何参数必须做有效性验证
+
+### 数据库设计
+- 表名字段名必须使用小写字符或数字;禁止出现数字开头,禁止两个下划线之间只有数字
+- 禁用保留字,如desc、range、match、delayed等
+- 主键索引名为 pk_字段名;唯一索引名为 uk_字段名;普通索引名则为 idx_字段名
+- 小数类型为decimal,禁止使用float和double
+- varchar为变长字符串,长度不要超过5000,如果存储长度超过该值,使用text,并独立表出来
+- 表必备三字段:id, create_time, update_time
+- 不要使用count(列名)或count(常量)来替代count(\*),count(*)是SQL92定义的标 准统计行数的语法,跟数据库无关,跟NULL和非 NULL无关
+- 当某一列的值全是NULL时,count(col)的返回结果为0,但 sum(col)的返回结果为 NULL,因此使用sum()时需注意NPE问题
+- in操作能避免则避免,若实在避免不了,需要仔细评估 in后边的集合元素数量,控制在1000个之内
\ No newline at end of file
diff --git a/java/demo/.gitignore b/java/demo/.gitignore
new file mode 100644
index 0000000..549e00a
--- /dev/null
+++ b/java/demo/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/java/demo/pom.xml b/java/demo/pom.xml
new file mode 100644
index 0000000..cb918ac
--- /dev/null
+++ b/java/demo/pom.xml
@@ -0,0 +1,86 @@
+
+
this is a html page
+ + \ No newline at end of file diff --git a/java/demo/src/test/java/com/example/demo/DemoApplicationTest.java b/java/demo/src/test/java/com/example/demo/DemoApplicationTest.java new file mode 100644 index 0000000..e06a811 --- /dev/null +++ b/java/demo/src/test/java/com/example/demo/DemoApplicationTest.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTest { + + @Test + void contextLoads() { + } + +} diff --git a/java/img.png b/java/img.png new file mode 100644 index 0000000..e833219 Binary files /dev/null and b/java/img.png differ