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
c1649e5a
Commit
c1649e5a
authored
Sep 18, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
313b83f6
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
38 deletions
+93
-38
gsb-marketplat-mag/app/base/controller/impl/aggregation/picturewarehouseCtl.js
+4
-0
gsb-marketplat-mag/app/base/controller/impl/aggregation/rotationchartCtl.js
+2
-2
gsb-marketplat-mag/app/base/service/impl/aggregation/cycleproductSve.js
+7
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/picturewarehouseSve.js
+20
-28
gsb-marketplat-mag/app/base/service/impl/aggregation/popularrecommendationSve.js
+4
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/redisdelSve.js
+23
-0
gsb-marketplat-mag/app/base/service/impl/aggregation/rotationchartSve.js
+33
-8
No files found.
gsb-marketplat-mag/app/base/controller/impl/aggregation/picturewarehouseCtl.js
View file @
c1649e5a
...
...
@@ -16,5 +16,9 @@ class PictureWarehouseCtl extends CtlBase {
const
up
=
await
this
.
service
.
update
(
pobj
);
return
up
;
}
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
up
;
}
}
module
.
exports
=
PictureWarehouseCtl
;
gsb-marketplat-mag/app/base/controller/impl/aggregation/rotationchartCtl.js
View file @
c1649e5a
...
...
@@ -20,8 +20,8 @@ class RotationChartCtl extends CtlBase {
return
up
;
}
async
updates
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
updates
(
pobj
);
async
delete
(
pobj
,
qobj
,
req
)
{
const
up
=
await
this
.
service
.
delete
(
pobj
);
return
up
;
}
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/cycleproductSve.js
View file @
c1649e5a
...
...
@@ -4,6 +4,7 @@ const settings = require("../../../../config/settings");
class
CycleproductService
extends
ServiceBase
{
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
CycleproductService
));
this
.
redisdel
=
system
.
getObject
(
"service.aggregation.redisdelSve"
);
}
async
update
(
pobj
)
{
...
...
@@ -16,6 +17,12 @@ class CycleproductService extends ServiceBase {
if
(
pobj
.
pic_describe
&&
pobj
.
pic_describe
.
length
>
19
)
{
return
system
.
getResultFail
(
-
105
,
"图片描述最多20位字符"
);
}
try
{
var
functionName
=
"cycleProduct"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/picturewarehouseSve.js
View file @
c1649e5a
...
...
@@ -4,20 +4,9 @@ const settings = require("../../../../config/settings");
class
PicturewarehouseService
extends
ServiceBase
{
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
PicturewarehouseService
));
this
.
redisdel
=
system
.
getObject
(
"service.aggregation.redisdelSve"
);
}
async
getImgList
(
pobj
)
{
let
res
=
await
this
.
dao
.
findAndCountAll
(
pobj
);
return
system
.
getResultSuccess
(
res
);
}
async
createImginfo
(
pobj
)
{
let
code
=
await
this
.
getBusUid
(
"img"
);
pobj
.
imginfo
.
code
=
code
;
if
(
pobj
.
imginfo
.
company_id
===
undefined
)
{
pobj
.
imginfo
.
company_id
=
10
;
}
let
res
=
await
this
.
dao
.
create
(
pobj
.
imginfo
);
return
system
.
getResultSuccess
(
res
);
}
async
create
(
pobj
)
{
let
code
=
await
this
.
getBusUid
(
"img"
);
pobj
.
code
=
code
;
...
...
@@ -29,24 +18,26 @@ class PicturewarehouseService extends ServiceBase {
async
update
(
pobj
)
{
let
whereParams
=
{
id
:
pobj
.
id
}
let
res
=
await
this
.
dao
.
findOne
(
whereParams
,[]);
if
(
!
pobj
.
id
){
return
system
.
getResultFail
(
-
124
,
"未知图片信息"
);
}
if
(
!
pobj
.
pic_url
){
pobj
.
pic_url
=
res
.
pic_url
;
}
if
(
!
pobj
.
pic_size
){
pobj
.
pic_size
=
res
.
pic_size
;
if
(
!
pobj
.
pic_url
)
{
return
system
.
getResultFail
(
-
123
,
"图片不能为空"
);
}
if
(
!
pobj
.
name
){
pobj
.
name
=
res
.
name
;
try
{
var
functionName
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
async
delete
(
pobj
)
{
try
{
var
functionName
=
"productDetail"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
delete
(
pobj
));
}
}
module
.
exports
=
PicturewarehouseService
;
\ No newline at end of file
gsb-marketplat-mag/app/base/service/impl/aggregation/popularrecommendationSve.js
View file @
c1649e5a
...
...
@@ -4,6 +4,7 @@ const settings = require("../../../../config/settings");
class
PopularrecommendationService
extends
ServiceBase
{
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
PopularrecommendationService
));
this
.
redisdel
=
system
.
getObject
(
"service.aggregation.redisdelSve"
);
}
async
update
(
pobj
)
{
...
...
@@ -17,6 +18,9 @@ class PopularrecommendationService extends ServiceBase {
if
(
pobj
.
pic_describe
&&
pobj
.
pic_describe
.
length
>
19
)
{
return
system
.
getResultFail
(
-
105
,
"图片描述最多20位字符"
);
}
var
functionName
=
"popularRecommendationList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
}
...
...
gsb-marketplat-mag/app/base/service/impl/aggregation/redisdelSve.js
0 → 100644
View file @
c1649e5a
const
ServiceBase
=
require
(
"../../sve.base"
);
const
system
=
require
(
"../../../system"
);
class
RedisdelService
extends
ServiceBase
{
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
RedisdelService
));
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
async
redisInfo
(
functionName
)
{
var
template
=
"mediaaggregation"
;
let
shaStr
;
let
rtn
;
shaStr
=
template
+
"_"
+
functionName
;
rtn
=
await
this
.
redisClient
.
get
(
shaStr
);
if
(
rtn
)
{
var
res
=
await
this
.
redisClient
.
delete
(
shaStr
);
return
res
;
}
}
}
module
.
exports
=
RedisdelService
;
\ No newline at end of file
gsb-marketplat-mag/app/base/service/impl/aggregation/rotationchartSve.js
View file @
c1649e5a
...
...
@@ -5,6 +5,7 @@ const { json } = require("sequelize");
class
RotationchartService
extends
ServiceBase
{
constructor
()
{
super
(
"aggregation"
,
ServiceBase
.
getDaoName
(
RotationchartService
));
this
.
redisdel
=
system
.
getObject
(
"service.aggregation.redisdelSve"
);
}
async
create
(
pobj
)
{
let
code
=
await
this
.
getBusUid
(
"mmc"
);
...
...
@@ -16,7 +17,7 @@ class RotationchartService extends ServiceBase {
if
(
!
pobj
.
pic_url
)
{
return
system
.
getResultFail
(
-
101
,
"图片不能为空"
);
}
if
(
pobj
.
is_enabled
===
''
||
pobj
.
is_enabled
===
null
||
pobj
.
is_enabled
===
undefined
)
{
if
(
pobj
.
is_enabled
===
''
||
pobj
.
is_enabled
===
null
||
pobj
.
is_enabled
===
undefined
)
{
return
system
.
getResultFail
(
-
103
,
"是否显示不能为空"
);
}
if
(
!
pobj
.
jump_link_type
)
{
...
...
@@ -25,7 +26,7 @@ class RotationchartService extends ServiceBase {
if
(
pobj
.
name
&&
pobj
.
name
.
length
>
19
)
{
return
system
.
getResultFail
(
-
105
,
"图片名称最多20位字符"
);
}
if
(
pobj
.
id
!==
1
)
{
if
(
pobj
.
id
!==
1
)
{
if
(
!
pobj
.
sequence
)
{
return
system
.
getResultFail
(
-
102
,
"排序不能为空"
);
}
...
...
@@ -36,16 +37,39 @@ class RotationchartService extends ServiceBase {
async
update
(
pobj
)
{
if
(
!
pobj
.
pic_url
)
{
pobj
.
pic_url
=
res
.
pic_url
;
return
system
.
getResultFail
(
-
101
,
"图片不能为空"
);
}
if
(
pobj
.
is_enabled
===
''
||
pobj
.
is_enabled
===
null
||
pobj
.
is_enabled
===
undefined
)
{
return
system
.
getResultFail
(
-
103
,
"是否显示不能为空"
);
}
if
(
!
pobj
.
jump_link_type
)
{
return
system
.
getResultFail
(
-
104
,
"连接不能为空"
);
}
if
(
pobj
.
name
&&
pobj
.
name
.
length
>
19
)
{
return
system
.
getResultFail
(
-
105
,
"图片名称最多20位字符"
);
}
if
(
pobj
.
id
!==
1
)
{
if
(
!
pobj
.
sequence
)
{
return
system
.
getResultFail
(
-
102
,
"排序不能为空"
);
}
}
if
(
!
pobj
.
name
)
{
pobj
.
name
=
res
.
name
;
try
{
var
functionName
=
"rotationChartList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
}
async
updates
(
pobj
)
{
return
system
.
getResultSuccess
(
this
.
dao
.
update
(
pobj
));
async
delete
(
pobj
)
{
try
{
var
functionName
=
"rotationChartList"
;
await
this
.
redisdel
.
redisInfo
(
functionName
);
}
catch
(
error
)
{
console
.
log
(
error
)
}
return
system
.
getResultSuccess
(
this
.
dao
.
delete
(
pobj
));
}
}
module
.
exports
=
RotationchartService
;
\ No newline at end of file
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