Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-execute-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 0535cee7
authored
Oct 09, 2023
by
chizw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
sop短链 删除多余类
1 parent
42032496
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
101 deletions
platform-execute/src/main/java/cn/com/glsx/execute/common/constant/shorturl/TransformContext.java
platform-execute/src/main/java/cn/com/glsx/execute/common/constant/shorturl/TransformContext.java
deleted
100644 → 0
View file @
4203249
package
cn
.
com
.
glsx
.
execute
.
common
.
constant
.
shorturl
;
import
cn.com.glsx.execute.modules.enums.shorturl.TransformStatus
;
import
com.alibaba.ttl.TransmittableThreadLocal
;
import
com.google.common.collect.Maps
;
import
lombok.Data
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* @Description
* @author chizw
* @create 2023/9/18 22:05
* @version ver.1.0.0
*/
@Data
public
class
TransformContext
{
public
static
final
String
PARAM_CLIENT_ID_KEY
=
"CLIENT_ID"
;
public
static
final
String
PARAM_UA_KEY
=
"UA"
;
public
static
final
String
PARAM_COOKIE_KEY
=
"COOKIE"
;
public
static
final
String
PARAM_SHORT_URL_KEY
=
"SL"
;
public
static
final
String
PARAM_LONG_URL_KEY
=
"LL"
;
public
static
final
String
PARAM_TARGET_LONG_URL_KEY
=
"RLL"
;
public
static
final
String
PARAM_REMOTE_HOST_NAME_KEY
=
"RHN"
;
public
static
final
String
PARAM_QUERY_STRING_KEY
=
"QS"
;
public
static
final
String
PARAM_REQUEST_URL_KEY
=
"URL"
;
public
static
final
String
PARAM_PROTOCOL_KEY
=
"PROTOCOL"
;
public
static
final
String
PARAM_PORT_KEY
=
"PORT"
;
public
static
final
String
PARAM_SERVER_WEB_EXCHANGE_KEY
=
"__SWE__"
;
private
HttpServletRequest
request
;
private
HttpServletResponse
response
;
final
ThreadLocal
<
Runnable
>
redirectAction
=
new
TransmittableThreadLocal
<>();
private
String
compressCode
;
private
TransformStatus
transformStatus
;
private
Map
<
String
,
String
>
headers
=
Maps
.
newHashMap
();
private
Map
<
String
,
Object
>
params
=
Maps
.
newHashMap
();
private
String
location
;
public
void
setTransformStatus
(
TransformStatus
transformStatus
)
{
this
.
transformStatus
=
transformStatus
;
}
public
Integer
getTransformStatusValue
()
{
return
transformStatus
.
getValue
();
}
public
void
addHeader
(
String
key
,
String
value
)
{
headers
.
putIfAbsent
(
key
,
value
);
}
public
void
setHeader
(
String
key
,
String
value
)
{
headers
.
put
(
key
,
value
);
}
public
String
getHeader
(
String
key
)
{
return
headers
.
get
(
key
);
}
public
void
releaseHeaders
()
{
headers
=
null
;
}
public
void
addParam
(
String
key
,
Object
value
)
{
params
.
putIfAbsent
(
key
,
value
);
}
public
void
setParam
(
String
key
,
Object
value
)
{
params
.
put
(
key
,
value
);
}
@SuppressWarnings
(
"unchecked"
)
public
<
T
>
T
getParam
(
String
key
)
{
return
(
T
)
params
.
get
(
key
);
}
public
void
setRedirectAction
(
Runnable
redirectAction
)
{
this
.
redirectAction
.
set
(
redirectAction
);
}
public
Runnable
getRedirectAction
()
{
Runnable
redirectAction
=
this
.
redirectAction
.
get
();
return
Objects
.
nonNull
(
redirectAction
)
?
redirectAction
:
()
->
{};
}
public
void
release
()
{
headers
=
null
;
params
=
null
;
}
}
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment