Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
middleware-automatic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenjunjie
middleware-automatic
Commits
a28cd5b2
Commit
a28cd5b2
authored
May 26, 2023
by
liuyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature' into 'release'
2023年05/26 模板记录添加标题。模板详情dubbo接口bug修复 See merge request
!70
parents
c375014c
2cc05d90
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
34 deletions
+56
-34
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/PageVO.java
+42
-21
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/TemplateRecord.java
+5
-1
middleware-automatic-center-server/src/main/java/com/zhiwei/middleware/automatic/server/service/impl/TemplateTitleServiceImpl.java
+8
-11
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceCommon.java
+1
-1
No files found.
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/PageVO.java
View file @
a28cd5b2
...
@@ -4,37 +4,57 @@ import java.io.Serializable;
...
@@ -4,37 +4,57 @@ import java.io.Serializable;
import
java.util.List
;
import
java.util.List
;
public
class
PageVO
<
T
>
implements
Serializable
{
public
class
PageVO
<
T
>
implements
Serializable
{
int
index
;
/**
* 当前页数
int
pageSize
;
*/
private
int
page
;
long
total
;
/**
* 总记录数
*/
private
int
total
;
/**
* 总页数
*/
private
int
totalPage
;
/**
* 每页显示的记录数
*/
private
int
pageLimit
;
/**
* 每页显示数据记录的集合;
*/
private
List
<
T
>
list
;
public
int
getPage
()
{
return
page
;
}
List
<
T
>
list
;
public
void
setPage
(
int
page
)
{
this
.
page
=
page
;
}
public
int
get
Index
()
{
public
int
get
Total
()
{
return
index
;
return
total
;
}
}
public
void
set
Index
(
int
index
)
{
public
void
set
Total
(
int
total
)
{
this
.
index
=
index
;
this
.
total
=
total
;
}
}
public
int
get
PageSiz
e
()
{
public
int
get
TotalPag
e
()
{
return
pageSiz
e
;
return
totalPag
e
;
}
}
public
void
set
PageSize
(
int
pageSiz
e
)
{
public
void
set
TotalPage
(
int
totalPag
e
)
{
this
.
pageSize
=
pageSiz
e
;
this
.
totalPage
=
totalPag
e
;
}
}
public
long
getTotal
()
{
public
int
getPageLimit
()
{
return
total
;
return
pageLimit
;
}
}
public
void
set
Total
(
long
total
)
{
public
void
set
PageLimit
(
int
pageLimit
)
{
this
.
total
=
total
;
this
.
pageLimit
=
pageLimit
;
}
}
public
List
<
T
>
getList
()
{
public
List
<
T
>
getList
()
{
...
@@ -45,10 +65,11 @@ public class PageVO <T> implements Serializable {
...
@@ -45,10 +65,11 @@ public class PageVO <T> implements Serializable {
this
.
list
=
list
;
this
.
list
=
list
;
}
}
public
PageVO
(
int
index
,
int
pageSize
,
long
total
,
List
<
T
>
t
)
{
public
PageVO
(
int
page
,
int
pageSize
,
int
total
,
List
<
T
>
t
)
{
this
.
index
=
index
;
this
.
page
=
page
;
this
.
page
Size
=
pageSize
;
this
.
page
Limit
=
pageSize
;
this
.
total
=
total
;
this
.
total
=
total
;
this
.
totalPage
=
(
total
+
pageSize
-
1
)
/
pageSize
;
this
.
list
=
t
;
this
.
list
=
t
;
}
}
}
}
middleware-automatic-center-client/src/main/java/com/zhiwei/middleware/automatic/server/pojo/TemplateRecord.java
View file @
a28cd5b2
...
@@ -14,6 +14,8 @@ public class TemplateRecord {
...
@@ -14,6 +14,8 @@ public class TemplateRecord {
*/
*/
private
String
templateId
;
private
String
templateId
;
private
String
title
;
private
String
esId
;
private
String
esId
;
private
String
url
;
private
String
url
;
...
@@ -38,8 +40,9 @@ public class TemplateRecord {
...
@@ -38,8 +40,9 @@ public class TemplateRecord {
public
TemplateRecord
()
{}
public
TemplateRecord
()
{}
public
TemplateRecord
(
String
templateId
,
String
esId
,
String
url
,
String
pt
,
String
source
,
String
realSource
,
String
time
,
String
mupdate
)
{
public
TemplateRecord
(
String
templateId
,
String
title
,
String
esId
,
String
url
,
String
pt
,
String
source
,
String
realSource
,
String
time
,
String
mupdate
)
{
this
.
templateId
=
templateId
;
this
.
templateId
=
templateId
;
this
.
title
=
title
;
this
.
mupdate
=
mupdate
;
this
.
mupdate
=
mupdate
;
this
.
esId
=
esId
;
this
.
esId
=
esId
;
this
.
url
=
url
;
this
.
url
=
url
;
...
@@ -52,6 +55,7 @@ public class TemplateRecord {
...
@@ -52,6 +55,7 @@ public class TemplateRecord {
public
JSONObject
toJson
()
{
public
JSONObject
toJson
()
{
JSONObject
json
=
new
JSONObject
();
JSONObject
json
=
new
JSONObject
();
json
.
put
(
"title"
,
title
);
json
.
put
(
"url"
,
url
);
json
.
put
(
"url"
,
url
);
json
.
put
(
"pt"
,
pt
);
json
.
put
(
"pt"
,
pt
);
json
.
put
(
"source"
,
source
);
json
.
put
(
"source"
,
source
);
...
...
middleware-automatic-center-server/src/main/java/com/zhiwei/middleware/automatic/server/service/impl/TemplateTitleServiceImpl.java
View file @
a28cd5b2
...
@@ -59,10 +59,6 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
...
@@ -59,10 +59,6 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
}
}
int
i
=
0
;
int
i
=
0
;
for
(
String
key
:
templateTitleVoMap
.
keySet
())
{
for
(
String
key
:
templateTitleVoMap
.
keySet
())
{
// 返回数量达到指定分页数
if
(
res
.
size
()
==
size
)
{
break
;
}
TemplateTitleVo
templateTitleVo
=
templateTitleVoMap
.
get
(
key
);
TemplateTitleVo
templateTitleVo
=
templateTitleVoMap
.
get
(
key
);
long
createTime
=
templateTitleVo
.
getCreateTime
().
getTime
();
long
createTime
=
templateTitleVo
.
getCreateTime
().
getTime
();
long
updateTime
=
templateTitleVo
.
getUpdateTime
().
getTime
();
long
updateTime
=
templateTitleVo
.
getUpdateTime
().
getTime
();
...
@@ -80,10 +76,10 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
...
@@ -80,10 +76,10 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
continue
;
continue
;
}
}
i
++;
i
++;
// 分页过滤
//
// 分页过滤
if
(
limit
>=
i
)
{
//
if (limit >= i) {
continue
;
//
continue;
}
//
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"templateTitle"
,
key
);
map
.
put
(
"templateTitle"
,
key
);
map
.
put
(
"project"
,
project
);
map
.
put
(
"project"
,
project
);
...
@@ -94,11 +90,12 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
...
@@ -94,11 +90,12 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
map
.
put
(
"daySum"
,
templateTitleVo
.
getDaySum
());
map
.
put
(
"daySum"
,
templateTitleVo
.
getDaySum
());
map
.
put
(
"mtag"
,
templateTitleVo
.
getMtag
());
map
.
put
(
"mtag"
,
templateTitleVo
.
getMtag
());
map
.
put
(
"url"
,
templateTitleVo
.
getUrl
());
map
.
put
(
"url"
,
templateTitleVo
.
getUrl
());
map
.
put
(
"id"
,
templateTitleVo
.
getId
());
res
.
add
(
map
);
res
.
add
(
map
);
}
}
Tools
.
sortByField
(
res
,
orderField
,
isAsc
);
Tools
.
sortByField
(
res
,
orderField
,
isAsc
);
resultMap
.
put
(
"count"
,
templateTitleVoMap
.
size
());
resultMap
.
put
(
"count"
,
templateTitleVoMap
.
size
());
resultMap
.
put
(
"list"
,
res
);
resultMap
.
put
(
"list"
,
res
.
subList
(
limit
,
Math
.
min
((
limit
+
size
),
res
.
size
()))
);
return
resultMap
;
return
resultMap
;
}
}
...
@@ -201,9 +198,9 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
...
@@ -201,9 +198,9 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
.
skip
(
skip
).
limit
(
pageSize
).
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"_id"
));
.
skip
(
skip
).
limit
(
pageSize
).
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"_id"
));
long
count
=
templateRecordDao
.
count
(
query
);
long
count
=
templateRecordDao
.
count
(
query
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
new
PageVO
<>(
skip
,
pageSize
,
count
,
Collections
.
emptyList
());
return
new
PageVO
<>(
skip
,
pageSize
,
(
int
)
count
,
Collections
.
emptyList
());
}
}
return
new
PageVO
<>(
skip
,
pageSize
,
count
,
templateRecordDao
.
findTemplateRecord
(
query
).
stream
().
map
(
TemplateRecord:
:
toJson
).
collect
(
Collectors
.
toList
()));
return
new
PageVO
<>(
skip
,
pageSize
,
(
int
)
count
,
templateRecordDao
.
findTemplateRecord
(
query
).
stream
().
map
(
TemplateRecord:
:
toJson
).
collect
(
Collectors
.
toList
()));
}
}
...
...
middleware-automatic-center-son/src/main/java/com/zhiwei/middleware/automatic/son/task/service/TaskServiceCommon.java
View file @
a28cd5b2
...
@@ -243,7 +243,7 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
...
@@ -243,7 +243,7 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
templateTitleVo
.
refreshMark
();
templateTitleVo
.
refreshMark
();
String
id
=
sourceObj
.
getString
(
"_id"
);
String
id
=
sourceObj
.
getString
(
"_id"
);
// // 特征值记录
// // 特征值记录
templateTitleService
.
insertTemplateRecord
(
new
TemplateRecord
(
templateTitleVo
.
getId
(),
id
,
getUrl
(
markInfo
),
getPlatform
(
markInfo
),
templateTitleService
.
insertTemplateRecord
(
new
TemplateRecord
(
templateTitleVo
.
getId
(),
title
,
id
,
getUrl
(
markInfo
),
getPlatform
(
markInfo
),
sourceObj
.
getString
(
"source"
),
sourceObj
.
getString
(
"real_source"
),
Tools
.
TIME_FORMAT
.
format
(
sourceObj
.
getLong
(
"time"
)),
updates
[
0
]));
sourceObj
.
getString
(
"source"
),
sourceObj
.
getString
(
"real_source"
),
Tools
.
TIME_FORMAT
.
format
(
sourceObj
.
getLong
(
"time"
)),
updates
[
0
]));
// 测试环境临时添加,用于对比
// 测试环境临时添加,用于对比
templateRecordDao
.
tempRecord
(
new
TemplateTempRecord
(
templateTitleVo
.
getId
(),
templateTitleVo
.
getTemplateTitle
(),
group
,
getUrl
(
markInfo
),
templateRecordDao
.
tempRecord
(
new
TemplateTempRecord
(
templateTitleVo
.
getId
(),
templateTitleVo
.
getTemplateTitle
(),
group
,
getUrl
(
markInfo
),
...
...
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