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
dbab6213
authored
Feb 15, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
a19ba6d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
12 deletions
service/benefit.ts
service/benefit.ts
View file @
dbab6213
...
...
@@ -12,31 +12,22 @@ export class BenefitInvoker {
private
static
readonly
subProject
=
'welfare_v2'
;
private
static
readonly
unsetupError
=
'服务尚未初始化'
;
private
static
sdk
:
UniplatSdk
|
null
=
null
;
private
static
org
=
0
;
private
static
entrance
=
''
;
public
static
setup
(
sdk
:
UniplatSdk
,
org
:
number
,
entrance
:
string
)
{
public
static
setup
(
sdk
:
UniplatSdk
)
{
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
,
Entrance
:
this
.
entrance
}
});
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'get'
);
}
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
,
Entrance
:
this
.
entrance
}
});
return
this
.
sdk
.
domainService
(
this
.
subProject
,
service
,
api
).
request
<
{},
{},
T
>
(
'post'
,
{
data
});
}
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