Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lcj-btp-java-app
Project
Project
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
郭智朋
lcj-btp-java-app
Commits
65bea225
Commit
65bea225
authored
Feb 18, 2025
by
guozhipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odata接口
parent
69719eef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
feishuService.cds
srv/feishuService.cds
+6
-0
OpenFeishuServiceHandler.java
...omer/lianchuangjie/handlers/OpenFeishuServiceHandler.java
+39
-0
No files found.
srv/feishuService.cds
View file @
65bea225
...
@@ -11,3 +11,9 @@ service feishuService {
...
@@ -11,3 +11,9 @@ service feishuService {
//视图
//视图
entity FeiShuApprovalCodeView as projection on feishuDB.FeiShuApprovalCodeView;//飞书审批定义视图
entity FeiShuApprovalCodeView as projection on feishuDB.FeiShuApprovalCodeView;//飞书审批定义视图
}
}
//开放接口
service openFeishuService @(requires: 'any'){
//实体
entity FeiShuApprover as projection on feishuDB.FeiShuApprover;
}
srv/src/main/java/customer/lianchuangjie/handlers/OpenFeishuServiceHandler.java
0 → 100644
View file @
65bea225
package
customer
.
lianchuangjie
.
handlers
;
import
java.util.HashMap
;
import
java.util.Map
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
com.sap.cds.services.cds.CdsCreateEventContext
;
import
com.sap.cds.services.cds.CdsReadEventContext
;
import
com.sap.cds.services.cds.CqnService
;
import
com.sap.cds.services.handler.EventHandler
;
import
com.sap.cds.services.handler.annotations.On
;
import
com.sap.cds.services.handler.annotations.ServiceName
;
/**
* 参考文档:https://developers.sap.com/tutorials/cp-cap-java-custom-handler.html
*/
@Slf4j
@Component
@ServiceName
(
"openFeishuService"
)
public
class
OpenFeishuServiceHandler
implements
EventHandler
{
private
Map
<
Object
,
Map
<
String
,
Object
>>
results
=
new
HashMap
<>();
@On
(
event
=
CqnService
.
EVENT_CREATE
,
entity
=
"openFeishuService.FeiShuApprover"
)
public
void
onCreate
(
CdsCreateEventContext
context
)
{
log
.
info
(
"OpenFeishuServiceHandler[openFeishuService.FeiShuApprover].onCreate"
);
context
.
setResult
(
results
.
values
());
}
@On
(
event
=
CqnService
.
EVENT_READ
,
entity
=
"openFeishuService.FeiShuApprover"
)
public
void
onRead
(
CdsReadEventContext
context
)
{
log
.
info
(
"OpenFeishuServiceHandler[openFeishuService.FeiShuApprover].onRead"
);
context
.
setResult
(
results
.
values
());
}
/*@On(event = CqnService.EVENT_UPDATE, entity = "openFeishuService.FeiShuApprover")
public void onUpdate(CdsReadEventContext context) {
log.info("OpenFeishuServiceHandler[openFeishuService.FeiShuApprover].onUpdate");
context.setResult(results.values());
}*/
}
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