Commit 1089fdc1 by HanDongdong

add test code for springMVC return json. And modify readme file.

parent 4696f00a
# cflowchart工程说明 # cflowchart工程说明
中科软本身平台中的流程图太难看,做了一个更难看的升级版 中科软本身平台中的流程图太难看,所以做了一个更难看的升级版
## 工程结构说明 ## STRUCTURE DESCRIPTION
* `src/main/config` 大部分配置文件所在目录 * `src/main/config` 大部分配置文件所在目录
* `src/main/java` JavaBean * `src/main/java` JavaBean
* `src/main/webapp/assets` WEB工程用到的所有资源文件(JS, CSS, 图片) * `src/main/webapp/assets` WEB工程用到的所有资源文件(JS, CSS, 图片)
> 因为中科软平台所使用的一些jar无法添加到maven中央/私有库中,所以只能在/webapp/WEB-INF/lib中添加jar文件
## CODING
### environment Required
* Jdk 1.8 or later
* Maven 3.x
* A network environment that can connect to *new platforms(sinoep)*
### How to package and run
``` shell
mvn clean compile #清理并重新编译工程
mvn jetty:run #使用jetty插件直接运行
mvn package #打包
```
\ No newline at end of file
...@@ -68,6 +68,16 @@ ...@@ -68,6 +68,16 @@
<version>3.1.0</version> <version>3.1.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.sinosoft.cflowchart.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.sinosoft.cflowchart.model.TestModel;
@Controller
public class ProcessorController {
@RequestMapping("/workflow/{flowId}")
public @ResponseBody TestModel getFlowById(@PathVariable String flowId) {
TestModel ret = new TestModel();
ret.setId("33ef05861acedd");
ret.setName("测试数据");
ret.setRemark("测试SpringMVC返回测试数据,flowId: " + flowId);
return ret;
}
}
package com.sinosoft.cflowchart.model;
public class TestModel {
private String id;
private String name;
private String remark;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment