forked from haixyyz/halo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c30cb
commit d1b53a0
Showing
209 changed files
with
8,772 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
target/ | ||
!.mvn/wrapper/maven-wrapper.jar | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
|
||
### BUILD ### | ||
nbproject/private/ | ||
build/ | ||
nbbuild/ | ||
dist/ | ||
nbdist/ | ||
bin/ | ||
doc/ | ||
target/ | ||
out/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# halo | ||
## halo | ||
Halo框架 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?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"> | ||
<parent> | ||
<groupId>org.xujin.halo</groupId> | ||
<artifactId>halo</artifactId> | ||
<version>1.0.4</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>halo-base</artifactId> | ||
<version>1.0.4</version> | ||
<name>halo-base</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.xujin.halo</groupId> | ||
<artifactId>halo-common</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.reflections</groupId> | ||
<artifactId>reflections</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
13 changes: 13 additions & 0 deletions
13
halo-base/src/main/java/org/xujin/halo/annotation/command/Command.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.xujin.halo.annotation.command; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@Inherited | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.TYPE}) | ||
@Component | ||
public @interface Command { | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
halo-base/src/main/java/org/xujin/halo/annotation/command/PostInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.xujin.halo.annotation.command; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@Inherited | ||
@Component | ||
@Target({ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface PostInterceptor { | ||
|
||
Class<? extends org.xujin.halo.dto.Command>[] commands() default {}; | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
halo-base/src/main/java/org/xujin/halo/annotation/command/PreInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.xujin.halo.annotation.command; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.annotation.*; | ||
|
||
@Inherited | ||
@Component | ||
@Target({ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface PreInterceptor { | ||
|
||
Class<? extends org.xujin.halo.dto.Command>[] commands() default {}; | ||
|
||
} |
38 changes: 38 additions & 0 deletions
38
halo-base/src/main/java/org/xujin/halo/annotation/domian/Domain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.xujin.halo.annotation.domian; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* 域描述注解 | ||
* @author xujin | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.TYPE}) | ||
@Inherited | ||
public @interface Domain { | ||
|
||
/** | ||
* 当前域的唯一code | ||
* @return | ||
*/ | ||
String code(); | ||
|
||
/** | ||
* 父域的唯一code | ||
* @return | ||
*/ | ||
String parentCode() default ""; | ||
|
||
/** | ||
* 当前域的名称 | ||
* @return | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* 当前域的描述 | ||
* @return | ||
*/ | ||
String desc() default ""; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
halo-base/src/main/java/org/xujin/halo/annotation/domian/DomainAbility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.xujin.halo.annotation.domian; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* 领域能力,用来描述领域实体的行为 | ||
* @author xujin | ||
* | ||
*/ | ||
@Inherited | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD}) | ||
@Component | ||
public @interface DomainAbility { | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
halo-base/src/main/java/org/xujin/halo/annotation/domian/DomainService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.xujin.halo.annotation.domian; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD}) | ||
public @interface DomainService { | ||
|
||
/** | ||
* 当前域的唯一编码 | ||
* @return | ||
*/ | ||
String code(); | ||
|
||
/** | ||
* 域服务的名称用于显示 | ||
* @return | ||
*/ | ||
String name(); | ||
|
||
/** | ||
* 当前域的描述 | ||
* @return | ||
*/ | ||
String desc() default ""; | ||
|
||
/** | ||
* 当前域服务的帮助url | ||
* @return | ||
*/ | ||
String helpUrl() default ""; | ||
|
||
/** | ||
* the domain ability codes | ||
* @return | ||
*/ | ||
String[] abilityCodes() default ""; | ||
|
||
|
||
} |
12 changes: 12 additions & 0 deletions
12
halo-base/src/main/java/org/xujin/halo/domain/DomainFactoryI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.xujin.halo.domain; | ||
|
||
/** | ||
* 领域工厂 | ||
* @author xujin | ||
* | ||
*/ | ||
public interface DomainFactoryI<T extends Entity> { | ||
|
||
T create(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.xujin.halo.domain; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
import java.util.Date; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
/** | ||
* 聚合内的实体 | ||
* This is the parent object of all domain objects | ||
* @author xujin | ||
*/ | ||
public abstract class Entity { | ||
|
||
/* | ||
* Entity 包含所有表都有的6个基础字段. | ||
*/ | ||
@Getter @Setter | ||
protected String id; | ||
@Getter @Setter | ||
protected Date gmtCreate; | ||
@Getter @Setter | ||
protected Date gmtModified; | ||
@Getter @Setter | ||
protected String creator; | ||
@Getter @Setter | ||
protected String modifier; | ||
@Getter @Setter | ||
protected String isDeleted; | ||
@Getter @Setter | ||
protected String tenantId;//租户ID | ||
@Getter @Setter | ||
protected String bizCode;//业务代码 | ||
|
||
/* | ||
* 扩展字段 | ||
*/ | ||
@Getter | ||
@Setter | ||
protected Map<String, Object> extValues = new ConcurrentHashMap<String, Object>(); | ||
|
||
public<T> T getExtField(String key){ | ||
if(extValues != null){ | ||
return (T)extValues.get(key); | ||
} | ||
return null; | ||
} | ||
|
||
public void putExtField(String fieldName, Object value){ | ||
this.extValues.put(fieldName, value); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
halo-base/src/main/java/org/xujin/halo/domain/ServiceI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.xujin.halo.domain; | ||
|
||
/** | ||
* 领域服务,继承自DomainServiceI的接口都认为是DomainAbility | ||
* @author xujin | ||
* | ||
*/ | ||
public interface ServiceI { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
halo-base/src/main/java/org/xujin/halo/domain/ValueObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.xujin.halo.domain; | ||
|
||
/** | ||
* 领域值对象 | ||
* @author xujin | ||
* | ||
*/ | ||
public interface ValueObject { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?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"> | ||
<parent> | ||
<groupId>org.xujin.halo</groupId> | ||
<artifactId>halo</artifactId> | ||
<version>1.0.4</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>halo-collection</artifactId> | ||
|
||
<name>halo-collection</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.xujin.halo</groupId> | ||
<artifactId>halo-base</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.reflections</groupId> | ||
<artifactId>reflections</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>attach-sources</id> | ||
<phase>verify</phase> | ||
<goals> | ||
<goal>jar-no-fork</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
Oops, something went wrong.