Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjs-bd-common
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
s_guodong
gjjs-bd-common
Commits
65c8cebc
Commit
65c8cebc
authored
Aug 07, 2023
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
cf9af92d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
109 additions
and
0 deletions
+109
-0
AbstractCommonResource.java
...om/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
+109
-0
No files found.
gjjs-bd-business/src/main/java/com/ceb/gjjs/mda/resource/base/AbstractCommonResource.java
0 → 100644
View file @
65c8cebc
package
com
.
ceb
.
gjjs
.
mda
.
resource
.
base
;
import
com.brilliance.mda.runtime.mda.driver.compile.processor.ModuleAnnotationProcess
;
import
com.brilliance.mda.runtime.request.BaseVO
;
import
com.brilliance.mda.runtime.response.ResponseSet
;
import
com.brilliance.mda.support.service.ICommonService
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
javax.ws.rs.POST
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
java.util.Set
;
/**
* @author wangguangchao
* @create 2021-09-24 11:51
*/
public
abstract
class
AbstractCommonResource
<
V
extends
BaseVO
>
{
protected
abstract
ICommonService
getCommonService
();
@Path
(
"/init"
)
@POST
public
ResponseSet
<
V
>
init
(
@RequestBody
V
req
)
{
req
.
setNeedInit
(
true
);
return
getCommonService
().
init
(
req
);
}
@Path
(
"/checkAll"
)
@POST
public
ResponseSet
checkAll
(
@RequestBody
V
req
)
{
return
getCommonService
().
checkAll
(
req
);
}
@Path
(
"/saveData"
)
@POST
public
ResponseSet
<
V
>
saveData
(
@RequestBody
V
req
)
{
return
getCommonService
().
saveData
(
req
);
}
@Path
(
"/confirmData"
)
@POST
public
ResponseSet
<
V
>
confirmData
(
@RequestBody
V
req
)
{
return
getCommonService
().
confirmData
(
req
);
}
@Path
(
"/pending"
)
@POST
public
ResponseSet
<
V
>
pending
(
@RequestBody
V
req
)
{
return
getCommonService
().
pending
(
req
);
}
@Path
(
"/executeCheck/{rule}"
)
@POST
public
ResponseSet
<
V
>
executeCheck
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
[]
ruleArr
=
rule
.
split
(
","
);
setInitFlag
(
req
,
ModuleAnnotationProcess
.
needInitCheck
,
ruleArr
);
return
getCommonService
().
executeCheck
(
req
,
ruleArr
);
}
@Path
(
"/executeRule/{rule}"
)
@POST
public
ResponseSet
<
V
>
executeRule
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
[]
ruleArr
=
rule
.
split
(
","
);
setInitFlag
(
req
,
ModuleAnnotationProcess
.
needInitRule
,
ruleArr
);
ResponseSet
<
V
>
res
=
getCommonService
().
executeRule
(
req
,
ruleArr
);
return
res
;
}
@Path
(
"/executeDefault/{rule}"
)
@POST
public
ResponseSet
<
V
>
executeDefault
(
@PathParam
(
"rule"
)
String
rule
,
@RequestBody
V
req
)
{
String
[]
ruleArr
=
rule
.
split
(
","
);
return
getCommonService
().
executeDefault
(
req
,
ruleArr
);
}
@Path
(
"/executeNotify"
)
@POST
public
ResponseSet
<
V
>
executeNotify
(
@RequestBody
V
req
)
{
return
getCommonService
().
executeNotify
(
req
);
}
@Path
(
"/executeDocpan"
)
@POST
public
ResponseSet
<
V
>
executeDocpan
(
@RequestBody
V
req
)
{
return
getCommonService
().
executeDocpan
(
req
);
}
@Path
(
"/executeDocpanDetail"
)
@POST
public
ResponseSet
<
V
>
executeDocpanDetail
(
@RequestBody
V
req
)
{
return
getCommonService
().
executeDocpanDetail
(
req
);
}
private
void
setInitFlag
(
V
req
,
Set
<
String
>
needInitSet
,
String
[]
ruleArr
)
{
Class
<?
extends
AbstractCommonResource
>
aClass
=
this
.
getClass
();
Path
annotation
=
aClass
.
getAnnotation
(
Path
.
class
);
String
path
=
annotation
.
value
();
for
(
String
rule
:
ruleArr
)
{
if
(
needInitSet
.
contains
(
path
+
"@"
+
rule
))
{
req
.
setNeedInit
(
true
);
return
;
}
}
}
}
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