Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Godfunc committed Aug 15, 2021
1 parent 1eb5f97 commit 5eab4c7
Show file tree
Hide file tree
Showing 115 changed files with 708 additions and 857 deletions.
4 changes: 2 additions & 2 deletions api/notify/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* @author Godfunc
* @email [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* Filter配置
*
* @author godfunc
* @email [email protected]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* mybatisplus自动填充
*
* @author godfunc
* @email [email protected]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.*;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;



/**
* Swagger配置
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.godfunc.entity.Merchant;
import com.godfunc.enums.MerchantStatusEnum;
import com.godfunc.mapper.MerchantMapper;
import com.godfunc.service.MerchantService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
* @author Godfunc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.godfunc.entity.*;
import com.godfunc.entity.Order;
import com.godfunc.entity.OrderLog;
import com.godfunc.enums.OrderStatusEnum;
import com.godfunc.enums.OrderStatusLogReasonEnum;
import com.godfunc.mapper.OrderMapper;
import com.godfunc.model.NotifyOrderInfo;
import com.godfunc.service.*;
import com.godfunc.service.OrderLogService;
import com.godfunc.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.springframework.stereotype.Service;



/**
* @author Godfunc
* @email [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.stereotype.Service;



/**
* @author Godfunc
* @email [email protected]
Expand Down
4 changes: 2 additions & 2 deletions api/pay/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>api</artifactId>
Expand Down
1 change: 1 addition & 0 deletions api/pay/src/main/java/com/godfunc/PayApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* @author Godfunc
* @email [email protected]
Expand Down
1 change: 1 addition & 0 deletions api/pay/src/main/java/com/godfunc/config/FilterConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* Filter配置
*
* @author godfunc
* @email [email protected]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* mybatisplus自动填充
*
* @author godfunc
* @email [email protected]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.*;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.godfunc.controller;

import com.godfunc.create.CreateOrderService;
import com.godfunc.dto.PayOrderDTO;
import com.godfunc.param.PayOrderParam;
import com.godfunc.pay.PayOrderService;
import com.godfunc.result.R;
import com.godfunc.create.CreateOrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@

public interface CreateOrderService {
PayOrderDTO create(PayOrderParam param, HttpServletRequest request);

void create(PayOrderParam param, HttpServletRequest request, HttpServletResponse response);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import com.godfunc.model.ProfitJoint;
import com.godfunc.param.PayOrderParam;
import com.godfunc.pay.PayOrderService;
import com.godfunc.pay.interceptor.EarlyProcessorComposite;
import com.godfunc.result.ApiCode;
import com.godfunc.result.ApiMsg;
import com.godfunc.service.*;
import com.godfunc.pay.interceptor.EarlyProcessorComposite;
import com.godfunc.util.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand All @@ -30,7 +30,10 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
Expand All @@ -43,9 +46,6 @@
@RequiredArgsConstructor
public class CreateOrderServiceImpl implements CreateOrderService {

@Value("${goPayUrl}")
private String goPayUrl;

private final EarlyProcessorComposite earlyProcessorComposite;
private final MerchantService merchantService;
private final OrderService orderService;
Expand All @@ -57,7 +57,8 @@ public class CreateOrderServiceImpl implements CreateOrderService {
private final MerchantOrderProfitService merchantOrderProfitService;
private final PayOrderService payOrderService;
private final ConfigService configService;

@Value("${goPayUrl}")
private String goPayUrl;

@Override
public PayOrderDTO create(PayOrderParam param, HttpServletRequest request) {
Expand Down Expand Up @@ -99,8 +100,9 @@ private void errorPage(Map<String, Object> errorMap, HttpServletResponse respons

/**
* 下单方法
* @param isSign 是否签名
* @param param 请求参数
*
* @param isSign 是否签名
* @param param 请求参数
* @param request 请求体
* @return 返回支付对象
*/
Expand Down
19 changes: 7 additions & 12 deletions api/pay/src/main/java/com/godfunc/dto/PayOrderDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

Expand All @@ -18,25 +17,21 @@
@ApiModel("订单返回信息")
public class PayOrderDTO {

public PayOrderDTO(String outTradeNo, String tradNo, String payUrl, LocalDateTime expiredTime) {
this.outTradeNo = outTradeNo;
this.tradNo = tradNo;
this.payUrl = payUrl;
this.expiredTime = expiredTime;
}

@ApiModelProperty("商户订单号")
private String outTradeNo;

@ApiModelProperty("平台订单号")
private String tradNo;

@ApiModelProperty("支付信息")
private String payUrl;

@ApiModelProperty("过期时间")
private LocalDateTime expiredTime;

@ApiModelProperty("签名")
private String sign;

public PayOrderDTO(String outTradeNo, String tradNo, String payUrl, LocalDateTime expiredTime) {
this.outTradeNo = outTradeNo;
this.tradNo = tradNo;
this.payUrl = payUrl;
this.expiredTime = expiredTime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.godfunc.constant.ApiConstant;
import com.godfunc.constant.CommonConstant;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
Expand Down
2 changes: 0 additions & 2 deletions api/pay/src/main/java/com/godfunc/pay/DefaultAbstractPay.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
import com.godfunc.util.Assert;
import com.godfunc.util.IpUtils;
import com.godfunc.util.UserAgentUtils;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down
4 changes: 2 additions & 2 deletions api/pay/src/main/java/com/godfunc/pay/NormalPayService.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void handleResponse(PayInfoDto payInfo, HttpServletRequest request, HttpS
int width = 300;
int height = 300;
//制定图片格式
String format="jpeg";
String format = "jpeg";
//内容
String content = payInfo.getPayUrl();

Expand All @@ -96,7 +96,7 @@ public void handleResponse(PayInfoDto payInfo, HttpServletRequest request, HttpS

//生成二维码
try {
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height,map);
BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, map);
MatrixToImageWriter.writeToStream(bitMatrix, format, response.getOutputStream());

} catch (Exception e) {
Expand Down
3 changes: 1 addition & 2 deletions api/pay/src/main/java/com/godfunc/pay/PayOrderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.godfunc.service.OrderDetailService;
import com.godfunc.service.OrderService;
import com.godfunc.util.Assert;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -37,6 +36,6 @@ public void goPay(String orderNo, HttpServletRequest request, HttpServletRespons
PayService payService = (PayService) applicationContext.getBean(ApiConstant.PAY_SERVICE_PREFIX + detail.getLogicalTag());
Assert.isNull(payService, "不支持的支付类型");

payService.pay(order, request, response);
payService.pay(order, request, response);
}
}
1 change: 1 addition & 0 deletions api/pay/src/main/java/com/godfunc/pay/PayService.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public interface PayService {

/**
* 设置客户端信息
*
* @param order
* @param request
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ public interface PayUrlRequestAdvice {

/**
* 请求支付前执行该方法
*
* @param order
* @param request
*/
void beforeRequest(Order order, HttpServletRequest request);

/**
* 请求支付成功,并且更新数据库成功后会执行该方法
*
* @param payInfo
*/
void afterRequest(PayInfoDto payInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class PayUrlRequestAdviceFinder {

/**
* 找到所有实现了{@link PayUrlRequestAdvice}的类
*
* @return
*/
public List<PayUrlRequestAdvice> findAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.godfunc.constant.RabbitMQConstant;
import com.godfunc.queue.model.FixChannelRisk;
import com.godfunc.queue.model.OrderExpire;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.connection.CorrelationData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.godfunc.entity.*;
import com.godfunc.entity.Config;
import com.godfunc.mapper.ConfigMapper;
import com.godfunc.service.*;
import com.godfunc.service.ConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public boolean riskMerchant(Long merchantId, Order order) {
/**
* 进行商户风控,对使用时间段、单笔金额等进行风控,不符合风控规则就抛出异常或者返回false
* 如果是抛出异常,将会直接返回给
*
* @param merchantRisk 风控规则
* @param order 订单
* @return true表示未被风控 false或者异常表示被风控了
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.godfunc.entity.*;
import com.godfunc.entity.MerchantOrderProfit;
import com.godfunc.entity.Order;
import com.godfunc.entity.OrderLog;
import com.godfunc.entity.PlatformOrderProfit;
import com.godfunc.enums.OrderStatusEnum;
import com.godfunc.enums.OrderStatusLogReasonEnum;
import com.godfunc.mapper.OrderMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;


Expand Down
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>gpay</artifactId>
Expand Down
Loading

0 comments on commit 5eab4c7

Please sign in to comment.