Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a19ba6d9
authored
Feb 14, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
u
parent
da2f52b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
service/benefit.ts
service/benefit.ts
View file @
a19ba6d9
...
...
@@ -13,23 +13,30 @@ export class BenefitInvoker {
private
static
readonly
unsetupError
=
'服务尚未初始化'
;
private
static
sdk
:
UniplatSdk
|
null
=
null
;
private
static
org
=
0
;
private
static
entrance
=
''
;
public
static
setup
(
sdk
:
UniplatSdk
,
org
:
number
)
{
public
static
setup
(
sdk
:
UniplatSdk
,
org
:
number
,
entrance
:
string
)
{
this
.
sdk
=
sdk
;
this
.
org
=
org
;
this
.
entrance
=
entrance
;
return
this
;
}
public
static
get
<
T
>
(
service
:
BenefitServiceName
,
api
:
BenefitApiName
)
{
if
(
this
.
sdk
)
{
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'get'
,
{
headers
:
{
CurrentOrg
:
this
.
org
}
});
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'get'
,
{
headers
:
{
CurrentOrg
:
this
.
org
,
Entrance
:
this
.
entrance
}
});
}
return
Promise
.
reject
(
this
.
unsetupError
);
}
public
static
post
<
T
>
(
service
:
BenefitServiceName
,
api
:
BenefitApiName
,
data
?:
any
)
{
if
(
this
.
sdk
)
{
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'post'
,
{
data
,
headers
:
{
CurrentOrg
:
this
.
org
}
});
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'post'
,
{
data
,
headers
:
{
CurrentOrg
:
this
.
org
,
Entrance
:
this
.
entrance
}
});
}
return
Promise
.
reject
(
this
.
unsetupError
);
}
...
...
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