Commit 0f9b8586 by 王悦

fix name zhiquanquan

parent 97c05708
#!/bin/bash
FROM registry.cn-beijing.aliyuncs.com/hantang2/node105:v2
MAINTAINER jy "jiangyong@gongsibao.com"
ADD gsb-marketplat /apps/gsb-marketplat/
WORKDIR /apps/gsb-marketplat/
ADD zhiquanquan /apps/zhiquanquan/
WORKDIR /apps/zhiquanquan/
RUN cnpm install -S
CMD ["node","/apps/gsb-marketplat/main.js"]
......
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/gsb-marketplat.iml" filepath="$PROJECT_DIR$/.idea/gsb-marketplat.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
/**
* 用户端调用订单相关接口
*/
class Template extends APIBase {
constructor() {
super();
this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
this.formsubmitrecordSve= system.getObject("service.configmag.formsubmitrecordSve");
this.forminfoSve= system.getObject("service.configmag.forminfoSve");
this.redisClient = system.getObject("util.redisClient");
this.formCache={};
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.clientIp = req.clientIp;
pobj.xctx = req.xctx;
switch (action_type) {
case "editTemplateContent"://修改模板内容
opResult = await this.templateinfoSve.editTemplateContent(pobj);
break;
case "findOneByCode"://模板查询
opResult = await this.templateinfoSve.getTemplateInfoByCode(pobj);
break;
case "getTemplateAndLinkInfo"://根据链接参数获取模板链接信息
console.log("getTemplateAndLinkInfo+++++++++++++++++++++++++++");
console.log(JSON.stringify(pobj));
opResult = await this.templatelinkSve.getTemplateAndLinkInfo2(pobj);
break;
case "submitFormRecord"://提交表单记录
opResult = await this.formsubmitrecordSve.submitFormRecord(pobj);
break;
case "pushFormInfo2Fq"://推送需求表单信息至蜂擎
opResult = await this.formsubmitrecordSve.pushFormInfo2Fq();
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
async getFormInfoById(pobj, qobj, req){
var shaStr = "forminfo_"+pobj.id;
var rtn = null;
console.log(this.formCache,"+++++++++++++getFormInfoById++++++++++++++++++++++");
if(this.formCache[shaStr]){
rtn = this.formCache[shaStr];
}else{
rtn = await this.redisClient.get(shaStr); // 先试图从redis读取数据
if(rtn){
this.formCache[shaStr] = rtn;
}
}
//---- 从redis中读取到数据
if (rtn) {
var rtnObj = JSON.parse(rtn);
return system.getResult(rtnObj);
} else {
let result = await this.forminfoSve.findOne({id:pobj.id},[]);
// 将数据保存到redis中
await this.redisClient.set(shaStr, JSON.stringify(result));
this.formCache[shaStr] = JSON.stringify(result);
return system.getResult(result);
}
}
//删除表单缓存
async delTemplateFormCache(key){
if(key && this.formCache[key]){
delete this.formCache[key];
}
}
}
module.exports = Template;
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
/**
* 用户端调用订单相关接口
*/
class Template extends APIBase {
constructor() {
super();
this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
this.formsubmitrecordSve= system.getObject("service.configmag.formsubmitrecordSve");
this.forminfoSve= system.getObject("service.configmag.forminfoSve");
this.redisClient = system.getObject("util.redisClient");
this.formCache={};
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.clientIp = req.clientIp;
pobj.xctx = req.xctx;
switch (action_type) {
case "editTemplateContent"://修改模板内容
opResult = await this.templateinfoSve.editTemplateContent(pobj);
break;
case "findOneByCode"://模板查询
opResult = await this.templateinfoSve.getTemplateInfoByCode(pobj);
break;
case "getTemplateAndLinkInfo"://根据链接参数获取模板链接信息
console.log("getTemplateAndLinkInfo+++++++++++++++++++++++++++");
console.log(JSON.stringify(pobj));
opResult = await this.templatelinkSve.getTemplateAndLinkInfo2(pobj);
break;
case "submitFormRecord"://提交表单记录
opResult = await this.formsubmitrecordSve.submitFormRecord(pobj);
break;
case "pushFormInfo2Fq"://推送需求表单信息至蜂擎
opResult = await this.formsubmitrecordSve.pushFormInfo2Fq();
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
async getFormInfoById(pobj, qobj, req){
var shaStr = "forminfo_"+pobj.id;
var rtn = null;
console.log(this.formCache,"+++++++++++++getFormInfoById++++++++++++++++++++++");
if(this.formCache[shaStr]){
rtn = this.formCache[shaStr];
}else{
rtn = await this.redisClient.get(shaStr); // 先试图从redis读取数据
if(rtn){
this.formCache[shaStr] = rtn;
}
}
//---- 从redis中读取到数据
if (rtn) {
var rtnObj = JSON.parse(rtn);
return system.getResult(rtnObj);
} else {
let result = await this.forminfoSve.findOne({id:pobj.id},[]);
// 将数据保存到redis中
await this.redisClient.set(shaStr, JSON.stringify(result));
this.formCache[shaStr] = JSON.stringify(result);
return system.getResult(result);
}
}
//删除表单缓存
async delTemplateFormCache(key){
if(key && this.formCache[key]){
delete this.formCache[key];
}
}
}
module.exports = Template;
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
var db = system.getObject("db.common.connection").getCon();
/**
* 用户端调用订单相关接口
*/
class Templateconfig extends APIBase {
constructor() {
super();
this.imginfoSve = system.getObject("service.configmag.imginfoSve");
this.forminfoSve = system.getObject("service.configmag.forminfoSve")
this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.clientIp = req.clientIp;
pobj.xctx = req.xctx;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess("测试接口");
break;
case "getImgList": // 查询图片
pobj.actionBody["company_id"] = pobj.company_id;
opResult = await this.imginfoSve.getImgList(pobj.actionBody);
break;
case "createImginfo": // 添加图片
opResult = await this.imginfoSve.createImginfo(pobj.actionBody);
break;
// case "getTemplateList": // 获取模板列表
// opResult = await this.templateinfoSve.getTemplateList(pobj.actionBody);
// // opResult = await this.templateinfoSve.findByCompanyId(pobj.actionBody);
// break;
case "editTemplate": // 编辑模板信息
opResult = await this.templateinfoSve.editTemplate(pobj);
break;
case "getFormList": // 获取表单列表
var actionBody = pobj.actionBody || {};
actionBody["company_id"] = pobj.company_id;
opResult = await this.forminfoSve.getFormList(pobj.actionBody);
break;
case "getTemplateAndLinkInfo": // 根据链接参数获取模板链接信息
opResult = await this.templatelinkSve.getTemplateAndLinkInfo2(pobj);
break;
case "copyFormInfo": // 复制表单
opResult = await this.forminfoSve.copyFormInfo(pobj.actionBody);
break;
case "deleteFormInfo": // 删除表单
opResult = await this.forminfoSve.deleteFormInfo(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = Templateconfig;
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
var db = system.getObject("db.common.connection").getCon();
/**
* 用户端调用订单相关接口
*/
class Templateconfig extends APIBase {
constructor() {
super();
this.imginfoSve = system.getObject("service.configmag.imginfoSve");
this.forminfoSve = system.getObject("service.configmag.forminfoSve")
this.templateinfoSve = system.getObject("service.template.templateinfoSve");
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.clientIp = req.clientIp;
pobj.xctx = req.xctx;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess("测试接口");
break;
case "getImgList": // 查询图片
pobj.actionBody["company_id"] = pobj.company_id;
opResult = await this.imginfoSve.getImgList(pobj.actionBody);
break;
case "createImginfo": // 添加图片
opResult = await this.imginfoSve.createImginfo(pobj.actionBody);
break;
// case "getTemplateList": // 获取模板列表
// opResult = await this.templateinfoSve.getTemplateList(pobj.actionBody);
// // opResult = await this.templateinfoSve.findByCompanyId(pobj.actionBody);
// break;
case "editTemplate": // 编辑模板信息
opResult = await this.templateinfoSve.editTemplate(pobj);
break;
case "getFormList": // 获取表单列表
var actionBody = pobj.actionBody || {};
actionBody["company_id"] = pobj.company_id;
opResult = await this.forminfoSve.getFormList(pobj.actionBody);
break;
case "getTemplateAndLinkInfo": // 根据链接参数获取模板链接信息
opResult = await this.templatelinkSve.getTemplateAndLinkInfo2(pobj);
break;
case "copyFormInfo": // 复制表单
opResult = await this.forminfoSve.copyFormInfo(pobj.actionBody);
break;
case "deleteFormInfo": // 删除表单
opResult = await this.forminfoSve.deleteFormInfo(pobj.actionBody);
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = Templateconfig;
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
/**
* 用户端调用订单相关接口
*/
class Templatelink extends APIBase {
constructor() {
super();
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.xctx = req.xctx;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess("测试接口");
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = Templatelink;
const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
/**
* 用户端调用订单相关接口
*/
class Templatelink extends APIBase {
constructor() {
super();
this.templatelinkSve = system.getObject("service.template.templatelinkSve");
}
/**
* 接口跳转-POST请求
* action_process 执行的流程
* action_type 执行的类型
* action_body 执行的参数
*/
async springBoard(pobj, qobj, req) {
if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空");
}
var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result;
}
async opActionProcess(pobj, action_type, req) {
var opResult = null;
var self = this;
pobj.xctx = req.xctx;
switch (action_type) {
case "test"://测试
opResult = system.getResultSuccess("测试接口");
break;
default:
opResult = system.getResult(null, "action_type参数错误");
break;
}
return opResult;
}
}
module.exports = Templatelink;
module.exports = (sequelize, DataType) => {
return sequelize.define("marketingsubject", {
code: DataType.STRING(100),
name: DataType.STRING(100),
notes: DataType.STRING(255),
user_name: DataType.STRING(100),
user_id: DataType.STRING(100),
company_id: DataType.INTEGER,
}, {
// 不添加时间戳属性 (updatedAt, createdAt)
timestamps: true,
// 不删除数据库条目,但将新添加的属性deletedAt设置为当前日期(删除完成时)。
// paranoid 只有在启用时间戳时才能工作
paranoid: true,
// 将自动设置所有属性的字段选项为下划线命名方式。
// 不会覆盖已经定义的字段选项
underscored: true,
// 禁用修改表名; 默认情况下,sequelize将自动将所有传递的模型名称(define的第一个参数)转换为复数。 如果你不想这样,请设置以下内容
freezeTableName: true,
// 定义表的名称
tableName: 'c_marketing_subject',
// 启用乐观锁定。 启用时,sequelize将向模型添加版本计数属性,
// 并在保存过时的实例时引发OptimisticLockingError错误。
// 设置为true或具有要用于启用的属性名称的字符串。
version: true
});
module.exports = (sequelize, DataType) => {
return sequelize.define("marketingsubject", {
code: DataType.STRING(100),
name: DataType.STRING(100),
notes: DataType.STRING(255),
user_name: DataType.STRING(100),
user_id: DataType.STRING(100),
company_id: DataType.INTEGER,
}, {
// 不添加时间戳属性 (updatedAt, createdAt)
timestamps: true,
// 不删除数据库条目,但将新添加的属性deletedAt设置为当前日期(删除完成时)。
// paranoid 只有在启用时间戳时才能工作
paranoid: true,
// 将自动设置所有属性的字段选项为下划线命名方式。
// 不会覆盖已经定义的字段选项
underscored: true,
// 禁用修改表名; 默认情况下,sequelize将自动将所有传递的模型名称(define的第一个参数)转换为复数。 如果你不想这样,请设置以下内容
freezeTableName: true,
// 定义表的名称
tableName: 'c_marketing_subject',
// 启用乐观锁定。 启用时,sequelize将向模型添加版本计数属性,
// 并在保存过时的实例时引发OptimisticLockingError错误。
// 设置为true或具有要用于启用的属性名称的字符串。
version: true
});
};
\ No newline at end of file
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