|
|
|
@ -5,10 +5,17 @@ import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType;
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.alipay.AlipayMapping;
|
|
|
|
|
import au.com.royalpay.payment.tools.permission.wechat.WechatMapping;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
@ -19,6 +26,7 @@ import javax.annotation.Resource;
|
|
|
|
|
@Controller
|
|
|
|
|
@RequestMapping("/act/encourage_money")
|
|
|
|
|
public class EncourageMoneyController {
|
|
|
|
|
Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
@Resource
|
|
|
|
|
private EncourageService encourageService;
|
|
|
|
|
|
|
|
|
@ -38,17 +46,22 @@ public class EncourageMoneyController {
|
|
|
|
|
|
|
|
|
|
@WechatMapping(value = "/orders/{orderId}/wechat", method = RequestMethod.GET)
|
|
|
|
|
public JSONObject takeEncourageMoneyWeChat(@PathVariable String orderId, @ModelAttribute(CommonConsts.WECHATINFO) JSONObject wxUser) {
|
|
|
|
|
logger.info("kiratest---wechat");
|
|
|
|
|
if (wxUser == null) {
|
|
|
|
|
return new JSONObject();
|
|
|
|
|
}
|
|
|
|
|
logger.info(wxUser.toJSONString());
|
|
|
|
|
return encourageService.takeEncourageMoney(orderId, wxUser.getString("openid"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AlipayMapping(value = "/orders/{orderId}/alipay", method = RequestMethod.GET)
|
|
|
|
|
public JSONObject takeEncourageMoneyAlipay(@PathVariable String orderId, @ModelAttribute(CommonConsts.ALIUSER) JSONObject alipayInfo) {
|
|
|
|
|
logger.info("kiratest---alipay");
|
|
|
|
|
|
|
|
|
|
if (alipayInfo == null) {
|
|
|
|
|
return new JSONObject();
|
|
|
|
|
}
|
|
|
|
|
logger.info(alipayInfo.toJSONString());
|
|
|
|
|
return encourageService.takeEncourageMoney(orderId, alipayInfo.getString("user_id"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|