b45f5d56bb5ca2aca649f34079d8a8255a56b380.svn-base 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package com.chinacreator.videoalliance.order.process;
  2. import java.io.UnsupportedEncodingException;
  3. import java.util.HashMap;
  4. import java.util.Map;
  5. import org.springframework.stereotype.Component;
  6. import com.chinacreator.common.exception.BusinessException;
  7. import com.chinacreator.common.util.AESUtil;
  8. import com.chinacreator.videoalliance.order.bean.ExperienceOrderLog;
  9. import com.chinacreator.videoalliance.order.bean.ExperienceProductBean;
  10. import com.google.gson.Gson;
  11. import com.google.gson.GsonBuilder;
  12. import com.google.gson.reflect.TypeToken;
  13. @Component
  14. public abstract class AbstractExperienceOrder {
  15. protected Map<String,String> decodeMapAES(String content,String key) throws UnsupportedEncodingException, BusinessException{
  16. String result = AESUtil.decrypt(content, key);
  17. Gson gson = new GsonBuilder().disableHtmlEscaping().serializeNulls().create();
  18. HashMap<String, String> map = gson.fromJson(result, new TypeToken<HashMap<String, String>>(){}.getType());
  19. return map;
  20. }
  21. public String encodeAES(String content,String key) throws UnsupportedEncodingException, BusinessException{
  22. return AESUtil.encrypt(content, key);
  23. }
  24. public abstract Map<String, String> order(ExperienceProductBean experienceProductBean, String userid,
  25. String orderNum, String effecttime, ExperienceOrderLog logbean) throws Exception;
  26. //tlj add ( String effecttime,)
  27. }