Commit 6c435b25 by 兰国旗

laolan

parent 2a1c4d54
...@@ -52,8 +52,6 @@ class BottommenuconfigService extends ServiceBase { ...@@ -52,8 +52,6 @@ class BottommenuconfigService extends ServiceBase {
async update(pobj) { async update(pobj) {
var functionName = "bottomMenuConfig";
await this.redisdel.redisInfo(functionName);
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
} }
......
...@@ -5,19 +5,7 @@ class CluemaintenanceService extends ServiceBase { ...@@ -5,19 +5,7 @@ class CluemaintenanceService extends ServiceBase {
constructor() { constructor() {
super("aggregation", ServiceBase.getDaoName(CluemaintenanceService)); super("aggregation", ServiceBase.getDaoName(CluemaintenanceService));
} }
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) { async create(pobj) {
let code = await this.getBusUid("img"); let code = await this.getBusUid("img");
pobj.code = code; pobj.code = code;
......
...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings"); ...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings");
class CycleproductService extends ServiceBase { class CycleproductService extends ServiceBase {
constructor() { constructor() {
super("aggregation", ServiceBase.getDaoName(CycleproductService)); super("aggregation", ServiceBase.getDaoName(CycleproductService));
this.redisdel = system.getObject("service.aggregation.redisdelSve");
} }
async update(pobj) { async update(pobj) {
...@@ -17,20 +16,6 @@ class CycleproductService extends ServiceBase { ...@@ -17,20 +16,6 @@ class CycleproductService extends ServiceBase {
if (pobj.pic_describe && pobj.pic_describe.length > 19) { if (pobj.pic_describe && pobj.pic_describe.length > 19) {
return system.getResultFail(-105, "图片描述最多20位字符"); return system.getResultFail(-105, "图片描述最多20位字符");
} }
try {
var functionName = "cycleProduct";
await this.redisdel.redisInfo(functionName);
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
} }
......
...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings"); ...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings");
class PicturewarehouseService extends ServiceBase { class PicturewarehouseService extends ServiceBase {
constructor() { constructor() {
super("aggregation", ServiceBase.getDaoName(PicturewarehouseService)); super("aggregation", ServiceBase.getDaoName(PicturewarehouseService));
this.redisdel = system.getObject("service.aggregation.redisdelSve");
} }
async create(pobj) { async create(pobj) {
...@@ -21,22 +20,10 @@ class PicturewarehouseService extends ServiceBase { ...@@ -21,22 +20,10 @@ class PicturewarehouseService extends ServiceBase {
if (!pobj.pic_url) { if (!pobj.pic_url) {
return system.getResultFail(-123, "图片不能为空"); return system.getResultFail(-123, "图片不能为空");
} }
try {
var functionName = "productDetail";
await this.redisdel.redisInfo(functionName);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
async delete(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)); return system.getResultSuccess(this.dao.delete(pobj));
} }
} }
......
...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings"); ...@@ -4,7 +4,6 @@ const settings = require("../../../../config/settings");
class PopularrecommendationService extends ServiceBase { class PopularrecommendationService extends ServiceBase {
constructor() { constructor() {
super("aggregation", ServiceBase.getDaoName(PopularrecommendationService)); super("aggregation", ServiceBase.getDaoName(PopularrecommendationService));
this.redisdel = system.getObject("service.aggregation.redisdelSve");
} }
async update(pobj) { async update(pobj) {
...@@ -18,17 +17,6 @@ class PopularrecommendationService extends ServiceBase { ...@@ -18,17 +17,6 @@ class PopularrecommendationService extends ServiceBase {
if (pobj.pic_describe && pobj.pic_describe.length > 19) { if (pobj.pic_describe && pobj.pic_describe.length > 19) {
return system.getResultFail(-105, "图片描述最多20位字符"); return system.getResultFail(-105, "图片描述最多20位字符");
} }
var functionName = "popularRecommendationList";
await this.redisdel.redisInfo(functionName);
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
} }
......
...@@ -15,14 +15,6 @@ class ProductService extends ServiceBase { ...@@ -15,14 +15,6 @@ class ProductService extends ServiceBase {
async update(pobj) { async update(pobj) {
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
......
...@@ -73,18 +73,6 @@ class ProducttypeService extends ServiceBase { ...@@ -73,18 +73,6 @@ class ProducttypeService extends ServiceBase {
// return system.getResultFail(-106, "名称最多4位字符"); // return system.getResultFail(-106, "名称最多4位字符");
// } // }
try {
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
//获取产品类型信息-用于后台管理页面 //获取产品类型信息-用于后台管理页面
...@@ -110,18 +98,6 @@ class ProducttypeService extends ServiceBase { ...@@ -110,18 +98,6 @@ class ProducttypeService extends ServiceBase {
} }
async delete(pobj){ async delete(pobj){
try {
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.delete(pobj)); return system.getResultSuccess(this.dao.delete(pobj));
} }
} }
......
...@@ -6,11 +6,11 @@ class RedisdelService extends ServiceBase { ...@@ -6,11 +6,11 @@ class RedisdelService extends ServiceBase {
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
} }
async redisInfo(functionName) { async redisInfo(functionName, params) {
var template = "mediaaggregation"; var template = "mediaaggregation";
let shaStr; let shaStr;
let rtn; let rtn;
shaStr = template + "_" + functionName; shaStr = template + "_" + params + "_" + functionName;
rtn = await this.redisClient.get(shaStr); rtn = await this.redisClient.get(shaStr);
if (rtn) { if (rtn) {
var res = await this.redisClient.delete(shaStr); var res = await this.redisClient.delete(shaStr);
......
...@@ -5,7 +5,6 @@ const { json } = require("sequelize"); ...@@ -5,7 +5,6 @@ const { json } = require("sequelize");
class RotationchartService extends ServiceBase { class RotationchartService extends ServiceBase {
constructor() { constructor() {
super("aggregation", ServiceBase.getDaoName(RotationchartService)); super("aggregation", ServiceBase.getDaoName(RotationchartService));
this.redisdel = system.getObject("service.aggregation.redisdelSve");
} }
async create(pobj) { async create(pobj) {
let code = await this.getBusUid("mmc"); let code = await this.getBusUid("mmc");
...@@ -53,38 +52,12 @@ class RotationchartService extends ServiceBase { ...@@ -53,38 +52,12 @@ class RotationchartService extends ServiceBase {
return system.getResultFail(-102, "排序不能为空"); return system.getResultFail(-102, "排序不能为空");
} }
} }
try {
var functionName = "rotationChartList";
await this.redisdel.redisInfo(functionName);
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
async delete(pobj) { async delete(pobj) {
try {
var functionName = "rotationChartList";
await this.redisdel.redisInfo(functionName);
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.delete(pobj)); return system.getResultSuccess(this.dao.delete(pobj));
} }
} }
......
...@@ -16,20 +16,7 @@ class SecondlevelneedconfigService extends ServiceBase { ...@@ -16,20 +16,7 @@ class SecondlevelneedconfigService extends ServiceBase {
if (!pobj.recommend_product_quantity) { if (!pobj.recommend_product_quantity) {
return system.getResultFail(-103, "推荐产品数量不能为空"); return system.getResultFail(-103, "推荐产品数量不能为空");
} }
try {
var functionName = "popularRecommendationList";
await this.redisdel.redisInfo(functionName);
var functionName1 = "productTypeFirst";
await this.redisdel.redisInfo(functionName1);
var functionName2 = "productTypeSecend";
await this.redisdel.redisInfo(functionName2);
var functionName3 = "productList";
await this.redisdel.redisInfo(functionName3);
var functionName4 = "productDetail";
await this.redisdel.redisInfo(functionName4);
} catch (error) {
console.log(error)
}
return system.getResultSuccess(this.dao.update(pobj)); return system.getResultSuccess(this.dao.update(pobj));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment