mirror of
https://github.com/201206030/novel-plus.git
synced 2025-04-26 17:20:52 +00:00
增加充值模块,接通支付宝充值
This commit is contained in:
parent
d30c6bfd6e
commit
c8d7a10d9f
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,3 +11,5 @@
|
||||
/novel-crawl/novel-crawl.iml
|
||||
/novel-crawl/target
|
||||
/novel-admin/target
|
||||
/*.iml
|
||||
/novel-admin/*.iml
|
||||
|
@ -1,165 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="FacetManager">
|
||||
<facet type="Spring" name="Spring">
|
||||
<configuration />
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.10.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.10.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.19" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.9.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.15.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.7.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.7.11" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.5.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.8.13" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:8.5.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:8.5.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:8.5.29" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.9.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-thymeleaf:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf:thymeleaf:3.0.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.attoparser:attoparser:2.0.4.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.unbescape:unbescape:1.1.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sourceforge.nekohtml:nekohtml:1.9.22" level="project" />
|
||||
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: xml-apis:xml-apis:1.4.01" level="project" />
|
||||
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.11" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Maven: com.google.protobuf:protobuf-java:2.6.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:2.7.8" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:druid:1.0.28" level="project" />
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: com.alibaba:jconsole:1.8.0">
|
||||
<CLASSES>
|
||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_181/lib/jconsole.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library name="Maven: com.alibaba:tools:1.8.0">
|
||||
<CLASSES>
|
||||
<root url="jar://C:/Program Files/Java/jdk1.8.0_181/lib/tools.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-io:commons-io:2.5" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-core:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-beanutils:commons-beanutils:1.8.3" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-spring:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-web:1.3.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-ehcache:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-cache:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.shiro:shiro-lang:1.4.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.github.theborakompanioni:thymeleaf-extras-shiro:2.0.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.31" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.velocity:velocity:1.7" level="project" />
|
||||
<orderEntry type="library" name="Maven: commons-collections:commons-collections:3.2.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.10" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.google.guava:guava:18.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.3.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.0.0.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.6.1" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.0.1.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.0.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.0.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.0.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.0.5.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.0.3.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.1.6.RELEASE" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.2" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.23.Final" level="project" />
|
||||
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.5.0" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.16.20" level="project" />
|
||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-text:1.4" level="project" />
|
||||
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.4" level="project" />
|
||||
</component>
|
||||
</module>
|
@ -0,0 +1,123 @@
|
||||
package com.java2nb.novel.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.annotation.Generated;
|
||||
|
||||
public class OrderPay {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long id;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long outTradeNo;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private String tradeNo;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Byte payChannel;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Integer totalAmount;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long userId;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Byte payStatus;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date createTime;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Date updateTime;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Long getOutTradeNo() {
|
||||
return outTradeNo;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setOutTradeNo(Long outTradeNo) {
|
||||
this.outTradeNo = outTradeNo;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public String getTradeNo() {
|
||||
return tradeNo;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setTradeNo(String tradeNo) {
|
||||
this.tradeNo = tradeNo == null ? null : tradeNo.trim();
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Byte getPayChannel() {
|
||||
return payChannel;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setPayChannel(Byte payChannel) {
|
||||
this.payChannel = payChannel;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Integer getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setTotalAmount(Integer totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Byte getPayStatus() {
|
||||
return payStatus;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setPayStatus(Byte payStatus) {
|
||||
this.payStatus = payStatus;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.java2nb.novel.mapper;
|
||||
|
||||
import java.sql.JDBCType;
|
||||
import java.util.Date;
|
||||
import javax.annotation.Generated;
|
||||
import org.mybatis.dynamic.sql.SqlColumn;
|
||||
import org.mybatis.dynamic.sql.SqlTable;
|
||||
|
||||
public final class OrderPayDynamicSqlSupport {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final OrderPay orderPay = new OrderPay();
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Long> id = orderPay.id;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Long> outTradeNo = orderPay.outTradeNo;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<String> tradeNo = orderPay.tradeNo;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Byte> payChannel = orderPay.payChannel;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Integer> totalAmount = orderPay.totalAmount;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Long> userId = orderPay.userId;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Byte> payStatus = orderPay.payStatus;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Date> createTime = orderPay.createTime;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final SqlColumn<Date> updateTime = orderPay.updateTime;
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
public static final class OrderPay extends SqlTable {
|
||||
public final SqlColumn<Long> id = column("id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<Long> outTradeNo = column("out_trade_no", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<String> tradeNo = column("trade_no", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<Byte> payChannel = column("pay_channel", JDBCType.TINYINT);
|
||||
|
||||
public final SqlColumn<Integer> totalAmount = column("total_amount", JDBCType.INTEGER);
|
||||
|
||||
public final SqlColumn<Long> userId = column("user_id", JDBCType.BIGINT);
|
||||
|
||||
public final SqlColumn<Byte> payStatus = column("pay_status", JDBCType.TINYINT);
|
||||
|
||||
public final SqlColumn<Date> createTime = column("create_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public final SqlColumn<Date> updateTime = column("update_time", JDBCType.TIMESTAMP);
|
||||
|
||||
public OrderPay() {
|
||||
super("order_pay");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,224 @@
|
||||
package com.java2nb.novel.mapper;
|
||||
|
||||
import static com.java2nb.novel.mapper.OrderPayDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.*;
|
||||
|
||||
import com.java2nb.novel.entity.OrderPay;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import javax.annotation.Generated;
|
||||
import org.apache.ibatis.annotations.DeleteProvider;
|
||||
import org.apache.ibatis.annotations.InsertProvider;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.apache.ibatis.annotations.ResultMap;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
import org.apache.ibatis.annotations.SelectProvider;
|
||||
import org.apache.ibatis.annotations.UpdateProvider;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.mybatis.dynamic.sql.BasicColumn;
|
||||
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
|
||||
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
|
||||
import org.mybatis.dynamic.sql.insert.render.MultiRowInsertStatementProvider;
|
||||
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.UpdateDSL;
|
||||
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
|
||||
|
||||
@Mapper
|
||||
public interface OrderPayMapper {
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
BasicColumn[] selectList = BasicColumn.columnList(id, outTradeNo, tradeNo, payChannel, totalAmount, userId, payStatus, createTime, updateTime);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
long count(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@DeleteProvider(type=SqlProviderAdapter.class, method="delete")
|
||||
int delete(DeleteStatementProvider deleteStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@InsertProvider(type=SqlProviderAdapter.class, method="insert")
|
||||
int insert(InsertStatementProvider<OrderPay> insertStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@InsertProvider(type=SqlProviderAdapter.class, method="insertMultiple")
|
||||
int insertMultiple(MultiRowInsertStatementProvider<OrderPay> multipleInsertStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@ResultMap("OrderPayResult")
|
||||
Optional<OrderPay> selectOne(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@Results(id="OrderPayResult", value = {
|
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
|
||||
@Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="trade_no", property="tradeNo", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.TINYINT),
|
||||
@Result(column="total_amount", property="totalAmount", jdbcType=JdbcType.INTEGER),
|
||||
@Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
|
||||
@Result(column="pay_status", property="payStatus", jdbcType=JdbcType.TINYINT),
|
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
|
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
|
||||
})
|
||||
List<OrderPay> selectMany(SelectStatementProvider selectStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
@UpdateProvider(type=SqlProviderAdapter.class, method="update")
|
||||
int update(UpdateStatementProvider updateStatement);
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default long count(CountDSLCompleter completer) {
|
||||
return MyBatis3Utils.countFrom(this::count, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int delete(DeleteDSLCompleter completer) {
|
||||
return MyBatis3Utils.deleteFrom(this::delete, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int deleteByPrimaryKey(Long id_) {
|
||||
return delete(c ->
|
||||
c.where(id, isEqualTo(id_))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insert(OrderPay record) {
|
||||
return MyBatis3Utils.insert(this::insert, record, orderPay, c ->
|
||||
c.map(id).toProperty("id")
|
||||
.map(outTradeNo).toProperty("outTradeNo")
|
||||
.map(tradeNo).toProperty("tradeNo")
|
||||
.map(payChannel).toProperty("payChannel")
|
||||
.map(totalAmount).toProperty("totalAmount")
|
||||
.map(userId).toProperty("userId")
|
||||
.map(payStatus).toProperty("payStatus")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insertMultiple(Collection<OrderPay> records) {
|
||||
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, orderPay, c ->
|
||||
c.map(id).toProperty("id")
|
||||
.map(outTradeNo).toProperty("outTradeNo")
|
||||
.map(tradeNo).toProperty("tradeNo")
|
||||
.map(payChannel).toProperty("payChannel")
|
||||
.map(totalAmount).toProperty("totalAmount")
|
||||
.map(userId).toProperty("userId")
|
||||
.map(payStatus).toProperty("payStatus")
|
||||
.map(createTime).toProperty("createTime")
|
||||
.map(updateTime).toProperty("updateTime")
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int insertSelective(OrderPay record) {
|
||||
return MyBatis3Utils.insert(this::insert, record, orderPay, c ->
|
||||
c.map(id).toPropertyWhenPresent("id", record::getId)
|
||||
.map(outTradeNo).toPropertyWhenPresent("outTradeNo", record::getOutTradeNo)
|
||||
.map(tradeNo).toPropertyWhenPresent("tradeNo", record::getTradeNo)
|
||||
.map(payChannel).toPropertyWhenPresent("payChannel", record::getPayChannel)
|
||||
.map(totalAmount).toPropertyWhenPresent("totalAmount", record::getTotalAmount)
|
||||
.map(userId).toPropertyWhenPresent("userId", record::getUserId)
|
||||
.map(payStatus).toPropertyWhenPresent("payStatus", record::getPayStatus)
|
||||
.map(createTime).toPropertyWhenPresent("createTime", record::getCreateTime)
|
||||
.map(updateTime).toPropertyWhenPresent("updateTime", record::getUpdateTime)
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default Optional<OrderPay> selectOne(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectOne(this::selectOne, selectList, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default List<OrderPay> select(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectList(this::selectMany, selectList, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default List<OrderPay> selectDistinct(SelectDSLCompleter completer) {
|
||||
return MyBatis3Utils.selectDistinct(this::selectMany, selectList, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default Optional<OrderPay> selectByPrimaryKey(Long id_) {
|
||||
return selectOne(c ->
|
||||
c.where(id, isEqualTo(id_))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int update(UpdateDSLCompleter completer) {
|
||||
return MyBatis3Utils.update(this::update, orderPay, completer);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
static UpdateDSL<UpdateModel> updateAllColumns(OrderPay record, UpdateDSL<UpdateModel> dsl) {
|
||||
return dsl.set(id).equalTo(record::getId)
|
||||
.set(outTradeNo).equalTo(record::getOutTradeNo)
|
||||
.set(tradeNo).equalTo(record::getTradeNo)
|
||||
.set(payChannel).equalTo(record::getPayChannel)
|
||||
.set(totalAmount).equalTo(record::getTotalAmount)
|
||||
.set(userId).equalTo(record::getUserId)
|
||||
.set(payStatus).equalTo(record::getPayStatus)
|
||||
.set(createTime).equalTo(record::getCreateTime)
|
||||
.set(updateTime).equalTo(record::getUpdateTime);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
static UpdateDSL<UpdateModel> updateSelectiveColumns(OrderPay record, UpdateDSL<UpdateModel> dsl) {
|
||||
return dsl.set(id).equalToWhenPresent(record::getId)
|
||||
.set(outTradeNo).equalToWhenPresent(record::getOutTradeNo)
|
||||
.set(tradeNo).equalToWhenPresent(record::getTradeNo)
|
||||
.set(payChannel).equalToWhenPresent(record::getPayChannel)
|
||||
.set(totalAmount).equalToWhenPresent(record::getTotalAmount)
|
||||
.set(userId).equalToWhenPresent(record::getUserId)
|
||||
.set(payStatus).equalToWhenPresent(record::getPayStatus)
|
||||
.set(createTime).equalToWhenPresent(record::getCreateTime)
|
||||
.set(updateTime).equalToWhenPresent(record::getUpdateTime);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int updateByPrimaryKey(OrderPay record) {
|
||||
return update(c ->
|
||||
c.set(outTradeNo).equalTo(record::getOutTradeNo)
|
||||
.set(tradeNo).equalTo(record::getTradeNo)
|
||||
.set(payChannel).equalTo(record::getPayChannel)
|
||||
.set(totalAmount).equalTo(record::getTotalAmount)
|
||||
.set(userId).equalTo(record::getUserId)
|
||||
.set(payStatus).equalTo(record::getPayStatus)
|
||||
.set(createTime).equalTo(record::getCreateTime)
|
||||
.set(updateTime).equalTo(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
default int updateByPrimaryKeySelective(OrderPay record) {
|
||||
return update(c ->
|
||||
c.set(outTradeNo).equalToWhenPresent(record::getOutTradeNo)
|
||||
.set(tradeNo).equalToWhenPresent(record::getTradeNo)
|
||||
.set(payChannel).equalToWhenPresent(record::getPayChannel)
|
||||
.set(totalAmount).equalToWhenPresent(record::getTotalAmount)
|
||||
.set(userId).equalToWhenPresent(record::getUserId)
|
||||
.set(payStatus).equalToWhenPresent(record::getPayStatus)
|
||||
.set(createTime).equalToWhenPresent(record::getCreateTime)
|
||||
.set(updateTime).equalToWhenPresent(record::getUpdateTime)
|
||||
.where(id, isEqualTo(record::getId))
|
||||
);
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@ spring:
|
||||
profiles:
|
||||
include: [common]
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password:
|
||||
password: test123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
|
@ -8,8 +8,8 @@
|
||||
<property name="suppressAllComments" value="true" />
|
||||
</commentGenerator>
|
||||
<jdbcConnection
|
||||
connectionURL="jdbc:mysql://127.0.0.1:3306/novel_biz?tinyInt1isBit=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true"
|
||||
driverClass="com.mysql.jdbc.Driver" password=""
|
||||
connectionURL="jdbc:mysql://127.0.0.1:3306/novel_plus?tinyInt1isBit=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true"
|
||||
driverClass="com.mysql.jdbc.Driver" password="test123456"
|
||||
userId="root" />
|
||||
|
||||
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer, 为 true时把JDBC DECIMAL
|
||||
@ -44,7 +44,7 @@
|
||||
</javaClientGenerator>
|
||||
|
||||
<!--生成全部表tableName设为%-->
|
||||
<table tableName="crawl_source" domainObjectName="CrawlSource"/>
|
||||
<table tableName="order_pay" domainObjectName="OrderPay"/>
|
||||
|
||||
<!-- 指定数据库表 -->
|
||||
<!--<table schema="jly" tableName="job_position" domainObjectName="JobPositionTest"/>-->
|
||||
|
@ -26,6 +26,13 @@
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alipay.sdk</groupId>
|
||||
<artifactId>alipay-sdk-java</artifactId>
|
||||
<version>4.9.153.ALL</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -0,0 +1,153 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.alipay.api.request.AlipayTradePagePayRequest;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.config.AlipayConfig;
|
||||
import com.java2nb.novel.service.OrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("pay")
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PayController extends BaseController {
|
||||
|
||||
|
||||
private final AlipayConfig alipayConfig;
|
||||
|
||||
private final OrderService orderService;
|
||||
|
||||
|
||||
/**
|
||||
* 支付宝支付
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("aliPay")
|
||||
public void aliPay(Integer payAmount,HttpServletRequest request,HttpServletResponse httpResponse) {
|
||||
|
||||
UserDetails userDetails = getUserDetails(request);
|
||||
if (userDetails == null) {
|
||||
//未登录,跳转到登陆页面
|
||||
httpResponse.sendRedirect("/user/login.html?originUrl=/pay/aliPay?payAmount="+payAmount);
|
||||
return;
|
||||
}else {
|
||||
//创建充值订单
|
||||
Long outTradeNo = orderService.createPayOrder((byte)1,payAmount,userDetails.getId());
|
||||
|
||||
//获得初始化的AlipayClient
|
||||
AlipayClient alipayClient = new DefaultAlipayClient(alipayConfig.getGatewayUrl(), alipayConfig.getAppId(), alipayConfig.getMerchantPrivateKey(), "json", alipayConfig.getCharset(), alipayConfig.getPublicKey(), alipayConfig.getSignType());
|
||||
//创建API对应的request
|
||||
AlipayTradePagePayRequest alipayRequest = new AlipayTradePagePayRequest();
|
||||
alipayRequest.setReturnUrl(alipayConfig.getReturnUrl());
|
||||
//在公共参数中设置回跳和通知地址
|
||||
alipayRequest.setNotifyUrl(alipayConfig.getNotifyUrl());
|
||||
//填充业务参数
|
||||
alipayRequest.setBizContent("{" +
|
||||
" \"out_trade_no\":\"" + outTradeNo + "\"," +
|
||||
" \"product_code\":\"FAST_INSTANT_TRADE_PAY\"," +
|
||||
" \"total_amount\":" + payAmount + "," +
|
||||
" \"subject\":\"小说精品屋-plus\"" +
|
||||
" }");
|
||||
//调用SDK生成表单
|
||||
String form = alipayClient.pageExecute(alipayRequest).getBody();
|
||||
|
||||
httpResponse.setContentType("text/html;charset=utf-8");
|
||||
//直接将完整的表单html输出到页面
|
||||
httpResponse.getWriter().write(form);
|
||||
httpResponse.getWriter().flush();
|
||||
httpResponse.getWriter().close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付宝支付通知
|
||||
* */
|
||||
@SneakyThrows
|
||||
@RequestMapping("aliPay/notify")
|
||||
public void aliPayNotify(HttpServletRequest request,HttpServletResponse httpResponse){
|
||||
|
||||
|
||||
PrintWriter out = httpResponse.getWriter();
|
||||
|
||||
//获取支付宝POST过来反馈信息
|
||||
Map<String,String> params = new HashMap<String,String>();
|
||||
Map<String,String[]> requestParams = request.getParameterMap();
|
||||
for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext();) {
|
||||
String name = (String) iter.next();
|
||||
String[] values = (String[]) requestParams.get(name);
|
||||
String valueStr = "";
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
valueStr = (i == values.length - 1) ? valueStr + values[i]
|
||||
: valueStr + values[i] + ",";
|
||||
}
|
||||
params.put(name, valueStr);
|
||||
}
|
||||
|
||||
//调用SDK验证签名
|
||||
boolean signVerified = AlipaySignature.rsaCheckV1(params, alipayConfig.getPublicKey(), alipayConfig.getCharset(), alipayConfig.getSignType());
|
||||
|
||||
//——请在这里编写您的程序(以下代码仅作参考)——
|
||||
|
||||
/* 实际验证过程建议商户务必添加以下校验:
|
||||
1、需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号,
|
||||
2、判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额),
|
||||
3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
|
||||
4、验证app_id是否为该商户本身。
|
||||
*/
|
||||
if(signVerified) {
|
||||
//验证成功
|
||||
//商户订单号
|
||||
String outTradeNo = new String(request.getParameter("out_trade_no").getBytes("ISO-8859-1"),"UTF-8");
|
||||
|
||||
//支付宝交易号
|
||||
String tradeNo = new String(request.getParameter("trade_no").getBytes("ISO-8859-1"),"UTF-8");
|
||||
|
||||
//交易状态
|
||||
String tradeStatus = new String(request.getParameter("trade_status").getBytes("ISO-8859-1"),"UTF-8");
|
||||
|
||||
//更新订单状态
|
||||
orderService.updatePayOrder(Long.parseLong(outTradeNo), tradeNo, tradeStatus);
|
||||
|
||||
|
||||
out.println("success");
|
||||
|
||||
}else {//验证失败
|
||||
out.println("fail");
|
||||
|
||||
//调试用,写文本函数记录程序运行情况是否正常
|
||||
//String sWord = AlipaySignature.getSignCheckContentV1(params);
|
||||
//AlipayConfig.logResult(sWord);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.java2nb.novel.core.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix="alipay")
|
||||
public class AlipayConfig {
|
||||
|
||||
private String appId;
|
||||
private String merchantPrivateKey;
|
||||
private String publicKey;
|
||||
private String notifyUrl;
|
||||
private String returnUrl;
|
||||
private String signType;
|
||||
private String charset;
|
||||
private String gatewayUrl;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
|
||||
/**
|
||||
* 创建充值订单
|
||||
*
|
||||
* @param payChannel 支付渠道
|
||||
* @param payAmount 支付金额
|
||||
* @param userId 用户ID
|
||||
* @return 商户订单号
|
||||
* */
|
||||
Long createPayOrder(Byte payChannel, Integer payAmount, Long userId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新订单状态
|
||||
* @param outTradeNo 商户订单号
|
||||
* @param tradeNo 支付宝/微信 订单号
|
||||
* @param tradeStatus 支付状态
|
||||
* */
|
||||
void updatePayOrder(Long outTradeNo, String tradeNo, String tradeStatus);
|
||||
}
|
@ -117,4 +117,9 @@ public interface UserService {
|
||||
void updatePassword(Long userId, String oldPassword, String newPassword);
|
||||
|
||||
|
||||
/**
|
||||
* 增加用户余额
|
||||
* @param userId 用户ID
|
||||
* @param amount 增加的余额 */
|
||||
void addAmount(Long userId, int amount);
|
||||
}
|
||||
|
@ -0,0 +1,85 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.java2nb.novel.entity.OrderPay;
|
||||
import com.java2nb.novel.mapper.OrderPayDynamicSqlSupport;
|
||||
import com.java2nb.novel.mapper.OrderPayMapper;
|
||||
import com.java2nb.novel.service.OrderService;
|
||||
import com.java2nb.novel.service.UserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
import static org.mybatis.dynamic.sql.select.SelectDSL.select;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
|
||||
private final OrderPayMapper orderPayMapper;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public Long createPayOrder(Byte payChannel, Integer payAmount, Long userId) {
|
||||
Date currentDate = new Date();
|
||||
Long outTradeNo = Long.parseLong(new SimpleDateFormat("yyyyMMddHHmmssSSS").format(currentDate)+new Random().nextInt(10));
|
||||
OrderPay orderPay = new OrderPay();
|
||||
orderPay.setOutTradeNo(outTradeNo);
|
||||
orderPay.setPayChannel(payChannel);
|
||||
orderPay.setTotalAmount(payAmount);
|
||||
orderPay.setUserId(userId);
|
||||
orderPay.setCreateTime(currentDate);
|
||||
orderPay.setUpdateTime(currentDate);
|
||||
orderPayMapper.insertSelective(orderPay);
|
||||
return outTradeNo;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void updatePayOrder(Long outTradeNo, String tradeNo, String tradeStatus) {
|
||||
SelectStatementProvider selectStatement = select(OrderPayDynamicSqlSupport.id,OrderPayDynamicSqlSupport.payStatus,OrderPayDynamicSqlSupport.totalAmount,OrderPayDynamicSqlSupport.userId)
|
||||
.from(OrderPayDynamicSqlSupport.orderPay)
|
||||
.where(OrderPayDynamicSqlSupport.outTradeNo, isEqualTo(outTradeNo))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
|
||||
OrderPay orderPay = orderPayMapper.selectMany(selectStatement).get(0);
|
||||
|
||||
if(orderPay.getPayStatus()!=1) {
|
||||
//此订单还未处理过
|
||||
|
||||
if (tradeStatus.equals("TRADE_SUCCESS") || tradeStatus.equals("TRADE_FINISHED")) {
|
||||
//支付成功
|
||||
//1.更新订单状态为成功
|
||||
orderPay.setPayStatus((byte) 1);
|
||||
orderPay.setUpdateTime(new Date());
|
||||
orderPayMapper.updateByPrimaryKeySelective(orderPay);
|
||||
|
||||
//2.增加用户余额
|
||||
userService.addAmount(orderPay.getUserId(),orderPay.getTotalAmount()*100);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -211,7 +211,7 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
@Override
|
||||
public User userInfo(Long userId) {
|
||||
SelectStatementProvider selectStatement = select(username, nickName, userPhoto,userSex)
|
||||
SelectStatementProvider selectStatement = select(username, nickName, userPhoto,userSex,accountBalance)
|
||||
.from(user)
|
||||
.where(id, isEqualTo(userId))
|
||||
.build()
|
||||
@ -256,6 +256,15 @@ public class UserServiceImpl implements UserService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void addAmount(Long userId, int amount) {
|
||||
User user = this.userInfo(userId);
|
||||
user.setId(userId);
|
||||
user.setAccountBalance(user.getAccountBalance()+amount);
|
||||
userMapper.updateByPrimaryKeySelective(user);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
17
novel-front/src/main/resources/application-alipay.yml
Normal file
17
novel-front/src/main/resources/application-alipay.yml
Normal file
@ -0,0 +1,17 @@
|
||||
alipay:
|
||||
#请填写您的AppId,例如:2019091767145019
|
||||
app-id: 2016101600696458
|
||||
#请填写您的应用私钥,例如:MIIEvQIBADANB
|
||||
merchant-private-key: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJrd9qg88m1p9c7IopcGlLksP9ts0eaf1wesgz4K3O6CzmgaCfR2f+scRI4xrMhKBHfzKDdKlW16LtrebD/YS/aDhRL9MM1GJ0Pr7zFdw6fIka9eIz1FojmmXNyaQVEbaGt/7DvoI+rJjjNtTQAYpMztHnof2W0Nfpra5U4dShJrzsvumS8NapEt9YgQ36jY9Z40RJ97Z06avmMGrAVlQSSTvUInTYz8EQmM3YN0ed3CmnlQFRhuW7kkbgBtZKjq+24iaU2mzp4qvWi5T89l3wuMahhxhFTgTNd24qxFuYShIdD0G3KCtunpwegomj1iQnF47qGv97UwOuA36b6l75AgMBAAECggEAJraZZ94AVa9ryDlK8DQHp5RxP9oy+yZaeVJNESlQNina1kYE4ES33UonI0eYtYFlgDUoAwa+xwiDa8nGZb3XoeqwS0PjWGwv8vfhwYCYGGoEM2yIWoKPhgtYLPFSDgqZBHCgVnIvNWha5Sj51jNYrBhLtZI7ODkpPS/1ITEPFPDds9LmH3Ujci20ttzr1SffKL/1caZ2Xph/Jkm2Xhh227cclORakDsggUmaxt723zibwFwpS6wwRlPJYf7hr3v3SnIgcc0osqKAcnJzrBlmaJVTBgnOAdulp+m/DjKVoIEieMr75OIYTWMRi0trlxAyvv4aDHxxJB6cDGNHFQLIMQKBgQD5j4fJDub2n9EjgxqYS9B6qa2pH5S9yypU+mM6fIXO/AjHpNwEzFQgU8lN3FE1CVfFb4yZx8sOJsQvZPGLvIhMPYT/2xMOIRL2IguJICt23Xnw+c1tNkvHvsHAiLvo/yzwSFixHcOaEwXDKUDsydPyalDFWBrwCGmGGxPEFG/Q/wKBgQCNO0+Muo+HzeUButDyA5gt9oPCX7uZ9g64rnFhuQXZ/eLDQeCW/lhjRiT2R+QafvbRyOYYomKZ6/1iQALY4tqQD7XMClRdu0OUvYR2WaNb9j4sWXl8qhMxgWjXssqorZRzNe+txicX8yOA5/ZVhhq647e2zt4kOS5H6Np0HvxYBwKBgQDvNfA+/cTPk4NhWdLNNqagXTJz0Sy+/BYYnGUu85tDOvyjeVfYVY8x6X4k3tEMWGdEfdc0tHjjmK8misipW8793V417WUHfxZwzVNnXmmrJ0IyhQ+u5oOe9C8+ARK1lJsbuw0gwNn0PtWgK1PrZM5/J/9CGmC/wiB8BkpdAgXoOwKBgE5fa3Wc0al7CGo9UVX7yKc49UUX+vMlKGYz55djJWwjB4NzOz6PRl1Qv5IrstlBO5aO9aEV+8GOw72R6AKTYNYw4aGo2chp8sbHpIpIk+6kZzwVKuWTO7NtLNEF1pBkQszsUWUNYQRZWIpgLsKm+I5db8VyZrOTR6t//DoUN9RhAoGAQLNaaULlw5L2Qsq9hbsdZVkbZN6YY4oiqMufmDKavbpUvchagFBe7/bneX4orza+DiC4vBFDIUOsZawB9eStx8hvL4AcuUF+eoZT3FCmvHB8dAYs4vok28f1nqUpYLmu4yN+wc/sLhihaJd7keErc987/E8mxW18AEin4Q4pKK8=
|
||||
#支付宝公钥字符串
|
||||
public-key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoR1gAyrjj/XugdKT3zUJBJksYnCXxD3RDiBex+JGfo6oO0oPbyoIQb2cAIIJjCCxT97QATlbYpRGMa+RuXxlxTeBh5ZFkELOsGc/UX0d9Tm51UvN+OV5pyysytlRdZfVgOETORzv9CvfnK7ND1SSHUPDan7TkMoVFipmQnf8205V3tcsDBat5kHEPFCmWXkPxrtLPVge1dAtKSRW9KFMslXkKrspvF1fSLGt12CE38ZwzP39INKgaI+RbIk3o7aRW5CrLqPkYdrgE1KcFBOj/gJXqbZvL/30q1KVn29UQUYm9SR/n6ZaLlAG38p4O3dL9Lu2lGhTBQlUr2qtpo+g8QIDAQAB
|
||||
#填写您的支付类接口异步通知接收服务地址,例如:https://www:test:com/callback:
|
||||
notify-url: http://50148a0b.ngrok.io/pay/aliPay/notify
|
||||
#支付成功跳转页面
|
||||
return-url: http://127.0.0.1:8080/user/userinfo.html
|
||||
#签名方式
|
||||
sign-type: RSA2
|
||||
#编码
|
||||
charset: utf-8
|
||||
#支付宝网关
|
||||
gateway-url: https://openapi.alipaydev.com/gateway.do
|
@ -4,6 +4,7 @@ server:
|
||||
spring:
|
||||
profiles:
|
||||
active: dev
|
||||
include: alipay
|
||||
|
||||
jwt:
|
||||
secret: novel!#20191230
|
||||
@ -23,3 +24,6 @@ xss:
|
||||
excludes: /system/notice/*
|
||||
# 匹配链接 (多个用逗号分隔)
|
||||
urlPatterns: /book/addBookComment,/user/addFeedBack
|
||||
|
||||
|
||||
|
||||
|
BIN
novel-front/src/main/resources/static/images/pay_wx.png
Normal file
BIN
novel-front/src/main/resources/static/images/pay_wx.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
BIN
novel-front/src/main/resources/static/images/pay_zfb.png
Normal file
BIN
novel-front/src/main/resources/static/images/pay_zfb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
@ -1,6 +1,6 @@
|
||||
var needLoginPath = ['/user/favorites.html','/user/comment.html','/user/feedback.html',
|
||||
'/user/feedback_list.html','/user/read_history.html','/user/set_name.html',
|
||||
'/user/set_password.html','/user/set_sex.html','/user/setup.html','/user/userinfo.html'];
|
||||
'/user/set_password.html','/user/set_sex.html','/user/setup.html','/user/userinfo.html',"/pay/index.html"];
|
||||
var isLogin = false;
|
||||
var url = window.location.search;
|
||||
//key(需要检索的键)
|
||||
|
93
novel-front/src/main/resources/static/javascript/pay.js
Normal file
93
novel-front/src/main/resources/static/javascript/pay.js
Normal file
@ -0,0 +1,93 @@
|
||||
var UserPay = {
|
||||
czData: [[30, "3000屋币"], [50, "5000屋币"], [100, "10000屋币"], [200, "20000屋币"], [500, "50000屋币"], [365, "全站包年阅读"] ],
|
||||
czPayPalData: [[20, "10000屋币"], [50, "25000屋币"], [100, "50000屋币"], [80, "全站包年阅读"]],
|
||||
sendPay: function () {
|
||||
$("#payform").submit();
|
||||
},
|
||||
GetPayState: function (payId) {
|
||||
$.post("/api/book.aspx", { act: "getpaystatus", pid: payId }, function (data, textStatus) {
|
||||
if (data == "1") {
|
||||
location.href = '/pay/wx_return.aspx?out_trade_no=sc'+payId;
|
||||
}
|
||||
else {
|
||||
setTimeout("UserPay.GetPayState("+payId+")",3000);
|
||||
}
|
||||
}, "html");
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#ulPayType li").click(function () {
|
||||
|
||||
if($(this).attr("valp")==2){
|
||||
layer.alert("微信支付暂未开通,敬请期待");
|
||||
}
|
||||
|
||||
return ;
|
||||
|
||||
|
||||
|
||||
$($(this).parent()).children().each(function () {
|
||||
$(this).removeClass("on");
|
||||
});
|
||||
$(this).addClass("on");
|
||||
|
||||
var type = $(this).attr("valp");
|
||||
if (type == "3") {
|
||||
$("#ulPayPal").show();
|
||||
$("#ulPayPalXJ").show();
|
||||
$("#ulZFWX").hide();
|
||||
$("#ulZFWXXJ").hide();
|
||||
}
|
||||
else {
|
||||
$("#ulPayPal").hide();
|
||||
$("#ulPayPalXJ").hide();
|
||||
$("#ulZFWX").show();
|
||||
$("#ulZFWXXJ").show();
|
||||
}
|
||||
|
||||
var postUrl = "";
|
||||
switch (type)
|
||||
{
|
||||
case "1":
|
||||
postUrl = "sendalipay.aspx";
|
||||
break;
|
||||
case "2":
|
||||
postUrl = "sendwxpaynowqr.aspx";
|
||||
break;
|
||||
case "3":
|
||||
postUrl = "sendpaypal.aspx";
|
||||
break;
|
||||
}
|
||||
$("#payform").attr("action", postUrl);
|
||||
})
|
||||
|
||||
$("#ulZFWX li").click(function () {
|
||||
$("#ulZFWX li").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
if ($(this).attr("vals") > 0) {
|
||||
$("#pValue").val($(this).attr("vals"));
|
||||
$("#showTotal").html('¥' + $(this).attr("vals") + '元');
|
||||
for (var i = 0; i < UserPay.czData.length; i++) {
|
||||
if (UserPay.czData[i][0] == $(this).attr("vals")) {
|
||||
$("#showRemark").html(UserPay.czData[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#ulPayPal li").click(function () {
|
||||
$("#ulPayPal li").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
if ($(this).attr("vals") > 0) {
|
||||
$("#pValue").val($(this).attr("vals"));
|
||||
$("#showPayPalTotal").html($(this).attr("vals") + '美元');
|
||||
for (var i = 0; i < UserPay.czData.length; i++) {
|
||||
if (UserPay.czPayPalData[i][0] == $(this).attr("vals")) {
|
||||
$("#showPayPalRemark").html(UserPay.czPayPalData[i][1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
@ -42,7 +42,7 @@
|
||||
<li th:class="${navType}==0?'on':''"><a href="/">首页</a></li>
|
||||
<li th:class="${navType}==1?'on':''"><a href="/book/bookclass.html">全部作品</a></li>
|
||||
<li th:class="${navType}==2?'on':''"><a href="/book/book_ranking.html">排行榜</a></li>
|
||||
<li class=""><a href="javascript:layer.alert('待开通,敬请期待!');">充值</a></li>
|
||||
<li class=""><a href="/pay/index.html">充值</a></li>
|
||||
<li><a href="javascript:layer.alert('待开通,敬请期待!');">作家专区</a></li>
|
||||
|
||||
</ul>
|
||||
|
139
novel-front/src/main/resources/templates/pay/index.html
Normal file
139
novel-front/src/main/resources/templates/pay/index.html
Normal file
@ -0,0 +1,139 @@
|
||||
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head th:replace="common/header :: common_head(~{::title},~{},~{::link})">
|
||||
<title th:text="'充值_'+#{website.name}"></title>
|
||||
<link rel="stylesheet" href="/css/base.css"/>
|
||||
<link rel="stylesheet" href="/css/main.css"/>
|
||||
</head>
|
||||
<body class="">
|
||||
|
||||
<div th:replace="common/top :: top('')">
|
||||
</div>
|
||||
|
||||
<form action="/pay/aliPay" method="post" id="payform" name="payform">
|
||||
<div class="main box_center cf">
|
||||
|
||||
<div class="channelWrap channelPay cf">
|
||||
|
||||
<div class="payBox cf">
|
||||
<div class="payHead cf">
|
||||
<div class="fl">
|
||||
充值账号:<span class="user_name" id="my_name"></span>余额:<em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+0</em>代金券-->
|
||||
</div>
|
||||
<!--<div class="fr">
|
||||
<a class="btn_gray" href="/user/pay_record.aspx" target="_blank">充值记录</a><a class="btn_gray" href="/user/my_order.aspx" target="_blank">消费记录</a>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="payCon">
|
||||
<h5>选择充值方式</h5>
|
||||
<ul class="pay_way cf" id="ulPayType">
|
||||
<li class="on" valp="1"><img class="pay_pic" src="../images/pay_zfb.png" alt="支付宝支付" /></li>
|
||||
<li valp="2"><img class="pay_pic" src="../images/pay_wx.png" alt="微信支付" /></li>
|
||||
|
||||
</ul>
|
||||
<h5>选择充值金额</h5>
|
||||
<ul class="pay_way cf" id="ulZFWX">
|
||||
<li vals="10"><strong>10元</strong><span class="pay_mn">1000屋币</span></li>
|
||||
<li vals="30"><strong>30元</strong><span class="pay_mn">3000屋币</span></li>
|
||||
<li vals="50"><strong>50元</strong><span class="pay_mn">5000屋币<!--<em class="red">+ 送500代金券</em>--></span></li>
|
||||
<li vals="100"><strong>100元</strong><span class="pay_mn">10000屋币<!--<em class="red">+ 送1200代金券</em>--></span></li>
|
||||
<li vals="200"><strong>200元</strong><span class="pay_mn">20000屋币<!--<em class="red">+ 送3000代金券</em>--></span></li>
|
||||
<li vals="500"><strong>500元</strong><span class="pay_mn">50000屋币<!--<em class="red">+ 送10000代金券</em>--></span></li>
|
||||
</ul>
|
||||
<ul class="pay_way cf" style="display:none;" id="ulPayPal">
|
||||
<li vals="20"><strong>20美元</strong><span class="pay_mn">10000屋币</span></li>
|
||||
<li vals="50" class="on"><strong>50美元</strong><span class="pay_mn">25000屋币<em class="red"></em></span></li>
|
||||
<li vals="100"><strong>100美元</strong><span class="pay_mn">50000屋币<em class="red"></em></span></li>
|
||||
</ul>
|
||||
<ul class="pay_Checkout" id="ulZFWXXJ">
|
||||
<li>当前汇率:1元=100屋币</li>
|
||||
<li>总计金额:<em class="red" id="showTotal">¥50元</em> 获得 <em class="red" id="showRemark">5000屋币<!--+500代金券--></em></li>
|
||||
<li style="display:none"><a class="btn_red" href="pay_success.html" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
|
||||
</ul>
|
||||
<ul class="pay_Checkout" style="display:none;" id="ulPayPalXJ">
|
||||
<li>当前汇率:1美元=500屋币</li>
|
||||
<li>总计金额:<em class="red" id="showPayPalTotal">50美元</em> 获得 <em class="red" id="showPayPalRemark">25000屋币</em></li>
|
||||
<li style="display:none"><a class="btn_red" href="javascript:void(0);" onclick="javascript:UserPay.sendPay();">立即支付</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="payFoot">
|
||||
<strong class="tip_tit">温馨提示</strong>
|
||||
<ul class="tip_list">
|
||||
<li>1. 充值阅读权限仅限本书城使用</li>
|
||||
<li>2. 充值支持信用卡、借记卡、支付宝余额、微信零钱等支付</li>
|
||||
<li>3. 包年时间是365天,重复购买时间会累加</li>
|
||||
<li>4. 若充值遇到问题,<a href="/user/feedback.html" target="_blank" class="unlink black9">点此留言</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="pValue" name="payAmount" />
|
||||
</form>
|
||||
|
||||
|
||||
<div th:replace="common/footer :: footer">
|
||||
</div>
|
||||
<div th:replace="common/js :: js"></div>
|
||||
<script src="/javascript/pay.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
|
||||
//查询用户信息
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/user/userInfo",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.code == 200) {
|
||||
if(data.data.nickName){
|
||||
$("#my_name").html(data.data.nickName);
|
||||
}else{
|
||||
$("#my_name").html(data.data.username);
|
||||
}
|
||||
|
||||
$("#accountBalance").html(data.data.accountBalance);
|
||||
|
||||
} else if (data.code == 1001) {
|
||||
//未登录
|
||||
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||
|
||||
} else {
|
||||
layer.alert(data.msg);
|
||||
}
|
||||
|
||||
},
|
||||
error: function () {
|
||||
layer.alert('网络异常');
|
||||
}
|
||||
})
|
||||
|
||||
$("#ulZFWX").find("li").click(function () {
|
||||
|
||||
var payType = $("#ulPayType").find("li.on").attr("valp");
|
||||
|
||||
if(payType == 2){
|
||||
layer.alert("微信支付暂未开通,敬请期待");
|
||||
return ;
|
||||
}
|
||||
|
||||
$("#pValue").val($(this).attr("vals"));
|
||||
|
||||
$("#payform").submit();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
@ -30,7 +30,7 @@
|
||||
<p class="my_name" id="my_name">
|
||||
</p>
|
||||
<ul class="my_list">
|
||||
<li class="my_gold"><i>账户余额:</i><em class="red">0</em>屋币<em class="red">+</em><em class="red">0</em>代金券<a href="javascript:layer.alert('充值通道待开通,敬请期待!');" class="btn_link">立即充值</a></li>
|
||||
<li class="my_gold"><i>账户余额:</i><em class="red" id="accountBalance">0</em>屋币<!--<em class="red">+</em><em class="red">0</em>代金券--><a href="/pay/index.html" class="btn_link">立即充值</a></li>
|
||||
<li class="my_baonian"></li>
|
||||
|
||||
</ul>
|
||||
@ -96,6 +96,8 @@
|
||||
$("#my_name").html(data.data.username);
|
||||
}
|
||||
|
||||
$("#accountBalance").html(data.data.accountBalance);
|
||||
|
||||
} else if (data.code == 1001) {
|
||||
//未登录
|
||||
location.href = '/user/login.html?originUrl=' + decodeURIComponent(location.href);
|
||||
|
50
novel.iml
50
novel.iml
@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
||||
<output url="file://$MODULE_DIR$/target/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.8" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.slf4j:jul-to-slf4j:1.7.28" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.slf4j:slf4j-api:1.7.28" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.9.16" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.16" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-core:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-jcl:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot:2.1.8.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-context:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-aop:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-beans:5.1.9.RELEASE" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-expression:5.1.9.RELEASE" level="project" />
|
||||
</component>
|
||||
</module>
|
33
sql/20200511.sql
Normal file
33
sql/20200511.sql
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
Navicat MySQL Data Transfer
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Version : 50725
|
||||
Source Host : localhost:3306
|
||||
Source Database : novel_plus
|
||||
|
||||
Target Server Type : MYSQL
|
||||
Target Server Version : 50725
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 2020-05-11 17:56:23
|
||||
*/
|
||||
|
||||
SET FOREIGN_KEY_CHECKS=0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for order_pay
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `order_pay`;
|
||||
CREATE TABLE `order_pay` (
|
||||
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`out_trade_no` bigint(20) NOT NULL COMMENT '商户订单号',
|
||||
`trade_no` varchar(64) DEFAULT NULL COMMENT '支付宝/微信交易号',
|
||||
`pay_channel` tinyint(1) NOT NULL DEFAULT '1' COMMENT '支付渠道,1:支付宝,2:微信',
|
||||
`total_amount` int(11) NOT NULL COMMENT '交易金额(单位元)',
|
||||
`user_id` bigint(20) NOT NULL COMMENT '支付用户ID',
|
||||
`pay_status` tinyint(1) DEFAULT '2' COMMENT '支付状态:0:支付失败,1:支付成功,2:待支付',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COMMENT='充值订单';
|
Loading…
x
Reference in New Issue
Block a user