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
f5d50c18
Commit
f5d50c18
authored
Jun 30, 2020
by
wkliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品相关
parent
85b0c389
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
30 deletions
+133
-30
esign-admin/app/base/controller/impl/product/productCtl.js
+47
-5
esign-admin/app/base/service/impl/product/productSve.js
+51
-0
esign-admin/app/base/system.js
+2
-2
esign-admin/app/config/routes/doc.js
+33
-23
esign-admin/app/front/entry/public/apidoc/product/product.md
+0
-0
No files found.
esign-admin/app/base/controller/impl/product/productCtl.js
View file @
f5d50c18
var
system
=
require
(
"../../../system"
)
const
settings
=
require
(
"../../../../config/settings"
)
const
CtlBase
=
require
(
"../../ctlms.base"
);
const
md5
=
require
(
"MD5"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
logCtl
=
system
.
getObject
(
"web.common.oplogCtl"
);
class
ProductCtl
extends
CtlBase
{
constructor
()
{
super
();
this
.
userSve
=
system
.
getObject
(
"service.uc.user
Sve"
);
this
.
prodSve
=
system
.
getObject
(
"service.product.product
Sve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
}
...
...
@@ -22,6 +18,51 @@ class ProductCtl extends CtlBase {
return
system
.
getResultFail
(
500
,
"接口异常:"
+
error
.
message
);
}
}
async
getPage
(
pobj
,
pobj2
,
req
)
{
try
{
let
res
=
await
this
.
prodSve
.
getPage
(
pobj
)
return
system
.
getResultSuccess
(
res
)
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
err
,
message
)
}
}
async
getAllDic
(
pobj
,
pobj2
,
req
)
{
try
{
let
res
=
await
this
.
prodSve
.
getAllDic
(
pobj
)
return
system
.
getResultSuccess
(
res
)
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
err
,
message
)
}
}
async
getByIds
(
pobj
,
pobj2
,
req
)
{
try
{
let
res
=
await
this
.
prodSve
.
getByIds
(
pobj
)
return
system
.
getResultSuccess
(
res
)
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
err
,
message
)
}
}
async
getItems
(
pobj
,
pobj2
,
req
)
{
try
{
let
res
=
await
this
.
prodSve
.
getItems
(
pobj
)
return
system
.
getResultSuccess
(
res
)
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
err
,
message
)
}
}
async
createOrUpdate
(
pobj
,
pobj2
,
req
)
{
try
{
let
res
=
await
this
.
prodSve
.
createOrUpdate
(
pobj
)
return
system
.
getResultSuccess
(
res
)
}
catch
(
error
)
{
return
system
.
getResultFail
(
500
,
err
,
message
)
}
}
}
module
.
exports
=
ProductCtl
;
\ No newline at end of file
esign-admin/app/base/service/impl/product/productSve.js
0 → 100644
View file @
f5d50c18
const
system
=
require
(
"../../../system"
);
const
ServiceBase
=
require
(
"../../svems.base"
)
class
ProductService
extends
ServiceBase
{
constructor
()
{
super
();
}
async
getPage
(
params
)
{
try
{
return
await
this
.
callms
(
"engine_product"
,
"getPage"
,
params
)
}
catch
(
error
)
{
throw
error
}
}
async
getAllDic
(
params
)
{
try
{
return
await
this
.
callms
(
"engine_product"
,
"getAllDic"
,
params
)
}
catch
(
error
)
{
throw
error
}
}
async
getByIds
(
params
)
{
try
{
return
await
this
.
callms
(
"engine_product"
,
"getByIds"
,
params
)
}
catch
(
error
)
{
throw
error
}
}
async
getItems
(
params
)
{
try
{
return
await
this
.
callms
(
"engine_product"
,
"getItems"
,
params
)
}
catch
(
error
)
{
throw
error
}
}
async
createOrUpdate
(
params
)
{
try
{
return
await
this
.
callms
(
"engine_product"
,
"createOrUpdate"
,
params
)
}
catch
(
error
)
{
throw
error
}
}
}
module
.
exports
=
ProductService
;
\ No newline at end of file
esign-admin/app/base/system.js
View file @
f5d50c18
...
...
@@ -186,7 +186,7 @@ class System {
let
local
=
"http://127.0.0.1"
;
let
dev
=
"http://39.107.234.14"
;
return
{
//
签约
引擎
//
产品
引擎
engine_product
:
local
+
":3571"
+
path
,
// 计费引擎
engine_fee
:
local
+
":3103"
+
path
,
...
...
@@ -196,7 +196,7 @@ class System {
engine_sign
:
local
+
":3103"
+
path
,
// 用户服务
sve_uc
:
local
+
":3651"
+
path
,
sve_uc
:
dev
+
":3651"
+
path
,
// 商户服务
sve_merchant
:
dev
+
":3103"
+
path
,
// 订单服务
...
...
esign-admin/app/config/routes/doc.js
View file @
f5d50c18
...
...
@@ -2,60 +2,70 @@
var
system
=
require
(
"../../base/system"
);
var
fs
=
require
(
'fs'
);
var
marked
=
require
(
"marked"
);
const
os
=
require
(
"os"
)
module
.
exports
=
function
(
app
)
{
app
.
get
(
'/doc'
,
function
(
req
,
res
)
{
var
path
=
process
.
cwd
()
+
"/app/front/entry/public/apidoc/README.md"
;
// var path = process.cwd() + "/xgg-saas-platform/app/front/entry/public/apidoc/README.md";
fs
.
readFile
(
path
,
function
(
err
,
data
){
if
(
err
){
// var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
// var path = process.cwd() + "/esign-admin/app/front/entry/public/apidoc/README.md";
var
path
=
`
${
process
.
cwd
()}${
os
.
type
==
'Windows_NT'
?
"/esign-admin/app/front/entry/public/apidoc/README.md"
:
"/app/front/entry/public/apidoc/README.md"
}
`
;
fs
.
readFile
(
path
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
err
);
res
.
send
(
"文件不存在!"
);
}
else
{
}
else
{
console
.
log
(
data
);
str
=
marked
(
data
.
toString
());
res
.
render
(
'apidoc'
,
{
str
});
}
res
.
render
(
'apidoc'
,
{
str
});
}
});
});
app
.
get
(
'/doc/:forder'
,
function
(
req
,
res
)
{
var
path
=
process
.
cwd
()
+
"/app/front/entry/public/apidoc/README.md"
;
// var path = process.cwd() + "/xgg-saas-platform/app/front/entry/public/apidoc/README.md";
// var path = process.cwd() + "/app/front/entry/public/apidoc/README.md";
// var path = process.cwd() + "/esign-admin/app/front/entry/public/apidoc/README.md";
var
path
=
`
${
process
.
cwd
()}${
os
.
type
==
'Windows_NT'
?
"/esign-admin/app/front/entry/public/apidoc/README.md"
:
"/app/front/entry/public/apidoc/README.md"
}
`
;
fs
.
readFile
(
path
,
function
(
err
,
data
)
{
if
(
err
)
{
fs
.
readFile
(
path
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
err
);
res
.
send
(
"文件不存在!"
);
}
else
{
}
else
{
console
.
log
(
data
);
str
=
marked
(
data
.
toString
());
res
.
render
(
'apidoc'
,
{
str
});
}
res
.
render
(
'apidoc'
,
{
str
});
}
});
});
app
.
get
(
'/doc/:forder/:fileName'
,
function
(
req
,
res
)
{
var
forder
=
req
.
params
[
"forder"
];
var
fileName
=
req
.
params
[
"fileName"
]
||
"README.md"
;
var
path
=
process
.
cwd
()
+
"/app/front/entry/public/apidoc"
;
// var path = process.cwd() + "/xgg-saas-platform/app/front/entry/public/apidoc";
if
(
forder
)
{
path
=
path
+
"/"
+
forder
+
"/"
+
fileName
;
// var path = process.cwd() + "/app/front/entry/public/apidoc";
// var path = process.cwd() + "/esign-admin/app/front/entry/public/apidoc";
var
path
=
`
${
process
.
cwd
()}${
os
.
type
==
'Windows_NT'
?
"/esign-admin/app/front/entry/public/apidoc"
:
"/app/front/entry/public/apidoc"
}
`
;
if
(
forder
)
{
path
=
path
+
"/"
+
forder
+
"/"
+
fileName
;
}
else
{
path
=
path
+
"/"
+
fileName
;
}
fs
.
readFile
(
path
,
function
(
err
,
data
)
{
if
(
err
)
{
fs
.
readFile
(
path
,
function
(
err
,
data
)
{
if
(
err
)
{
console
.
log
(
err
);
res
.
send
(
"文件不存在!"
);
}
else
{
}
else
{
console
.
log
(
data
);
str
=
marked
(
data
.
toString
());
console
.
log
(
str
);
res
.
render
(
'apidoc'
,
{
str
});
}
res
.
render
(
'apidoc'
,
{
str
});
}
});
});
};
esign-admin/app/front/entry/public/apidoc/product/product.md
View file @
f5d50c18
This diff is collapsed.
Click to expand it.
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