-
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
zhy2002
committed
May 29, 2016
1 parent
498cc7e
commit 65dc579
Showing
23 changed files
with
298 additions
and
22 deletions.
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
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,29 @@ | ||
<?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> | ||
<artifactId>spring-boot-angular2</artifactId> | ||
<groupId>zhy2002</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>sba2-core</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>zhy2002</groupId> | ||
<artifactId>sba2-domain</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>zhy2002</groupId> | ||
<artifactId>sba2-dto</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>zhy2002</groupId> | ||
<artifactId>sba2-workflow</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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,7 @@ | ||
package zhy2002.sba2.core; | ||
|
||
/** | ||
* Created by ZHY on 30/04/2016. | ||
*/ | ||
public class ActionCommand { | ||
} |
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,7 @@ | ||
package zhy2002.sba2.core; | ||
|
||
/** | ||
* Created by ZHY on 30/04/2016. | ||
*/ | ||
public class ActionResult { | ||
} |
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,22 @@ | ||
package zhy2002.sba2.core; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import zhy2002.sba2.domain.security.User; | ||
|
||
/** | ||
* A singleton class used to process requests. | ||
*/ | ||
public class Engine { | ||
|
||
@Autowired | ||
private EngineEnvironment engineEnvironment; | ||
|
||
public QueryResult query(User user, QueryCommand queryCommand) { | ||
//todo implement | ||
return null; | ||
} | ||
|
||
public ActionResult execute(User user, ActionCommand actionCommand) { | ||
return null; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
sba2-core/src/main/java/zhy2002/sba2/core/EngineEnvironment.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,9 @@ | ||
package zhy2002.sba2.core; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* Defines the environment the engine needs to run. | ||
*/ | ||
public interface EngineEnvironment { | ||
} |
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,7 @@ | ||
package zhy2002.sba2.core; | ||
|
||
/** | ||
* Created by ZHY on 30/04/2016. | ||
*/ | ||
public class QueryCommand { | ||
} |
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,7 @@ | ||
package zhy2002.sba2.core; | ||
|
||
/** | ||
* Created by ZHY on 30/04/2016. | ||
*/ | ||
public class QueryResult { | ||
} |
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
12 changes: 12 additions & 0 deletions
12
sba2-domain/src/main/java/zhy2002/sba2/domain/data/AtomicDataField.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 zhy2002.sba2.domain.data; | ||
|
||
/** | ||
* Created by ZHY on 25/04/2016. | ||
*/ | ||
public class AtomicDataField extends DataField { | ||
|
||
private String atomicListTypeName; | ||
private String defaultValueProviderName; | ||
|
||
|
||
} |
2 changes: 1 addition & 1 deletion
2
...hy2002/sba2/domain/AtomicTypeFactory.java → ...2/sba2/domain/data/AtomicTypeFactory.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
9 changes: 9 additions & 0 deletions
9
sba2-domain/src/main/java/zhy2002/sba2/domain/data/DataField.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,9 @@ | ||
package zhy2002.sba2.domain.data; | ||
|
||
/** | ||
* Created by ZHY on 25/04/2016. | ||
*/ | ||
public abstract class DataField { | ||
private DataFieldId id; | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
sba2-domain/src/main/java/zhy2002/sba2/domain/data/DataFieldId.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,29 @@ | ||
package zhy2002.sba2.domain.data; | ||
|
||
import javax.persistence.Embeddable; | ||
|
||
/** | ||
* Created by ZHY on 26/04/2016. | ||
*/ | ||
@Embeddable | ||
public class DataFieldId { | ||
private Long id; | ||
private Integer version; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Integer getVersion() { | ||
return version; | ||
} | ||
|
||
public void setVersion(Integer version) { | ||
this.version = version; | ||
} | ||
} | ||
|
11 changes: 11 additions & 0 deletions
11
sba2-domain/src/main/java/zhy2002/sba2/domain/data/DataObjectInstance.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,11 @@ | ||
package zhy2002.sba2.domain.data; | ||
|
||
/** | ||
* Created by ZHY on 26/04/2016. | ||
*/ | ||
public class DataObjectInstance { | ||
|
||
private DataObjectType dataObject; | ||
private String dataJson; | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
sba2-domain/src/main/java/zhy2002/sba2/domain/data/DataObjectSlot.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 zhy2002.sba2.domain.data; | ||
|
||
/** | ||
* Created by ZHY on 25/04/2016. | ||
*/ | ||
public class DataObjectSlot { | ||
|
||
private DataField dataField; | ||
private Integer minCount; | ||
private Integer maxCount; | ||
private Boolean allowDuplicates; | ||
} |
11 changes: 11 additions & 0 deletions
11
sba2-domain/src/main/java/zhy2002/sba2/domain/data/DataObjectType.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,11 @@ | ||
package zhy2002.sba2.domain.data; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Created by ZHY on 25/04/2016. | ||
*/ | ||
public class DataObjectType extends DataField{ | ||
|
||
private List<DataObjectSlot> slots; | ||
} |
7 changes: 7 additions & 0 deletions
7
sba2-domain/src/main/java/zhy2002/sba2/domain/security/User.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,7 @@ | ||
package zhy2002.sba2.domain.security; | ||
|
||
/** | ||
* Created by ZHY on 30/04/2016. | ||
*/ | ||
public class User { | ||
} |
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
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
31 changes: 31 additions & 0 deletions
31
sba2-web/src/main/java/zhy2002/sba2/web/mvc/controller/TestController.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,31 @@ | ||
package zhy2002.sba2.web.mvc.controller; | ||
|
||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* A controller used for testing purpose. | ||
*/ | ||
@RestController | ||
@RequestMapping("/test") | ||
public class TestController { | ||
|
||
@RequestMapping("/hello") | ||
public String home() { | ||
return "Spring Boot says hello!"; | ||
} | ||
|
||
@RequestMapping("/data") | ||
public Object home2() { | ||
String[] array = {"value1", "value2"}; | ||
return array; | ||
} | ||
|
||
@RequestMapping("/params") | ||
public Object param(@RequestBody Map<String, Object> params) { | ||
return new Object[] {"result is:", params}; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
sba2-web/src/main/java/zhy2002/sba2/web/rest/EngineApiController.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,39 @@ | ||
package zhy2002.sba2.web.rest; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import zhy2002.sba2.core.Engine; | ||
import zhy2002.sba2.domain.security.User; | ||
import zhy2002.sba2.core.ActionCommand; | ||
import zhy2002.sba2.core.ActionResult; | ||
import zhy2002.sba2.core.QueryCommand; | ||
import zhy2002.sba2.core.QueryResult; | ||
|
||
/** | ||
* This controller expose the engine functionality as web api. | ||
*/ | ||
@RestController | ||
@RequestMapping("/api") | ||
public class EngineApiController { | ||
|
||
@Autowired | ||
private Engine engine; | ||
|
||
@Autowired | ||
private User user; | ||
|
||
@RequestMapping(path = "/query", method = RequestMethod.POST) | ||
public QueryResult query(QueryCommand queryCommand) { | ||
return engine.query(user, queryCommand); | ||
} | ||
|
||
@RequestMapping(path = "/execute", method = RequestMethod.POST) | ||
public ActionResult execute(ActionCommand actionCommand) { | ||
return engine.execute(user, actionCommand); | ||
} | ||
|
||
//todo handle exceptions | ||
|
||
} |
17 changes: 0 additions & 17 deletions
17
sba2-web/src/main/java/zhy2002/sba2/webapp/controller/TestController.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.