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
5c12ee5b
Commit
5c12ee5b
authored
Jun 30, 2020
by
wkliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
680b3aff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
59 deletions
+59
-59
engine-product/app/base/api/impl/op/action.js
+42
-42
engine-product/app/base/api/impl/op/product.js
+13
-13
engine-product/app/front/entry/public/apidoc/product/product.md
+4
-4
No files found.
engine-product/app/base/api/impl/op/action.js
View file @
5c12ee5b
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
...
@@ -4,7 +4,7 @@ var settings = require("../../../../config/settings");
class
ActionAPI
extends
APIBase
{
class
ActionAPI
extends
APIBase
{
constructor
()
{
constructor
()
{
super
();
super
();
this
.
accountSve
=
system
.
getObject
(
"service.account.accountSve"
);
this
.
productSve
=
system
.
getObject
(
"service.product.productSve"
)
}
}
/**
/**
* 接口跳转
* 接口跳转
...
@@ -12,7 +12,7 @@ class ActionAPI extends APIBase {
...
@@ -12,7 +12,7 @@ class ActionAPI extends APIBase {
* action_type 执行的类型
* action_type 执行的类型
* action_body 执行的参数
* action_body 执行的参数
*/
*/
async
springboard
(
pobj
,
qobj
,
req
)
{
async
springboard
(
pobj
,
qobj
,
req
)
{
var
result
;
var
result
;
if
(
!
pobj
.
action_process
)
{
if
(
!
pobj
.
action_process
)
{
return
system
.
getResult
(
null
,
"action_process参数不能为空"
);
return
system
.
getResult
(
null
,
"action_process参数不能为空"
);
...
@@ -21,57 +21,57 @@ class ActionAPI extends APIBase {
...
@@ -21,57 +21,57 @@ class ActionAPI extends APIBase {
return
system
.
getResult
(
null
,
"action_type参数不能为空"
);
return
system
.
getResult
(
null
,
"action_type参数不能为空"
);
}
}
try
{
try
{
result
=
await
this
.
handleRequest
(
pobj
.
action_process
,
pobj
.
action_type
,
pobj
.
action_body
);
result
=
await
this
.
handleRequest
(
pobj
.
action_process
,
pobj
.
action_type
,
pobj
.
action_body
);
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
log
(
error
);
console
.
log
(
error
);
}
}
return
result
;
return
result
;
}
}
async
handleRequest
(
action_process
,
action_type
,
action_body
)
{
async
handleRequest
(
action_process
,
action_type
,
action_body
)
{
var
opResult
=
null
;
let
result
switch
(
action_type
)
{
switch
(
action_type
)
{
// 测试
case
'getPage'
:
case
"test"
:
result
=
await
this
.
productSve
.
getPage
(
action_body
.
page
,
action_body
.
limit
,
opResult
=
await
this
.
accountSve
.
test
(
action_body
);
action_body
.
types
,
action_body
.
keywords
)
break
;
break
// 创建账户
case
'createOrUpdate'
:
case
"accountCreate"
:
if
(
action_body
.
product_type
==
0
&&
action_body
.
items
)
{
opResult
=
await
this
.
accountSve
.
createAccount
(
action_body
);
return
system
.
getResult
(
null
,
'单产品不能有子产品'
)
break
;
}
// 账户余额查询
if
(
action_body
.
product_type
==
1
&&
(
!
action_body
.
items
||
action_body
.
items
.
length
==
0
))
{
case
"accountInfo"
:
return
system
.
getResult
(
null
,
'未选择子产品'
)
opResult
=
await
this
.
accountSve
.
accountInfo
(
action_body
);
}
break
;
if
(
action_body
.
product_type
==
1
)
{
// 账户充值
let
checkRes
=
await
this
.
productSve
.
checkSitem
(
action_body
.
items
)
case
"accountRecharge"
:
if
(
!
checkRes
)
{
opResult
=
await
this
.
accountSve
.
accountRecharge
(
action_body
);
return
system
.
getResult
(
null
,
'不能选择组合产品为子产品'
)
break
;
}
// 账户充值
}
case
"accountRefund"
:
result
=
await
this
.
productSve
.
createOrUpdate
(
action_body
)
opResult
=
await
this
.
accountSve
.
accountRefund
(
action_body
);
break
break
;
case
'getAllDic'
:
case
"accountTrade"
:
result
=
await
this
.
productSve
.
getAllDic
(
action_body
.
types
)
opResult
=
await
this
.
accountSve
.
accountTrade
(
action_body
);
break
break
;
case
'getByIds'
:
case
"accountTradePage"
:
if
(
!
action_body
.
ids
)
{
opResult
=
await
this
.
accountSve
.
accountTradePage
(
action_body
);
return
system
.
getResult
(
null
,
'id列表不能为空'
)
break
;
}
// 账户交易
result
=
await
this
.
productSve
.
getByIds
(
action_body
.
ids
)
case
"test4"
:
break
opResult
=
await
this
.
accountSve
.
test
(
action_body
);
case
'getItems'
:
break
;
result
=
await
this
.
productSve
.
getItems
(
action_body
.
id
)
break
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
break
;
}
}
return
opResult
;
return
system
.
getResultSuccess
(
result
)
}
}
exam
()
{
exam
()
{
return
`<pre><pre/>`
;
return
`<pre><pre/>`
;
}
}
classDesc
()
{
classDesc
()
{
return
{
return
{
groupName
:
"op"
,
groupName
:
"op"
,
groupDesc
:
"元数据服务包"
,
groupDesc
:
"元数据服务包"
,
...
@@ -80,7 +80,7 @@ class ActionAPI extends APIBase {
...
@@ -80,7 +80,7 @@ class ActionAPI extends APIBase {
exam
:
""
,
exam
:
""
,
};
};
}
}
methodDescs
()
{
methodDescs
()
{
return
[
return
[
{
{
methodDesc
:
`<pre><pre/>`
,
methodDesc
:
`<pre><pre/>`
,
...
...
engine-product/app/base/api/impl/op/product.js
View file @
5c12ee5b
...
@@ -8,38 +8,38 @@ class ProductAPI extends APIBase {
...
@@ -8,38 +8,38 @@ class ProductAPI extends APIBase {
}
}
async
etag
(
pobj
,
qobj
,
req
)
{
async
etag
(
pobj
,
qobj
,
req
)
{
if
(
!
pobj
.
action
T
ype
)
{
if
(
!
pobj
.
action
_t
ype
)
{
return
system
.
getResult
(
null
,
"action
T
ype参数不能为空"
)
return
system
.
getResult
(
null
,
"action
_t
ype参数不能为空"
)
}
}
let
result
let
result
switch
(
pobj
.
action
T
ype
)
{
switch
(
pobj
.
action
_t
ype
)
{
case
'getPage'
:
case
'getPage'
:
result
=
await
this
.
productSve
.
getPage
(
pobj
.
action
Body
.
page
,
pobj
.
actionB
ody
.
limit
,
result
=
await
this
.
productSve
.
getPage
(
pobj
.
action
_body
.
page
,
pobj
.
action_b
ody
.
limit
,
pobj
.
action
Body
.
types
,
pobj
.
actionB
ody
.
keywords
)
pobj
.
action
_body
.
types
,
pobj
.
action_b
ody
.
keywords
)
return
system
.
getResultSuccess
(
result
)
return
system
.
getResultSuccess
(
result
)
case
'createOrUpdate'
:
case
'createOrUpdate'
:
if
(
pobj
.
action
Body
.
product_type
==
0
&&
pobj
.
actionB
ody
.
items
)
{
if
(
pobj
.
action
_body
.
product_type
==
0
&&
pobj
.
action_b
ody
.
items
)
{
return
system
.
getResult
(
null
,
'单产品不能有子产品'
)
return
system
.
getResult
(
null
,
'单产品不能有子产品'
)
}
}
if
(
pobj
.
action
Body
.
product_type
==
1
&&
(
!
pobj
.
actionBody
.
items
||
pobj
.
actionB
ody
.
items
.
length
==
0
))
{
if
(
pobj
.
action
_body
.
product_type
==
1
&&
(
!
pobj
.
action_body
.
items
||
pobj
.
action_b
ody
.
items
.
length
==
0
))
{
return
system
.
getResult
(
null
,
'未选择子产品'
)
return
system
.
getResult
(
null
,
'未选择子产品'
)
}
}
if
(
pobj
.
action
B
ody
.
product_type
==
1
)
{
if
(
pobj
.
action
_b
ody
.
product_type
==
1
)
{
let
checkRes
=
await
this
.
productSve
.
checkSitem
(
pobj
.
action
B
ody
.
items
)
let
checkRes
=
await
this
.
productSve
.
checkSitem
(
pobj
.
action
_b
ody
.
items
)
if
(
!
checkRes
)
{
if
(
!
checkRes
)
{
return
system
.
getResult
(
null
,
'不能选择组合产品为子产品'
)
return
system
.
getResult
(
null
,
'不能选择组合产品为子产品'
)
}
}
}
}
result
=
await
this
.
productSve
.
createOrUpdate
(
pobj
.
action
B
ody
)
result
=
await
this
.
productSve
.
createOrUpdate
(
pobj
.
action
_b
ody
)
return
system
.
getResultSuccess
(
result
)
return
system
.
getResultSuccess
(
result
)
case
'getAllDic'
:
case
'getAllDic'
:
result
=
await
this
.
productSve
.
getAllDic
(
pobj
.
action
B
ody
.
types
)
result
=
await
this
.
productSve
.
getAllDic
(
pobj
.
action
_b
ody
.
types
)
return
system
.
getResultSuccess
(
result
)
return
system
.
getResultSuccess
(
result
)
case
'getByIds'
:
case
'getByIds'
:
result
=
await
this
.
productSve
.
getByIds
(
pobj
.
action
B
ody
.
ids
)
result
=
await
this
.
productSve
.
getByIds
(
pobj
.
action
_b
ody
.
ids
)
return
system
.
getResultSuccess
(
result
)
return
system
.
getResultSuccess
(
result
)
case
'getItems'
:
case
'getItems'
:
result
=
await
this
.
productSve
.
getItems
(
pobj
.
action
B
ody
.
id
)
result
=
await
this
.
productSve
.
getItems
(
pobj
.
action
_b
ody
.
id
)
return
system
.
getResultSuccess
(
result
)
return
system
.
getResultSuccess
(
result
)
default
:
default
:
break
break
...
...
engine-product/app/front/entry/public/apidoc/product/product.md
View file @
5c12ee5b
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#### 接口地址 `/api/op/product/etag`
#### 接口地址 `/api/op/product/etag`
#### action
T
ype `getPage`
#### action
_t
ype `getPage`
#### 参数说明
#### 参数说明
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
#### 接口地址 `/api/op/product/etag`
#### 接口地址 `/api/op/product/etag`
#### action
T
ype `getAllDic`
#### action
_t
ype `getAllDic`
#### 参数说明
#### 参数说明
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
#### 接口地址 `/api/op/product/etag`
#### 接口地址 `/api/op/product/etag`
#### action
T
ype `getByIds`
#### action
_t
ype `getByIds`
#### 参数说明
#### 参数说明
...
@@ -182,7 +182,7 @@
...
@@ -182,7 +182,7 @@
#### 接口地址 `/api/op/product/etag`
#### 接口地址 `/api/op/product/etag`
#### action
T
ype `getItems`
#### action
_t
ype `getItems`
#### 参数说明
#### 参数说明
...
...
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