Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(microservice): transport custom events #667

Merged
merged 2 commits into from
Feb 12, 2023
Merged

Conversation

wibus-wee
Copy link
Member

@wibus-wee wibus-wee commented Feb 12, 2023

需要新增一个 events.yaml

接口如下:

interface IEventConfigItem {
  path: string;
  method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
  handler: string;
  emit?: boolean;
}

interface IEventConfig {
  [key: string]: IEventConfigItem[];
}

示例:

render: # controller --> {API}/render/*
  - path: /events # {API}/render/events
    method: get
    handler: events.get # 发布活动
  - path: /events/{id} # {API}/render/events/{id}
    method: get
    handler: events.get.id
  - path: /events
    method: post
    handler: events.post

image

@wibus-wee wibus-wee self-assigned this Feb 12, 2023
@wibus-wee wibus-wee mentioned this pull request Feb 12, 2023
@github-actions github-actions bot added the ci-passed PRs that was passed in ci label Feb 12, 2023
@wibus-wee wibus-wee merged commit 15e1e48 into main Feb 12, 2023
@wibus-wee wibus-wee deleted the feat/custom-events branch February 12, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-passed PRs that was passed in ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant