| | |
| | | String openUid = data.optString("taobao_open_uid");
|
| | | String taoBaoUid = data.optString("taobao_user_id");
|
| | | String nickName = data.optString("taobao_user_nick");
|
| | |
|
| | | try {
|
| | | nickName = URLDecoder.decode(nickName, "UTF-8");
|
| | | } catch (Exception e) {
|
| | | }
|
| | | // LogHelper.test("uid:" + uid + "\n accessToken:" + accessToken);
|
| | |
|
| | | // 获取渠道ID与会员ID
|
| | |
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | try {
|
| | | userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid,nickName, true);
|
| | | userExtraTaoBaoInfoService.addRelationId(uid, relationId, taoBaoUid, nickName, true);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | errCode = 5;
|
| | | }
|
| | | } else if ("zigou".equalsIgnoreCase(source)) {
|
| | | } else if ("zigou".equalsIgnoreCase(source)) {
|
| | | String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | |
| | |
|
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | LogHelper.test(uid + "会员备案失败");
|
| | | try {
|
| | |
| | | errCode = 5;
|
| | | }
|
| | | } else if ("bind".equalsIgnoreCase(source)) {
|
| | | |
| | |
|
| | | boolean bindInfo = true;
|
| | | // 绑定淘宝:V1.5.3
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | if (StringUtil.isNullOrEmpty(relationId)) {
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | bindInfo = false;
|
| | | }
|
| | | |
| | |
|
| | | String specialId = null;
|
| | | if(bindInfo) {
|
| | | if (bindInfo) {
|
| | | specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (StringUtil.isNullOrEmpty(specialId)) {
|
| | |
| | | bindInfo = false;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (!bindInfo) {
|
| | | errCode = 5;// 信息获取不全
|
| | | } else {
|
| | | try {
|
| | | userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName, true);
|
| | | userExtraTaoBaoInfoService.saveUserTaoBaoInfo(uid, relationId, specialId, taoBaoUid, nickName,
|
| | | true);
|
| | | } catch (UserExtraTaoBaoInfoException e) {
|
| | | LogHelper.test(e.getMsg());
|
| | | errCode = 6;
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(nickName))
|
| | | try {
|
| | |
| | | record.setTaoBaoUserNick(nickName);
|
| | | record.setCreateTime(new Date());
|
| | | taoBaoUnionAuthRecordService.addAuthRecord(record);
|
| | | |
| | |
|
| | | } catch (Exception e) {
|
| | | errCode = 4;
|
| | | try {
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.ShareGoodsException;
|
| | | import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
|
| | | import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.cache.TaoBaoGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | if (StringUtil.isNullOrEmpty(text))
|
| | | text = configService.get("goods_share_text_nocoupon");
|
| | | shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle()).replace("{商品原价}",
|
| | | taoBaoLink.getGoods().getZkPrice() + "");
|
| | | MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "");
|
| | | } else// 有券
|
| | | {
|
| | | String text = shareGoodsTextTemplateService.geteCouponTemplate(uid);
|
| | |
| | | text = configService.get("goods_share_text_coupon");
|
| | |
|
| | | shareText = text.replace("{标题}", taoBaoLink.getGoods().getTitle())
|
| | | .replace("{商品原价}", taoBaoLink.getGoods().getZkPrice() + "")
|
| | | .replace("{商品原价}", MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getZkPrice()) + "")
|
| | | .replace("{优惠券面额}",
|
| | | BigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
|
| | | MoneyBigDecimalUtil.getWithNoZera(taoBaoLink.getGoods().getCouponAmount()).toString())
|
| | | .replace("{优惠券价}", TaoBaoUtil.getAfterUseCouplePrice(taoBaoLink.getGoods()) + "");
|
| | | }
|
| | | shareText = shareText.replace("{店铺类型}", shopType)
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, hasCoupon);
|
| | | // 查询是否有分享
|
| | | UserShareGoodsHistory userShareHistory = shareGoodsService.getShareGoodsHistory(uid, goods.getAuctionId());
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goods.getAuctionId() + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | String token = "";
|
| | | if (userShareHistory != null) {
|
| | | token = userShareHistory.getTkCode();
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(token)) {
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAdzoneId(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setPid(TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT);
|
| | | TaoBaoGoodsBrief goodsLink = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | if (goodsLink != null)
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(),
|
| | | StringUtil.isNullOrEmpty(goodsLink.getCouponLink()) ? goodsLink.getAuctionUrl()
|
| | | : goodsLink.getCouponLink());
|
| | | }
|
| | | String content = shareGoodsTextTemplateService.createContentByTemplate(template, uid, goods, token, shortLink,
|
| | | hasCoupon);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("content", content);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | * @param page
|
| | | * @param uid
|
| | | * @param state
|
| | | * 状态:0全部 1-未到账 2-已到账 3-已失效 4已收货
|
| | | * 状态:0全部 1-未到账 2-已到账 3-已失效 4已收货
|
| | | * @param type
|
| | | * 类型:1-返利订单 2-分享订单 3-邀请订单
|
| | | * @param orderState
|
| | |
| | | orderState = state; // 已收货状态
|
| | | state = null; // 清空
|
| | | }
|
| | | |
| | |
|
| | | if (type != null && type == 0) {
|
| | | type = null; // 所有类型订单
|
| | | }
|
| | |
| | | try {
|
| | | orderId = DESUtil.decode(orderData, StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | if (orderId != null && orderId.contains(","))
|
| | | orderId = orderId.split(",")[0];
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | orderId = orderId.substring(orderId.length() - 6, orderId.length());
|
| | | UserExtraTaoBaoInfo info = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | if (info != null) {
|
| | | UserExtraTaoBaoInfo update=new UserExtraTaoBaoInfo();
|
| | | UserExtraTaoBaoInfo update = new UserExtraTaoBaoInfo();
|
| | | update.setId(info.getId());
|
| | | update.setTaoBaoOrderEnd6Num(orderId);
|
| | | userExtraTaoBaoInfoService.updateSelective(update);
|
| | |
| | |
|
| | | private static Logger loginLogger = Logger.getLogger("loginLog");
|
| | |
|
| | | private static Logger smsLogger = Logger.getLogger("smsLog");
|
| | |
|
| | | public static void userInfo(Object obj) {
|
| | | userLogger.info(obj);
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 登录信息
|
| | | * |
| | | * @param obj
|
| | | */
|
| | | public static void lgoinInfo(Object obj) {
|
| | |
| | | String msg = url + "\n" + params + "\n" + response;
|
| | | httpLogger.info(msg);
|
| | | }
|
| | |
|
| | | public static void smsInfo(String info) {
|
| | | if (info != null)
|
| | | smsLogger.info(info);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | // 没有获取到转过链的商品详情
|
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); //TaoBaoUtil.getTbLinkForShare(auctionId, tbPid.getPid(), taoBaoUnionConfig);
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); // TaoBaoUtil.getTbLinkForShare(auctionId,
|
| | | // tbPid.getPid(),
|
| | | // taoBaoUnionConfig);
|
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "转链失败");
|
| | | }
|
| | |
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService
|
| | | .getConfigByAppIdCache(info.getPid().split("_")[2]);
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); |
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info);
|
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "商品转链失败");
|
| | | }
|
| | | goods.setCouponLink(taoBaoLink.getCouponLink());
|
| | | goods.setAuctionUrl(taoBaoLink.getAuctionUrl() );
|
| | | goods.setAuctionUrl(taoBaoLink.getAuctionUrl());
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(relationId)) {
|
| | |
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(goods.getCouponLink()) && !goods.getAuctionUrl().contains("s.click.taobao.com")) {
|
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info); |
| | | TaoBaoGoodsBrief taoBaoLink = TaoKeApiUtil.specialConvertCoupon(auctionId, info);
|
| | | if (taoBaoLink == null) {
|
| | | throw new ShareGoodsException(201, "商品转链失败");
|
| | | }
|
| | |
| | | return taoBaoLink;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId) {
|
| | | return userShareGoodsHistoryMapper.selectByUidAndAuctionId(uid, auctionId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | textTemplate.setUid(uid);
|
| | | shareGoodsTextTemplateMapper.insertSelective(textTemplate);
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, boolean hasCoupon) {
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(), AESUtil.encrypt(uid + "", Constant.UIDAESKEY),
|
| | | goods.getAuctionId() + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!hasCoupon) {
|
| | | String token = goods.getCouponLinkTaoToken();
|
| | | if (StringUtil.isNullOrEmpty(token))
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), goods.getAuctionUrl());
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, String token,
|
| | | String shortLink, boolean hasCoupon) {
|
| | |
|
| | | if (!hasCoupon) {
|
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{短链}", shortLink)
|
| | | .replace("{淘口令}", "").replace("{店铺类型}", goods.getUserType() == 1 ? "天猫价"
|
| | | : "淘宝价");
|
| | | } else {
|
| | | String token = goods.getCouponLinkTaoToken();
|
| | | if (StringUtil.isNullOrEmpty(token))
|
| | | token = TaoKeApiUtil.getTKToken(goods.getPictUrl(), goods.getTitle(), goods.getCouponLink());
|
| | |
|
| | | return template.replace("{标题}", goods.getTitle()).replace("{商品原价}", goods.getZkPrice().toString())
|
| | | .replace("{月销量}", TaoBaoUtil.getSaleCount(goods.getBiz30day())).replace("{领券短链}", shortLink)
|
| | | .replace("{淘口令}", token).replace("{优惠券面额}", goods.getCouponAmount().toString())
|
| | |
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public String getGoodsUserHongBao(TaoBaoGoodsBrief goods) {
|
| | | BigDecimal rate = hongBaoManageService.getFanLiRate();
|
| | |
| | |
|
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listQueryByAuctionId(List<Long> list) {
|
| | | return taoBaoGoodsBriefMapper.queryGoodsByAuctionId(list);
|
| | | if (list != null && list.size() > 0)
|
| | | return taoBaoGoodsBriefMapper.queryGoodsByAuctionId(list);
|
| | | else
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | public TaoBaoGoodsBrief selectByPrimaryKey(Long id) {
|
| | | return taoBaoGoodsBriefMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | @Override
|
| | | public void setGoodsBriefDefault(TaoBaoGoodsBrief goodsBrief) {
|
| | |
| | | public UserShareGoodsHistory getShareGoodsHistoryDetail(Long uid, Long auctionId) throws ShareGoodsException;
|
| | |
|
| | | /**
|
| | | * 获取分享记录
|
| | | * |
| | | * @param uid
|
| | | * @param auctionId
|
| | | * @return
|
| | | */
|
| | | public UserShareGoodsHistory getShareGoodsHistory(Long uid, Long auctionId);
|
| | |
|
| | | /**
|
| | | * 获取商品的分享转链链接
|
| | | *
|
| | | * @param uid
|
| | | * @param auctionId
|
| | | * @param relationId -渠道ID
|
| | | * @param relationId
|
| | | * -渠道ID
|
| | | * @return
|
| | | * @throws ShareGoodsException
|
| | | */
|
| | |
|
| | | public TaoBaoLink getTaoBaoLinkForShare(Long uid, Long auctionId,String relationId) throws ShareGoodsException;
|
| | | public TaoBaoLink getTaoBaoLinkForShare(Long uid, Long auctionId, String relationId) throws ShareGoodsException;
|
| | |
|
| | | /**
|
| | | * 获取商品的购买转链链接
|
| | |
| | | */
|
| | | public TaoBaoLink getTaoBaoLinkForBuyWithSpecial(Long uid, String specialId, Long auctionId)
|
| | | throws ShareGoodsException;
|
| | | |
| | |
|
| | | /**
|
| | | * 通过PID设置链接
|
| | | * |
| | | * @param uid
|
| | | * @param auctionId
|
| | | * @param pid
|
| | | * @return
|
| | | * @throws ShareGoodsException
|
| | | */
|
| | | public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException ;
|
| | | public TaoBaoLink getTaoBaoLink(Long uid, Long auctionId, String pid) throws ShareGoodsException;
|
| | |
|
| | | }
|
| | |
| | | * @param goods
|
| | | * @return
|
| | | */
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods, boolean hasCoupon);
|
| | | public String createContentByTemplate(String template, Long uid, TaoBaoGoodsBrief goods,String token,String shortLink, boolean hasCoupon);
|
| | |
|
| | | /**
|
| | | * 还原普通模板
|
| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import com.aliyuncs.CommonRequest;
|
| | | import com.aliyuncs.CommonResponse;
|
| | | import com.aliyuncs.DefaultAcsClient;
|
| | | import com.aliyuncs.IAcsClient;
|
| | | import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
|
| | | import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
| | | import com.aliyuncs.exceptions.ClientException;
|
| | | import com.aliyuncs.exceptions.ServerException;
|
| | | import com.aliyuncs.http.MethodType;
|
| | | import com.aliyuncs.profile.DefaultProfile;
|
| | | import com.aliyuncs.profile.IClientProfile;
|
| | | import com.yeshi.fanli.exception.SMSException;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
|
| | | //腾讯短信发送
|
| | | public class AliyunSMSUtil {
|
| | |
| | | * @param msg
|
| | | */
|
| | | public static void sendSingleMsg(String phone, String templateCode, String templateParamJson) throws SMSException {
|
| | | DefaultProfile profile = DefaultProfile.getProfile("default", Constant.smsConfig.getAliyunAppId(),
|
| | | IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", Constant.smsConfig.getAliyunAppId(),
|
| | | Constant.smsConfig.getAliyunAppSecret());
|
| | | IAcsClient client = new DefaultAcsClient(profile);
|
| | |
|
| | | CommonRequest request = new CommonRequest();
|
| | | // request.setProtocol(ProtocolType.HTTPS);
|
| | | request.setMethod(MethodType.POST);
|
| | | request.setDomain("dysmsapi.aliyuncs.com");
|
| | | request.setVersion("2017-05-25");
|
| | | request.setAction("SendBatchSms");
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(phone);
|
| | | request.putQueryParameter("PhoneNumberJson", array.toString());
|
| | | request.putQueryParameter("SignNameJson", Constant.smsConfig.getSmsSign());
|
| | | request.putQueryParameter("TemplateCode", templateCode);
|
| | | request.putQueryParameter("TemplateParamJson", templateParamJson);
|
| | | try {
|
| | | CommonResponse response = client.getCommonResponse(request);
|
| | | System.out.println(response.getData());
|
| | | DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", "Dysmsapi", "dysmsapi.aliyuncs.com");
|
| | | } catch (ClientException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | IAcsClient acsClient = new DefaultAcsClient(profile);
|
| | | // 组装请求对象
|
| | | SendSmsRequest request = new SendSmsRequest();
|
| | | // 使用post提交
|
| | | request.setMethod(MethodType.POST);
|
| | | request.setPhoneNumbers(phone);
|
| | | request.setSignName("小影记科技");
|
| | | request.setTemplateCode(templateCode);
|
| | | request.setTemplateParam(templateParamJson);
|
| | | SendSmsResponse sendSmsResponse;
|
| | | try {
|
| | | sendSmsResponse = acsClient.getAcsResponse(request);
|
| | | if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) {
|
| | | // 请求成功
|
| | | LogHelper.smsInfo("阿里云短信发送成功:" + phone);
|
| | | } else {
|
| | | LogHelper.smsInfo("阿里云短信发送失败:" + phone + "-" + sendSmsResponse.getMessage());
|
| | | throw new SMSException(3, sendSmsResponse.getMessage());
|
| | | }
|
| | | } catch (ServerException e) {
|
| | | e.printStackTrace();
|
| | | } catch (ClientException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | public void expire(String key,int seconds) {
|
| | | Jedis jedis = jedisPool.getResource();
|
| | | try {
|
| | | jedis.expire(key, 15);
|
| | | jedis.expire(key, seconds);
|
| | | } finally {
|
| | | jedisPool.returnResource(jedis);
|
| | | }
|
| | |
| | | log4j.appender.shareGoodsLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
|
| | | log4j.logger.smsLog=info,smsLog
|
| | | log4j.appender.smsLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.smsLog.File=logs/share/shareGoodsLog.log
|
| | | log4j.appender.smsLog.MaxFileSize=20MB
|
| | | log4j.appender.smsLog.MaxBackupIndex=100
|
| | | log4j.appender.smsLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.smsLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | log4j.logger.loginLog=info,loginLog
|
| | | log4j.appender.loginLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.loginLog.File=logs/user/login.log
|