Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
7d6813e5
Commit
7d6813e5
authored
Sep 07, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
needinfoSve
parent
8c1e5d04
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
1 deletions
+87
-1
gsb-marketplat/app/base/api/impl/action/mediaaggregation.js
+4
-0
gsb-marketplat/app/base/service/impl/media/needinfoSve.js
+79
-0
gsb-marketplat/app/config/settings.js
+4
-1
gsb-marketplat/dochelp/media_doc.docx
+0
-0
No files found.
gsb-marketplat/app/base/api/impl/action/mediaaggregation.js
View file @
7d6813e5
...
@@ -26,6 +26,7 @@ class Mediaaggregation extends APIBase {
...
@@ -26,6 +26,7 @@ class Mediaaggregation extends APIBase {
var
opResult
=
null
;
var
opResult
=
null
;
var
self
=
this
;
var
self
=
this
;
pobj
.
xctx
=
req
.
xctx
;
pobj
.
xctx
=
req
.
xctx
;
pobj
.
clientIp
=
req
.
clientIp
;
switch
(
action_type
)
{
switch
(
action_type
)
{
case
"test"
:
//测试
case
"test"
:
//测试
opResult
=
system
.
getResultSuccess
(
"测试接口"
);
opResult
=
system
.
getResultSuccess
(
"测试接口"
);
...
@@ -33,6 +34,9 @@ class Mediaaggregation extends APIBase {
...
@@ -33,6 +34,9 @@ class Mediaaggregation extends APIBase {
case
"submitNeed"
:
//提交需求/线索
case
"submitNeed"
:
//提交需求/线索
opResult
=
this
.
needinfoSve
.
submitNeed
(
pobj
);
opResult
=
this
.
needinfoSve
.
submitNeed
(
pobj
);
break
;
break
;
case
"addbrowsingrecord"
:
//添加页面访问记录
opResult
=
this
.
needinfoSve
.
addbrowsingrecord
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
gsb-marketplat/app/base/service/impl/media/needinfoSve.js
View file @
7d6813e5
...
@@ -7,6 +7,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -7,6 +7,7 @@ class NeedinfoService extends ServiceBase {
super
(
"media"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
super
(
"media"
,
ServiceBase
.
getDaoName
(
NeedinfoService
));
this
.
launchchannelDao
=
system
.
getObject
(
"db.configmag.launchchannelDao"
);
this
.
launchchannelDao
=
system
.
getObject
(
"db.configmag.launchchannelDao"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
execClient
=
system
.
getObject
(
"util.execClient"
);
this
.
mediabrowsingRecordsLogUrl
=
settings
.
mediabrowsingRecordsLogUrl
();
}
}
//提交商机/线索
//提交商机/线索
async
submitNeed
(
pobj
){
async
submitNeed
(
pobj
){
...
@@ -79,6 +80,83 @@ class NeedinfoService extends ServiceBase {
...
@@ -79,6 +80,83 @@ class NeedinfoService extends ServiceBase {
console
.
log
(
e
,
"pushMediaNeed2Queue++++++++++++++++++++++++++++++++++++"
)
console
.
log
(
e
,
"pushMediaNeed2Queue++++++++++++++++++++++++++++++++++++"
)
}
}
}
}
//添加媒体聚合页浏览记录
async
addbrowsingrecord
(
pobj
){
if
(
pobj
&&
pobj
.
actionBody
){
var
addObj
=
pobj
.
actionBody
||
{};
if
(
!
addObj
.
channel_code
){
addObj
.
channel_code
=
"未知"
;
}
if
(
!
addObj
.
channel_name
){
addObj
.
channel_name
=
"未知"
;
}
if
(
!
addObj
.
platform
){
addObj
.
platform
=
"未知"
;
}
if
(
!
addObj
.
equipment
){
addObj
.
equipment
=
"未知"
;
}
if
(
!
addObj
.
page_code
){
addObj
.
page_code
=
"未知"
;
}
if
(
!
addObj
.
page_name
){
addObj
.
page_name
=
"未知"
;
}
var
myDate
=
new
Date
();
addObj
[
"created_year"
]
=
myDate
.
getFullYear
();
addObj
[
"created_month"
]
=
myDate
.
getMonth
()
+
1
;
addObj
[
"created_day"
]
=
myDate
.
getDate
();
addObj
[
"created_date"
]
=
myDate
.
getTime
();
if
(
pobj
.
clientIp
){
addObj
.
clientIp
=
pobj
.
clientIp
;
var
list
=
await
this
.
getbrowsingrecordlist
(
pobj
.
clientIp
,
myDate
.
getTime
());
if
(
list
&&
list
.
length
>=
60
){
addObj
.
is_warning
=
1
;
}
}
var
res
=
await
this
.
execClient
.
execPostEs
(
addObj
,
this
.
mediabrowsingRecordsLogUrl
);
}
return
system
.
getResultSuccess
();
}
async
getbrowsingrecordlist
(
ip
,
time
){
time
=
time
-
60
*
1000
;
var
queryObj
=
{
"query"
:
{
"bool"
:
{
"must"
:
[
{
"term"
:
{
"clientIp"
:
ip
}
},
{
"range"
:
{
"created_date"
:
{
"gte"
:
time
}
}
}
],
"must_not"
:
[],
"should"
:
[]
}
},
"from"
:
0
,
"size"
:
60
,
"sort"
:
[],
"aggs"
:
{}
};
var
res
=
await
this
.
execClient
.
execPostEs
(
queryObj
,
"http://43.247.184.94:7200/marketmedia_browsingrecords_log/_search"
);
if
(
res
&&
res
.
stdout
){
res
=
JSON
.
parse
(
res
.
stdout
);
if
(
res
.
hits
&&
res
.
hits
.
hits
){
return
res
.
hits
.
hits
;
}
}
return
null
;
}
}
}
module
.
exports
=
NeedinfoService
;
module
.
exports
=
NeedinfoService
;
\ No newline at end of file
gsb-marketplat/app/config/settings.js
View file @
7d6813e5
...
@@ -31,9 +31,12 @@ var settings = {
...
@@ -31,9 +31,12 @@ var settings = {
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
return
"http://logs-sytxpublic-msgq-service/api/queueAction/producer/springBoard"
;
}
}
},
},
browsingRecordsLogUrl
:
function
()
{
browsingRecordsLogUrl
:
function
()
{
//落地页访问记录
return
"http://43.247.184.94:7200/marketplat_browsingrecords_log/_doc?pretty"
;
return
"http://43.247.184.94:7200/marketplat_browsingrecords_log/_doc?pretty"
;
},
},
mediabrowsingRecordsLogUrl
:
function
()
{
//媒体聚合页访问记录
return
"http://43.247.184.94:7200/marketmedia_browsingrecords_log/_doc?pretty"
;
},
templateLinkUrl
:
function
()
{
templateLinkUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.200.208:8081/tfhref"
;
return
"http://192.168.200.208:8081/tfhref"
;
...
...
gsb-marketplat/dochelp/media_doc.docx
100644 → 100755
View file @
7d6813e5
No preview for this file type
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