Exemplo n.º 1
0
 @RequestMapping(value = "/update")
 @AopLogModule(name = C.LOG_MODULE_PCRM, layer = C.LOG_LAYER_CONTROLLER)
 public @ResponseBody String saveOrUpdateSession(
     HttpServletRequest request, String appkey, String seller, String session) {
   String result = "false";
   System.out.println(appkey + ":" + seller + session);
   seller = seller.replace("cntaobao", "").split(":")[0];
   try {
     UserGetResponse resp = topService.getUserInfo(seller);
     if (resp.isSuccess()) {
       Long userid = resp.getUser().getUserId();
       result = String.valueOf(lkp.saveOrUpdateSession(userid, seller, appkey, session));
     } else System.out.println("error:" + resp.getSubMsg());
   } catch (ApiException e) {
     e.printStackTrace();
   }
   // request.setAttribute("result", result);
   return "result:" + result;
 }
Exemplo n.º 2
0
 public static void sms() {
   String url = "https://eco.taobao.com/router/rest";
   String appkey = "23377240";
   String secret = "ec63296b5e2886ed8d2fa7079fc8b583";
   String start = new Date().toString();
   TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
   AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
   //		req.setExtend( "extend" );
   req.setSmsType("normal");
   req.setSmsFreeSignName("方方测试");
   req.setSmsParamString(
       "{\"pwd\":\"1234\",\"startTime\":\"2016-06-01 \" ,\"endTime\":\"2016-07-01 \",\"msg\":\"退房时请保持室内清洁,谢谢 \"}");
   req.setRecNum("18910415779");
   req.setSmsTemplateCode("SMS_10200803");
   AlibabaAliqinFcSmsNumSendResponse rsp;
   try {
     rsp = client.execute(req);
     log.info(start + ">>fangfangtest>>    " + rsp.getBody());
   } catch (ApiException e) {
     e.printStackTrace();
   }
 }