Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EventTracking
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨林
EventTracking
Commits
e6501968
Commit
e6501968
authored
Jul 23, 2021
by
杨林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
埋点样例类
parent
f8bf8f80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
0 deletions
+90
-0
src/main/scala/model/TrackItem.scala
src/main/scala/model/TrackItem.scala
+39
-0
src/main/scala/tools/gziptools/GzipUtils.scala
src/main/scala/tools/gziptools/GzipUtils.scala
+51
-0
No files found.
src/main/scala/model/TrackItem.scala
0 → 100644
View file @
e6501968
package
model
/**
* Created with IntelliJ IDEA.
* Class: TrackItem
* Description:
* User: lin
* Date: 2021-07-22
* Time: 16:58
*/
case
class
TrackItem
(
track_id
:
Long
,
distinct_id
:
String
,
lib_detail
:
String
,
lib_version
:
String
,
lib
:
String
,
app_version
:
String
,
lib_method
:
String
,
event_name
:
String
,
`type`
:
String
,
properties
:
String
,
HOST
:
String
,
user_agent
:
String
,
ua_platform
:
String
,
ua_version
:
String
,
ua_language
:
String
,
`connection`
:
String
,
Pragma
:
String
,
cache_control
:
String
,
accept
:
String
,
accept_encoding
:
String
,
ip
:
String
,
ip_info
:
String
,
url
:
String
,
referrer
:
String
,
remark
:
String
,
user_id
:
String
,
created_at
:
String
)
src/main/scala/tools/gziptools/GzipUtils.scala
0 → 100644
View file @
e6501968
package
tools.gziptools
import
java.io.ByteArrayOutputStream
import
java.nio.charset.
{
Charset
,
StandardCharsets
}
import
java.util.zip.GZIPOutputStream
/**
* Created with IntelliJ IDEA.
* Class: GzipUtils
* Description: 压缩解压缩工具
* User: lin
* Date: 2021-07-20
* Time: 13:30
*/
object
GzipUtils
{
/**
* 压缩方法
*
* @param str 要压缩的字符串
* @param charset 字符串编码
* @return 压缩后的字符串
*/
def
compress
(
str
:
String
,
charset
:
Charset
)
:
String
=
{
if
(
str
.
isEmpty
)
{
return
""
}
val
out
=
new
ByteArrayOutputStream
()
var
gzip
:
GZIPOutputStream
=
null
try
{
gzip
=
new
GZIPOutputStream
(
out
)
gzip
.
write
(
str
.
getBytes
(
charset
))
gzip
.
close
()
}
catch
{
case
exception
:
Exception
=>
exception
.
printStackTrace
()
}
out
.
toString
(
charset
)
}
/**
* 默认字符集为UTF_8压缩
*
* @param str 要压缩的字符串
* @return 压缩后的字符串
*/
def
compress
(
str
:
String
)
:
String
=
{
compress
(
str
,
StandardCharsets
.
UTF_8
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment