first commit
This commit is contained in:
@@ -0,0 +1 @@
|
||||
target/
|
||||
@@ -0,0 +1,15 @@
|
||||
# brick-common-core
|
||||
|
||||
核心基础模块 —— 提供项目级常量与公共基类,所有其他 `brick-common-*` 模块均依赖此模块。
|
||||
|
||||
## 变体
|
||||
|
||||
| 分支 | 说明 |
|
||||
|------|------|
|
||||
| `master` | 主分支 |
|
||||
|
||||
## 使用
|
||||
|
||||
```bash
|
||||
brick add core
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
# brick-common-core 编码规范
|
||||
|
||||
## 职责边界
|
||||
|
||||
core 模块是项目的「底座」,提供所有模块共享的基础设施:
|
||||
|
||||
- 项目级常量(`BrickConstants`)
|
||||
- 公共异常基类
|
||||
- 通用工具类
|
||||
|
||||
core 模块**不包含**业务逻辑,不依赖其他业务模块。
|
||||
|
||||
## 使用准则
|
||||
|
||||
- 需要全项目共享的常量、工具,放在 core 模块。
|
||||
- 不要将仅单个模块使用的类放在 core——应放在对应模块内。
|
||||
|
||||
## 正例
|
||||
|
||||
```java
|
||||
// 通过 BrickConstants 引用公共常量
|
||||
String charset = BrickConstants.DEFAULT_CHARSET;
|
||||
```
|
||||
|
||||
## 反例
|
||||
|
||||
```java
|
||||
// 魔法字符串散落在各处
|
||||
byte[] bytes = str.getBytes("UTF-8");
|
||||
```
|
||||
@@ -0,0 +1,10 @@
|
||||
module: core
|
||||
summary: 核心基础模块,提供项目级常量与公共基类,所有其他模块均依赖此模块。
|
||||
dos:
|
||||
- 项目级常量统一通过 BrickConstants 访问,避免魔法值散落。
|
||||
- 公共基类、工具类放在 core 模块,供其他模块复用。
|
||||
donts:
|
||||
- 不要在 core 模块中引入具体业务逻辑。
|
||||
examples:
|
||||
- path: src/main/java/{{basePkgPath}}/core/BrickConstants.java
|
||||
note: 常量定义入口。
|
||||
@@ -0,0 +1,22 @@
|
||||
name: brick-common-core
|
||||
version: 0.0.0
|
||||
description: 核心基础模块,提供项目级常量与公共基类
|
||||
language: java
|
||||
defaultBranch: master
|
||||
module: core
|
||||
|
||||
variants:
|
||||
- branch: master
|
||||
label: master
|
||||
|
||||
variables:
|
||||
- name: basePackage
|
||||
required: true
|
||||
- name: projectName
|
||||
required: true
|
||||
- name: javaVersion
|
||||
required: true
|
||||
- name: groupId
|
||||
required: true
|
||||
|
||||
dependsOn: []
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.synoth.brick</groupId>
|
||||
<artifactId>brick-common-core</artifactId>
|
||||
<version>0.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.synoth.brick.core;
|
||||
|
||||
/**
|
||||
* 项目级常量定义。
|
||||
*/
|
||||
public final class BrickConstants {
|
||||
|
||||
private BrickConstants() {
|
||||
}
|
||||
|
||||
// TODO: 添加通用常量(如默认编码、日期格式等)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.synoth.brick.core.model;
|
||||
|
||||
/**
|
||||
* <p>标题:</p>
|
||||
* <p>描述:</p>
|
||||
* <p>版权:Copyright (c) 2026</p>
|
||||
* <p>公司:智业软件</p>
|
||||
*
|
||||
* @author yangzhaohan
|
||||
* @date 2026/6/22
|
||||
*/
|
||||
public class R {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>{{groupId}}</groupId>
|
||||
<artifactId>{{projectName}}-common-core</artifactId>
|
||||
<version>0.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<java.version>{{javaVersion}}</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,12 @@
|
||||
package {{basePackage}}.core;
|
||||
|
||||
/**
|
||||
* 项目级常量定义。
|
||||
*/
|
||||
public final class BrickConstants {
|
||||
|
||||
private BrickConstants() {
|
||||
}
|
||||
|
||||
// TODO: 添加通用常量(如默认编码、日期格式等)
|
||||
}
|
||||
Reference in New Issue
Block a user