package com.xmomen.module.sms.util;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import com.xmomen.module.sms.model.IdentifyCodeModel;

public class GlobalIdentifyCodeManager {

	static Map<String, IdentifyCodeModel> identifyCodeCache = new ConcurrentHashMap<String, IdentifyCodeModel>();
	
	public static IdentifyCodeModel getIdentifyCode(String identifyCodeKey) {
		return identifyCodeCache.get(identifyCodeKey);
	}
	
	public static IdentifyCodeModel updateIdenfifyCode(String identifyCodeKey, String identifyCode) {
		IdentifyCodeModel identifyCodeModel = new IdentifyCodeModel(identifyCode);
		identifyCodeCache.put(identifyCodeKey, identifyCodeModel);
		return identifyCodeModel;
	}
}

@@ -98,16 +98,54 @@
 HashMap;
+%0Aimport java.util.concurrent.TimeUnit;
 %0A%0Aimport
@@ -650,16 +650,39 @@
 tifyCode
+, 15L, TimeUnit.MINUTES
 );%0A%09%09ide

设置短信验证码的有效时间为15分钟