Commit b3b23288 by 蒋勇

d

parent ff191c64
const system=require("./system")
class TaskBase{
constructor(className){
// this.redisClient=system.getObject("util.redisClient");
this.serviceName=className;
this.isThrough=false;
}
async beforeTask(params){
console.log("前置操作......",this.serviceName);
}
async postTask(params){
console.log("后置操作......",this.serviceName);
}
async doTask(params){
try {
await this.beforeTask(params);
if(!this.isThrough){
await this.subDoTask(params);
}
await this.postTask(params);
//日志记录
console.log(JSON.stringify({
optitle:this.serviceName+",任务成功执行完成",
op:"base/db/task.base.js",
content:"",
clientIp:"",
status:"ok"
}));
} catch (e) {
//日志记录
console.log(JSON.stringify({
optitle:this.serviceName+",任务成功执行完成",
op:"base/db/task.base.js",
content:"",
clientIp:"",
status:"error"
}));
}
}
async subDoTask(params){
throw new Error("请在子类中重写此方法进行操作业务逻辑............................!");
}
static getServiceName(ClassObj){
return ClassObj["name"];
}
}
module.exports=TaskBase;
const TaskBase=require("../../task.base");
class TestTask extends TaskBase{
constructor(){
super(TaskBase.getServiceName(TestTask));
}
async beforeTask(params){
console.log("前置操作......",this.serviceName);
//this.isThrough=true;
}
async subDoTask(params){
console.log("TestTask1.....");
}
}
module.exports=TestTask;
......@@ -3,5 +3,6 @@ var basepath=path.normalize(path.join(__dirname, '../..'));
var settings = {
db:path.join(basepath,"app/base/db/impl"),
util:path.join(basepath,"app/base/utils"),
task:path.join(basepath,"app/base/task"),
};
module.exports = settings;
This source diff could not be displayed because it is too large. You can view the blob instead.
1000065181_in_1000065181,商标注册申请书
1000065117_in_1000065117,商标注册申请书
1000064875_in_1000064875,商标注册申请书
1000064820_in_1000064820,商标注册申请书
1000064685_in_1000064685,商标注册申请书
1000064553_in_1000064553,商标注册申请书
1000064540_in_1000064540,商标注册申请书
1000064494_in_1000064494,商标注册申请书
1000064254_in_1000064254,商标注册申请书
1000064204_in_1000064204,商标注册申请书
1000064199_in_1000064199,商标注册申请书
1000064081_in_1000064081,商标注册申请书
1000064068_in_1000064068,商标注册申请书
1000064027_in_1000064027,商标注册申请书
1000063615_in_1000063615,商标注册申请书
1000042853_in_1000042853,已受理
1000042673_in_1000042673,已收提交
1000040458_in_1000040458,已受理
1000025084_in_1000025084,已受理
1000024535_in_1000024535,已受理
100325865_in_100325865,商标注册申请书
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -3,5 +3,16 @@ const fs=require("fs");
var dbf=system.getObject("db.common.connection");
var downClient=system.getObject("util.restClient");
con=dbf.getCon();
var args = process.argv;
console.log("end");
var taskName = process.env.TASK_NAME;
var params= process.env.TASK_PARAM;
if(taskName){
var t=system.getObject("task.test."+taskName);
(async()=>{
await t.doTask(params);
console.log("process over............");
})();
}else{
console.log("not find task,please check ............................");
}
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