| | |
| | | import com.yeshi.fanli.exception.taobao.TaoBaoAuthException;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.tlj.TaoLiJinCreateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.log.TLJLogHelper;
|
| | | import com.yeshi.fanli.log.TaoKeLogHelper;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
| | | public static void taoKeContent() {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.content.get");
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT.split("_")[3]);
|
| | | map.put("adzone_id", TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT.split("_")[3]);
|
| | | map.put("type", "1");
|
| | | map.put("count", "100");
|
| | |
|
| | |
| | | // 淘礼金创建
|
| | | public static TaoLiJinDTO createTaoLiJin(Long auctionId, String name, BigDecimal perface, int totalNum,
|
| | | Date sendStartTime, Date sendEndTime, Date useStartTime, Date useEndTime, TaoKeAppInfo app)
|
| | | throws TaoKeApiException {
|
| | | throws TaoKeApiException, TaoLiJinCreateException {
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("method", "taobao.tbk.dg.vegas.tlj.create");
|
| | | map.put("adzone_id", app.getPid().split("_")[3]);
|
| | |
| | | // 接口返回异常
|
| | | String msgCode = root.optJSONObject("result").optString("msg_code");
|
| | | if (!StringUtil.isNullOrEmpty(msgCode)) {
|
| | | TLJLogHelper.info(auctionId, root.toString());// 淘礼金异常信息记录
|
| | | switch (msgCode) {
|
| | | case "FAIL_BIZ_ITEM_FORBIDDEN":
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_TLJ_FORBIDDEN, "该商品不支持创建淘礼金红包");
|
| | | throw new TaoLiJinCreateException(TaoLiJinCreateException.CODE_TLJ_FORBIDDEN, "该商品不支持创建淘礼金红包");
|
| | | case "FAIL_BIZ_ACCOUNT_UN_PAID":
|
| | | case "PRE_FREEZE_ASSET_ACCOUNT_ERROR":
|
| | | throw new TaoKeApiException(TaoKeApiException.CODE_TLJ_NO_MONEY, "官方玩法钱包余额不足");
|
| | | throw new TaoLiJinCreateException(TaoLiJinCreateException.CODE_TLJ_NO_MONEY, "官方玩法钱包余额不足");
|
| | | default:
|
| | | return null;
|
| | | throw new TaoKeApiException(Integer.parseInt(msgCode), root.toString());
|
| | | }
|
| | | }
|
| | | }
|