Permalink
Browse files

first commit

  • Loading branch information...
zhou-hao committed Jan 4, 2019
1 parent 7e71a23 commit da7802308ca0ddf36a8a9ad9fd82efa6097782bc
Showing 7,316 changed files with 746,772 additions and 4 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
@@ -0,0 +1,27 @@
**/pom.xml.versionsBackup
**/target/
**/out/
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
.idea/
/nbproject
*.ipr
*.iws
*.iml
build/
# Package Files #
*.jar
*.war
*.ear
*.log
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
**/transaction-logs/
!/.mvn/wrapper/maven-wrapper.jar
/data/
*.db
/static/
/upload
/ui/upload/
!/ip2region.db
Binary file not shown.
@@ -0,0 +1 @@
distributionUrl=http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip?spm=0.0.0.0.7d3k4a&file=apache-maven-3.3.9-bin.zip
@@ -0,0 +1,5 @@
FROM java:8
ADD hsweb-payment-assemble/target/hsweb-payment-assemble.jar /app.jar
ADD hsweb-payment-ui /hsweb-payment-ui
ADD ip2region.db /ip2region.db
ENTRYPOINT ["java","-jar","-server","-XX:+UseG1GC","/app.jar"]
@@ -1,8 +1,42 @@
# hsweb-payment
基于hsweb的开源聚合支付系统
# 开源聚合支付平台

基于hsweb,spring-boot的开源聚合支付平台, 支持多渠道,多配置. 默认已接入: `微信扫码`,`微信H5`,`支付宝H5`,`支付宝网页支付`

# 环境

最新的java8

数据库支持: h2,mysql,oracle

# 模块
```bash
------hsweb-payment
----------hsweb-payment-account #资金账户模块
----------hsweb-payment-api #公共api接口模块
----------hsweb-payment-assemble #启动模块
----------hsweb-payment-logging #日志模块
----------hsweb-payment-merchant #商户模块
----------hsweb-payment-openapi #开放平台
----------hsweb-payment-pay #支付模块
----------hsweb-payment-ui #前端UI模块
```


# 启动

运行`hsweb-payment-assemble`模块下`PaymentApplication`

# 配置

# 商户
TODO

# 支付渠道
# 二次开发

TODO

# 参与项目
TODO

# ⚠️ 注意

本项目仅供开源学习,请勿用于商业用途,否者后果自负.
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
./mvnw -Dgit-commit-id=$(git rev-parse HEAD) clean package -DskipTests
docker rmi hsweb/hsweb-payment
docker build -t hsweb/hsweb-payment -f ./Dockerfile .
@@ -0,0 +1,30 @@
version: '2'
services:
# redis:
# image: redis
# ports:
# - "6379:6379"
mysql:
image: mysql:5.7
volumes:
- "database:/var/lib/mysql"
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
environment:
MYSQL_ROOT_PASSWORD: hSweb-Pay-p@ssw0rd
MYSQL_DATABASE: hsweb_payment
payment:
image: hsweb/hsweb-payment
links:
- "mysql:mysql"
volumes:
- "data:/data"
environment:
spring.profiles.active: prod
ports:
- "8080:8080"
depends_on:
- mysql
volumes:
database:
data:
@@ -0,0 +1,76 @@
<?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"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.hswebframework.pro</groupId>
<artifactId>hsweb-payment</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>hsweb-payment-account</artifactId>

<dependencies>
<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-commons-entity</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-tests</artifactId>
<version>${hsweb.framework.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-commons-dao-mybatis</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>
<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-commons-service-simple</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>
<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-commons-controller</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>

<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-system-organizational-authorization</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>

<dependency>
<groupId>org.hswebframework.web</groupId>
<artifactId>hsweb-spring-boot-starter</artifactId>
<version>${hsweb.framework.version}</version>
</dependency>

<dependency>
<groupId>org.hswebframework.pro</groupId>
<artifactId>hsweb-payment-api</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,11 @@
package org.hswebframework.payment.account.dao;

import org.hswebframework.payment.account.dao.entity.AccountEntity;
import org.hswebframework.web.dao.CrudDao;

/**
* @author Lind
* @since 1.0
*/
public interface AccountDao extends CrudDao<AccountEntity,String> {
}
@@ -0,0 +1,7 @@
package org.hswebframework.payment.account.dao;

import org.hswebframework.payment.account.dao.entity.AccountFreezeLogEntity;
import org.hswebframework.web.dao.CrudDao;

public interface AccountFreezeLogDao extends CrudDao<AccountFreezeLogEntity, String> {
}
@@ -0,0 +1,11 @@
package org.hswebframework.payment.account.dao;

import org.hswebframework.payment.account.dao.entity.AccountTransLogEntity;
import org.hswebframework.web.dao.CrudDao;

/**
* @author Lind
* @since 1.0
*/
public interface AccountTransLogDao extends CrudDao<AccountTransLogEntity, String> {
}
@@ -0,0 +1,106 @@
package org.hswebframework.payment.account.dao.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hswebframework.payment.api.enums.AccountStatus;
import org.hswebframework.payment.api.enums.AccountType;
import org.hswebframework.payment.api.enums.CurrencyEnum;
import org.hswebframework.web.commons.entity.GenericEntity;

import javax.persistence.Column;
import javax.persistence.Table;
import java.util.Date;

/**
* 资金账户
*
* @author Lind
* @since 1.0
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Table
@ApiModel(description = "资金账户")
@Getter
@Setter
public class AccountEntity implements GenericEntity<String> {

@ApiModelProperty(value = "资金账号")
@Column(name = "account_no")
private String accountNo;

@ApiModelProperty(value = "账户名称")
@Column(name = "name")
private String name;

@ApiModelProperty(value = "商户ID")
@Column(name = "merchant_id")
private String merchantId;

@ApiModelProperty(value = "资金账户类型")
@Column(name = "type")
private AccountType type;

@ApiModelProperty(value = "资金账户状态")
@Column(name = "status")
private AccountStatus status;

@ApiModelProperty(value = "余额")
@Column(name = "balance")
private Long balance;

@ApiModelProperty(value = "冻结金额")
@Column(name = "freeze_balance")
private Long freezeBalance;

@ApiModelProperty(value = "币种")
@Column(name = "currency")
private CurrencyEnum currency;

@ApiModelProperty(value = "备注")
@Column(name = "comment")
private String comment;

@Column(name = "id")
@ApiModelProperty(value = "主键")
private String id;

@Column(name = "create_time")
@ApiModelProperty(value = "创建时间")
private Date createTime;

@Column(name = "update_time")
@ApiModelProperty(value = "更新时间")
private Date updateTime;

@Column(name = "create_user")
@ApiModelProperty(value = "创建人")
private String createUser;

@Column(name = "update_user")
@ApiModelProperty(value = "更新人")
private String updateUser;

public void initData(String createUser){
this.createUser = createUser;
this.updateUser = createUser;
this.createTime = new Date();
this.updateTime = new Date();
}

public void updateData(String updateUser){
this.updateUser = updateUser;
this.updateTime = new Date();
}

public Long getTotalBalance(){
return this.balance+this.freezeBalance;
}
@Override
@SneakyThrows
public AccountEntity clone() {
return (AccountEntity) super.clone();
}
}
Oops, something went wrong.

0 comments on commit da78023

Please sign in to comment.