浏览代码

引入ipu-cache替换wade-cache,使用ipu-cache的ICache替换ipu-server-web的ICache

weihf 6 年之前
父节点
当前提交
a0da43b40f

+ 8 - 4
display-server/pom.xml.boot

214
					</exclusion>
214
					</exclusion>
215
				</exclusions>
215
				</exclusions>
216
			</dependency>
216
			</dependency>
217
217
            <dependency>
218
			<groupId>com.ai.ipu</groupId>
219
			<artifactId>ipu-cache</artifactId>
220
			<version>${ipu}</version>
221
		    </dependency>
218
			<dependency>
222
			<dependency>
219
				<!-- 不推荐使用,推荐使用wade-mobile-data -->
223
				<!-- 不推荐使用,推荐使用wade-mobile-data -->
220
				<groupId>com.ai.wade</groupId>
224
				<groupId>com.ai.wade</groupId>
332
			<artifactId>ipu-file-system</artifactId>
336
			<artifactId>ipu-file-system</artifactId>
333
		</dependency>
337
		</dependency>
334
		<dependency>
338
		<dependency>
335
			<groupId>com.ai.wade</groupId>
336
			<artifactId>wade-data</artifactId>
339
			<groupId>com.ai.ipu</groupId>
340
			<artifactId>ipu-cache</artifactId>
337
		</dependency>
341
		</dependency>
338
		<dependency>
342
		<dependency>
339
			<groupId>com.ai.wade</groupId>
343
			<groupId>com.ai.wade</groupId>
340
			<artifactId>wade-cache</artifactId>
344
			<artifactId>wade-data</artifactId>
341
		</dependency>
345
		</dependency>
342
		<dependency>
346
		<dependency>
343
			<groupId>com.ai.wade</groupId>
347
			<groupId>com.ai.wade</groupId>

+ 7 - 2
display-server/pom.xml.tomcat

79
			<artifactId>ipu-file-system</artifactId>
79
			<artifactId>ipu-file-system</artifactId>
80
		</dependency>
80
		</dependency>
81
		<dependency>
81
		<dependency>
82
			    <groupId>com.ai.ipu</groupId>
83
			    <artifactId>ipu-cache</artifactId>
84
			    <version>${ipu}</version>
85
		    </dependency>
86
		<dependency>
82
			<groupId>com.ai.wade</groupId>
87
			<groupId>com.ai.wade</groupId>
83
			<artifactId>wade-data</artifactId>
88
			<artifactId>wade-data</artifactId>
84
		</dependency>
89
		</dependency>
85
		<dependency>
90
		<!--<dependency>
86
			<groupId>com.ai.wade</groupId>
91
			<groupId>com.ai.wade</groupId>
87
			<artifactId>wade-cache</artifactId>
92
			<artifactId>wade-cache</artifactId>
88
		</dependency>
93
		</dependency>-->
89
		<dependency>
94
		<dependency>
90
			<groupId>com.ai.wade</groupId>
95
			<groupId>com.ai.wade</groupId>
91
			<artifactId>wade-database</artifactId>
96
			<artifactId>wade-database</artifactId>

+ 2 - 2
display-server/src/main/java/com/ai/server/bean/LoginBean.java

3
import java.util.Map;
3
import java.util.Map;
4
import java.util.concurrent.ConcurrentHashMap;
4
import java.util.concurrent.ConcurrentHashMap;
5

5

6
import com.ai.ipu.server.cache.intf.ICache;
6
import com.ai.ipu.cache.ICache;
7
import com.ai.ipu.server.frame.session.ISession;
7
import com.ai.ipu.server.frame.session.ISession;
8
import com.ai.ipu.server.util.MobileUtility;
8
import com.ai.ipu.server.util.MobileUtility;
9
import com.ai.server.core.bean.IpuAppBean;
9
import com.ai.server.core.bean.IpuAppBean;
24
			String account = param.getString("ACCOUNT");
24
			String account = param.getString("ACCOUNT");
25
			String sessionId = uniqueAccounts.get(account);
25
			String sessionId = uniqueAccounts.get(account);
26
			
26
			
27
			ICache cache = IpuSessionManager.getSessionCache();
27
			ICache cache = IpuSessionManager.getInstance().getSessionCache();
28
			ISession session = (ISession)cache.get(sessionId);
28
			ISession session = (ISession)cache.get(sessionId);
29
			if (sessionId != null && session != null) {
29
			if (sessionId != null && session != null) {
30
				cache.remove(sessionId);//删除旧的Session
30
				cache.remove(sessionId);//删除旧的Session

+ 3 - 4
display-server/src/main/java/com/ai/server/bean/SceneBean.java

5
import java.util.Random;
5
import java.util.Random;
6
import java.util.concurrent.ConcurrentHashMap;
6
import java.util.concurrent.ConcurrentHashMap;
7

7

8
import com.ai.ipu.server.cache.intf.ICache;
8
import com.ai.ipu.cache.ICache;
9
import com.ai.ipu.server.frame.session.ISession;
9
import com.ai.ipu.server.frame.session.ISession;
10
import com.ai.ipu.server.frame.session.impl.AbstractSessionManager;
11
import com.ai.ipu.server.util.MobileUtility;
10
import com.ai.ipu.server.util.MobileUtility;
12
import com.ai.server.core.bean.IpuAppBean;
11
import com.ai.server.core.bean.IpuAppBean;
13
import com.ai.server.core.context.IpuContextData;
12
import com.ai.server.core.context.IpuContextData;
30
        if (loginResult) {
29
        if (loginResult) {
31
            String account = param.getString("ACCOUNT");
30
            String account = param.getString("ACCOUNT");
32
            String sessionIdOld = uniqueAccounts.get(account);
31
            String sessionIdOld = uniqueAccounts.get(account);
33
            ICache cache = AbstractSessionManager.getSessionCache();
32
            ICache cache = IpuSessionManager.getInstance().getSessionCache();
34
            ISession session = (ISession) cache.get(sessionIdOld);
33
            ISession session = (ISession) cache.get(sessionIdOld);
35
            if (sessionIdOld != null && session != null) {
34
            if (sessionIdOld != null && session != null) {
36
                cache.remove(sessionIdOld);// 删除旧的session
35
                cache.remove(sessionIdOld);// 删除旧的session
53
    public IData checkSessionAvailable(IData param) throws Exception {
52
    public IData checkSessionAvailable(IData param) throws Exception {
54
        IData result = new DataMap();
53
        IData result = new DataMap();
55
        String sessionId = param.getString(Constant.Session.SESSION_ID);
54
        String sessionId = param.getString(Constant.Session.SESSION_ID);
56
        ICache cache = AbstractSessionManager.getSessionCache();
55
        ICache cache = IpuSessionManager.getInstance().getSessionCache();
57
        ISession session = (ISession) cache.get(sessionId);
56
        ISession session = (ISession) cache.get(sessionId);
58
        if (sessionId != null && session != null) {
57
        if (sessionId != null && session != null) {
59
            result.put("sessionAvailable", true);
58
            result.put("sessionAvailable", true);