-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#11] feat httpRequest and http response inject
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ttp-springboot-starter/src/main/java/sky/starter/bean/impl/HttpServerRequestResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package sky.starter.bean.impl; | ||
|
||
import http.HttpServerRequest; | ||
import http.HttpServerResponse; | ||
import io.github.fzdwx.lambada.lang.NvMap; | ||
import sky.starter.domain.SkyHttpMethod; | ||
import sky.starter.ext.RequestArgumentResolver; | ||
|
||
/** | ||
* @author <a href="mailto:likelovec@gmail.com">fzdwx</a> | ||
* @date 2022/5/21 18:18 | ||
*/ | ||
public class HttpServerRequestResolver implements RequestArgumentResolver { | ||
|
||
@Override | ||
public boolean support(final SkyHttpMethod.SkyHttpMethodParameter parameter) { | ||
return HttpServerRequest.class.equals(parameter.getParameterType()); | ||
} | ||
|
||
@Override | ||
public Object apply(final HttpServerRequest request, final HttpServerResponse response, final SkyHttpMethod.SkyHttpMethodParameter parameter, | ||
final NvMap parVals) { | ||
return request; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...tp-springboot-starter/src/main/java/sky/starter/bean/impl/HttpServerResponseResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package sky.starter.bean.impl; | ||
|
||
import http.HttpServerRequest; | ||
import http.HttpServerResponse; | ||
import io.github.fzdwx.lambada.lang.NvMap; | ||
import sky.starter.domain.SkyHttpMethod; | ||
import sky.starter.ext.RequestArgumentResolver; | ||
|
||
/** | ||
* @author <a href="mailto:likelovec@gmail.com">fzdwx</a> | ||
* @date 2022/5/21 18:19 | ||
*/ | ||
public class HttpServerResponseResolver implements RequestArgumentResolver { | ||
|
||
@Override | ||
public boolean support(final SkyHttpMethod.SkyHttpMethodParameter parameter) { | ||
return HttpServerResponse.class.equals(parameter.getParameterType()); | ||
} | ||
|
||
@Override | ||
public Object apply(final HttpServerRequest request, final HttpServerResponse response, final SkyHttpMethod.SkyHttpMethodParameter parameter, | ||
final NvMap parVals) { | ||
return response; | ||
} | ||
} |