Commit 16abe225 authored by jim's avatar jim

log

parent 9a6088da
......@@ -2,16 +2,15 @@ package com.edgec.browserbackend.account.controller;
import com.edgec.browserbackend.account.domain.*;
import com.edgec.browserbackend.account.dto.*;
import com.edgec.browserbackend.account.service.AccountService;
import com.edgec.browserbackend.account.service.EmailService;
import com.edgec.browserbackend.account.service.PaymentService;
import com.edgec.browserbackend.alipay.AlipayConfig;
import com.edgec.browserbackend.alipay.AlipaySubmit;
import com.edgec.browserbackend.alipay.VpsAlipayConfig;
import com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode;
import com.edgec.browserbackend.common.auth.Securitys;
import com.edgec.browserbackend.common.commons.error.ClientRequestException;
import com.edgec.browserbackend.common.commons.utils.DateConverter;
import com.edgec.browserbackend.account.service.AccountService;
import com.edgec.browserbackend.account.service.EmailService;
import com.edgec.browserbackend.account.service.PaymentService;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.slf4j.Logger;
......@@ -27,10 +26,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.security.Principal;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
......@@ -123,6 +118,7 @@ public class AccountController {
accountService.sendSmsOtp(mobile.getMobile());
resultDto.setStatus(0);
} catch (ClientRequestException e) {
logger.error("fail to send sms", e);
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -140,7 +136,7 @@ public class AccountController {
if (!StringUtils.isEmpty(user.getEmail()))
account = accountService.create(user);
else
account = accountService.createWithSms(user);
account = accountService.createWithSms(user);
resultDto.setStatus(0);
resultDto.setData(account);
} catch (ClientRequestException e) {
......@@ -225,7 +221,7 @@ public class AccountController {
try {
accountService.resetPassword(principal.getName(), user);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -246,7 +242,7 @@ public class AccountController {
try {
accountService.resetPasswordWithOtp(user);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -273,7 +269,7 @@ public class AccountController {
@RequestMapping(path = "/wxpay/checkstatus/{tradno}/{chargeType}", method = RequestMethod.GET)
public UserPaymentDto wechatPayCheckStatus(@PathVariable String tradno, @PathVariable int chargeType) {
return paymentService.wxCheckOrderStatus(tradno, chargeType);
return paymentService.wxCheckOrderStatus(tradno, chargeType);
}
@RequestMapping(path = "/0xalipaycallback/{tradno}", method = RequestMethod.GET)
......@@ -399,7 +395,7 @@ public class AccountController {
}
@RequestMapping(path = "/preorder/delete/{username}", method = RequestMethod.POST)
public String deletePreOrder( @PathVariable("username") String username) {
public String deletePreOrder(@PathVariable("username") String username) {
return accountService.deletePreOrder(username);
}
......@@ -439,7 +435,7 @@ public class AccountController {
}
accountService.authorizeCompany(principal.getName(), companyAuthorizeDto);
resultDto.setStatus(0);
}catch (ClientRequestException e) {
} catch (ClientRequestException e) {
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", e.getErrorCode());
......@@ -450,14 +446,14 @@ public class AccountController {
}
@RequestMapping(path = "/ali/login", method = RequestMethod.GET)
public String save(HttpServletRequest request,HttpServletResponse response) {
public String save(HttpServletRequest request, HttpServletResponse response) {
//页面回调地址 必须与应用中的设置一样
String return_url = "http://https://www.fangguanlian.cn/ali/withdraw";
//回调地址必须经encode
return_url = java.net.URLEncoder.encode(return_url);
//重定向到授权页面
AlipayConfig alipayConfig = new VpsAlipayConfig();
return "redirect:"+ VpsAlipayConfig.ALIPAY_AUTH_URL + "?app_id=" + alipayConfig.getAPPID() + "&scope=auth_user&redirect_uri=" + return_url;
return "redirect:" + VpsAlipayConfig.ALIPAY_AUTH_URL + "?app_id=" + alipayConfig.getAPPID() + "&scope=auth_user&redirect_uri=" + return_url;
}
@RequestMapping(path = "/ali/withdraw", method = RequestMethod.PUT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment