|
|
package com.yohoufo.user.controller.wallet;
|
|
|
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.service.model.uic.request.UserSmsSendReqBO;
|
|
|
import com.yoho.service.model.wallet.request.WalletChangeBO;
|
|
|
import com.yoho.tools.common.beans.ApiResponse;
|
|
|
import com.yohoufo.common.interceptor.RemoteIPInterceptor;
|
|
|
import com.yohoufo.user.requestVO.UserSmsSendReqVO;
|
|
|
import com.yohoufo.user.requestVO.WalletChangeVO;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/WalletChangeRest")
|
|
|
public class WalletChangeController {
|
|
|
|
|
|
private Logger logger = LoggerFactory.getLogger(WalletChangeController.class);
|
|
|
|
|
|
@Autowired
|
|
|
private ServiceCaller serviceCaller;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 钱包提现
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("method = ufo.wallet.assertWithdraw")
|
|
|
public ApiResponse assetWithdraw( WalletChangeVO walletChangeVO){
|
|
|
logger.info("enter ufo.wallet.assertWithdraw with param {}", walletChangeVO);
|
|
|
WalletChangeBO reqBO = new WalletChangeBO();
|
|
|
BeanUtils.copyProperties(walletChangeVO, reqBO);
|
|
|
return serviceCaller.call("wallet.assetWithdraw", reqBO, ApiResponse.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 钱包提现 (给平台端使用)
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/assetWithdrawForPlat")
|
|
|
public ApiResponse assetWithdrawForPlat(WalletChangeVO walletChangeVO){
|
|
|
logger.info("enter assetWithdrawForPlat with param {}", walletChangeVO);
|
|
|
WalletChangeBO reqBO = new WalletChangeBO();
|
|
|
BeanUtils.copyProperties(walletChangeVO, reqBO);
|
|
|
return serviceCaller.call("wallet.assetWithdrawForPlat", reqBO, ApiResponse.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 异常流水处理 (给平台端使用)
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("/handleExceptionForPlat")
|
|
|
public ApiResponse handleExceptionForPlat(WalletChangeVO walletChangeVO){
|
|
|
logger.info("enter handleExceptionForPlat with param {}", walletChangeVO);
|
|
|
WalletChangeBO reqBO = new WalletChangeBO();
|
|
|
BeanUtils.copyProperties(walletChangeVO, reqBO);
|
|
|
return serviceCaller.call("wallet.assetWithdrawForPlat", reqBO, ApiResponse.class);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 提现时发送验证码短信
|
|
|
* @param
|
|
|
*/
|
|
|
@RequestMapping("/sendWithdrawCodeToMobile")
|
|
|
@ResponseBody
|
|
|
public ApiResponse sendWithdrawCodeToMobile(UserSmsSendReqVO reqVO) {
|
|
|
logger.info("Enter .sendWithdrawCodeToMobile, area is {}, mobile is {}, business_line is {}, clientType is {}", reqVO.getArea(),
|
|
|
reqVO.getMobile(), reqVO.getBusiness_line(), reqVO.getClient_type());
|
|
|
String ip = RemoteIPInterceptor.getRemoteIP();
|
|
|
UserSmsSendReqBO userSmsSendReqBO = new UserSmsSendReqBO();
|
|
|
BeanUtils.copyProperties(reqVO, userSmsSendReqBO);
|
|
|
userSmsSendReqBO.setIp(ip);
|
|
|
|
|
|
return serviceCaller.call("wallet.sendWithdrawCodeToMobile", userSmsSendReqBO, ApiResponse.class);
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|