mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-09-03 05:24:28 +08:00
pay java web支持组件
This commit is contained in:
42
pay-java-web-support/pom.xml
Normal file
42
pay-java-web-support/pom.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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>
|
||||
<artifactId>pay-java-parent</artifactId>
|
||||
<groupId>com.egzosn</groupId>
|
||||
<version>2.14.2-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>pay-java-web-support</artifactId>
|
||||
<description>Pay Java Web 相关支持</description>
|
||||
<properties>
|
||||
<spring.version>4.3.4.RELEASE</spring.version>
|
||||
<junit.version>4.10</junit.version>
|
||||
<hibernate.version>4.3.6.Final</hibernate.version>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.egzosn</groupId>
|
||||
<artifactId>pay-java-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.egzosn.pay.web.support;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.egzosn.pay.common.bean.NoticeRequest;
|
||||
|
||||
/**
|
||||
* web 相关请求支持
|
||||
*
|
||||
* @author Egan
|
||||
* <pre>
|
||||
* email egzosn@gmail.com
|
||||
* date 2021/8/16
|
||||
* </pre>
|
||||
*/
|
||||
public class HttpRequestNoticeParams implements NoticeRequest {
|
||||
|
||||
|
||||
private final HttpServletRequest httpServletRequest;
|
||||
|
||||
public HttpRequestNoticeParams(HttpServletRequest httpServletRequest) {
|
||||
this.httpServletRequest = httpServletRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据请求头名称获取请求头信息
|
||||
*
|
||||
* @param name 名称
|
||||
* @return 请求头值
|
||||
*/
|
||||
@Override
|
||||
public String getHeader(String name) {
|
||||
return httpServletRequest.getHeader(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据请求头名称获取请求头信息
|
||||
*
|
||||
* @param name 名称
|
||||
* @return 请求头值
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> getHeaders(String name) {
|
||||
return httpServletRequest.getHeaders(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的请求头名称
|
||||
*
|
||||
* @return 请求头名称
|
||||
*/
|
||||
@Override
|
||||
public Enumeration<String> getHeaderNames() {
|
||||
return httpServletRequest.getHeaderNames();
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入流
|
||||
*
|
||||
* @return 输入流
|
||||
* @throws IOException IOException
|
||||
*/
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return httpServletRequest.getInputStream();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有的请求参数
|
||||
*
|
||||
* @return 请求参数
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
return httpServletRequest.getParameterMap();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user