Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareKing committed Jul 7, 2018
1 parent 46c30cb commit d1b53a0
Show file tree
Hide file tree
Showing 209 changed files with 8,772 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .gitignore
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# halo
## halo
Halo框架
59 changes: 59 additions & 0 deletions halo-base/pom.xml
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>
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 {

}
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 {};

}
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 {};

}
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 "";

}
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 {

}
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 halo-base/src/main/java/org/xujin/halo/domain/DomainFactoryI.java
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();

}
55 changes: 55 additions & 0 deletions halo-base/src/main/java/org/xujin/halo/domain/Entity.java
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 halo-base/src/main/java/org/xujin/halo/domain/ServiceI.java
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 halo-base/src/main/java/org/xujin/halo/domain/ValueObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.xujin.halo.domain;

/**
* 领域值对象
* @author xujin
*
*/
public interface ValueObject {

}
59 changes: 59 additions & 0 deletions halo-collection/pom.xml
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>
Loading

0 comments on commit d1b53a0

Please sign in to comment.