浏览代码

优化IpuContextData上下文对象逻辑处理。
精简msgframe的依赖包引入方式

huangbo 6 年之前
父节点
当前提交
b4db991651

+ 6 - 22
ipu-rest-demo/pom.xml

@ -27,21 +27,11 @@
27 27
				<updatePolicy>always</updatePolicy>
28 28
			</snapshots>
29 29
		</repository>
30
		<!-- AFI私服,内网私服 -->
31
		<repository>
32
			<id>aif_group</id>
33
			<url>http://10.11.20.81:8080/nexus/content/groups/aif_group/</url>
34
		</repository>
35
		<repository>
36
			<id>msgframe</id>
37
			<name>msgframe</name>
38
			<url>http://10.11.20.81:8080/nexus/content/repositories/msgframe/</url>
39
		</repository>
40 30
	</repositories>
41 31
42 32
	<properties>
43 33
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
44
		<msgframe>2.0.0</msgframe>
34
		<msgframe>1.9.2</msgframe>
45 35
	</properties>
46 36
47 37
	<dependencies>
@ -73,7 +63,7 @@
73 63
			<groupId>com.ai.ipu</groupId>
74 64
			<artifactId>ipu-server-web</artifactId>
75 65
		</dependency>
76
	
66
		<!-- dubbo相关依赖 -->
77 67
		<dependency>
78 68
			<groupId>com.alibaba</groupId>
79 69
			<artifactId>dubbo</artifactId>
@ -86,18 +76,12 @@
86 76
		    <groupId>com.netflix.curator</groupId>
87 77
		    <artifactId>curator-framework</artifactId>
88 78
		</dependency>
89
		
90 79
		<!-- msgframe相关依赖 -->
91 80
		<dependency>
92
			<groupId>msgframe</groupId>
93
			<artifactId>msgframe-client</artifactId>
94
			<version>${msgframe}</version>
95
		</dependency>
96
		<dependency>
97
			<groupId>msgframe</groupId>
98
			<artifactId>msgframe-common</artifactId>
99
			<version>${msgframe}</version>
100
		</dependency>
81
			<groupId>com.ai.aif.msgframe</groupId>
82
  			<artifactId>msgframe-client</artifactId>
83
  			<version>1.9.2</version>
84
  		</dependency>
101 85
	</dependencies>
102 86
103 87
	<build>

+ 65 - 0
ipu-rest-demo/src/main/java/com/ai/ipu/server/demo/control/data/ContextDataController.java

@ -0,0 +1,65 @@
1
package com.ai.ipu.server.demo.control.data;
2

3
import java.util.Iterator;
4

5
import org.springframework.stereotype.Controller;
6
import org.springframework.web.bind.annotation.RequestMapping;
7
import org.springframework.web.bind.annotation.ResponseBody;
8

9
import com.ai.ipu.restful.frame.context.IpuContextData;
10
import com.ai.ipu.restful.web.ServletManager;
11
import com.ailk.common.data.IData;
12
import com.ailk.common.data.impl.DataMap;
13

14
/**
15
 * @author huangbo@asiainfo.com
16
 * @team IPU
17
 * @date 2018年11月7日下午11:36:42
18
 * @desc 上下文使用范例
19
 */
20
@Controller
21
@RequestMapping("/context")
22
public class ContextDataController {
23
    
24
    @ResponseBody
25
    @RequestMapping("/create")
26
    public IData createContext(IData param) {
27
        // TODO Auto-generated method stub
28
        IpuContextData ipuContextData = new IpuContextData();
29
        Iterator<String> it = param.keySet().iterator();
30
        String key;
31
        while(it.hasNext()){
32
            key = it.next();
33
            ipuContextData.put(key, param.get(key).toString());
34
        }
35
        ServletManager.storageContextData(ipuContextData);
36
        IData result = new DataMap();
37
        result.put("msg", "上下文创建成功");
38
        return result;
39
    }
40
    
41
    @ResponseBody
42
    @RequestMapping("/update")
43
    public IData updateContext(IData param) {
44
        IpuContextData ipuContextData = ServletManager.getContextData();
45
        Iterator<String> it = param.keySet().iterator();
46
        String key;
47
        while(it.hasNext()){
48
            key = it.next();
49
            ipuContextData.put(key, param.get(key).toString());
50
        }
51
        
52
        IData result = new DataMap();
53
        result.put("msg", "上下文修改成功");
54
        return result;
55
    }
56
    
57
    @ResponseBody
58
    @RequestMapping("/get")
59
    public IData getContext(IData params) {
60
        IpuContextData ipuContextData = ServletManager.getContextData();
61
        IData result = new DataMap();
62
        result.put("context", ipuContextData.toString());
63
        return result;
64
    }
65
}

+ 1 - 51
ipu-service-demo/pom.xml

@ -32,7 +32,7 @@
32 32
	<properties>
33 33
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34 34
		<ipu>3.0-SNAPSHOT</ipu>
35
		<!-- <msgframe>2.0.0</msgframe> -->
35
		<msgframe>1.9.2</msgframe>
36 36
	</properties>
37 37
38 38
	<dependencies>
@ -50,60 +50,10 @@
50 50
			<artifactId>wade-mobile-data</artifactId>
51 51
		</dependency>
52 52
		<!-- msgframe相关依赖 -->
53
		<!-- <dependency>
54
		  <groupId>com.ai.aif.msgframe</groupId>
55
		  <artifactId>msgframe-common</artifactId>
56
		  <version>${msgframe}</version>
57
		</dependency>
58
		<dependency>
59
		  <groupId>com.ai.aif.msgframe</groupId>
60
		  <artifactId>msgframe-client</artifactId>
61
		  <version>${msgframe}</version>
62
		</dependency>
63 53
		<dependency>
64 54
		  <groupId>com.ai.aif.msgframe</groupId>
65 55
		  <artifactId>msgframe-server</artifactId>
66 56
		  <version>${msgframe}</version>
67 57
		</dependency>
68
		<dependency>
69
		  <groupId>com.ai.aif.msgframe</groupId>
70
		  <artifactId>xmlmsgframe</artifactId>
71
		  <version>2.6.4</version>
72
		</dependency>
73
		<dependency>
74
		    <groupId>org.apache.xmlbeans</groupId>
75
		    <artifactId>xmlbeans</artifactId>
76
		    <version>2.6.0</version>
77
		</dependency>
78
		<dependency>
79
    		<groupId>com.rabbitmq</groupId>
80
   			<artifactId>amqp-client</artifactId>
81
    		<version>3.6.5</version>
82
		</dependency>
83
		<dependency>
84
		  <groupId>com.alibaba</groupId>
85
		  <artifactId>fastjson</artifactId>
86
		  <version>1.1.46</version>
87
		</dependency>
88
		<dependency>
89
		  <groupId>org.hamcrest</groupId>
90
		  <artifactId>hamcrest-core</artifactId>
91
		  <version>1.3</version>
92
		</dependency>
93
		<dependency>
94
		  <groupId>org.apache.kafka</groupId>
95
		  <artifactId>kafka-clients</artifactId>
96
		  <version>0.10.2.0</version>
97
		</dependency>
98
		<dependency>
99
		  <groupId>log4j</groupId>
100
		  <artifactId>log4j</artifactId>
101
		  <version>1.2.12</version>
102
		</dependency>
103
		<dependency>
104
   			<groupId>com.alibaba.rocketmq</groupId>
105
    		<artifactId>rocketmq-client</artifactId>
106
    		<version>3.5.9</version>
107
		</dependency> -->
108 58
	</dependencies>
109 59
</project>