Class FeiShuNotifier
java.lang.Object
de.codecentric.boot.admin.server.notify.AbstractEventNotifier
de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier
de.codecentric.boot.admin.server.notify.filter.AbstractContentNotifier
de.codecentric.boot.admin.server.notify.FeiShuNotifier
- All Implemented Interfaces:
Notifier
Notifier submitting events to FeiShu by webhooks.
- Author:
- sweeter
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Constructor Summary
ConstructorsConstructorDescriptionFeiShuNotifier(InstanceRepository repository, org.springframework.web.client.RestTemplate restTemplate) -
Method Summary
Modifier and TypeMethodDescriptionbuildContentModel(InstanceEvent event, Instance instance) Provides the data model used for evaluating the message template.createNotification(InstanceEvent event, Instance instance) protected reactor.core.publisher.Mono<Void>doNotify(InstanceEvent event, Instance instance) getCard()protected StringDefines the default SpEL template string used for message generation.booleanisAtAll()voidsetAtAll(boolean atAll) voidsetCard(FeiShuNotifier.Card card) voidsetMessageType(FeiShuNotifier.MessageType messageType) voidsetRestTemplate(org.springframework.web.client.RestTemplate restTemplate) voidvoidsetWebhookUrl(URI webhookUrl) Methods inherited from class de.codecentric.boot.admin.server.notify.filter.AbstractContentNotifier
createContent, getMessage, setMessageMethods inherited from class de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier
getIgnoreChanges, getLastStatus, notify, setIgnoreChanges, shouldNotify, updateLastStatusMethods inherited from class de.codecentric.boot.admin.server.notify.AbstractEventNotifier
isEnabled, setEnabled
-
Constructor Details
-
FeiShuNotifier
public FeiShuNotifier(InstanceRepository repository, org.springframework.web.client.RestTemplate restTemplate)
-
-
Method Details
-
doNotify
- Specified by:
doNotifyin classAbstractEventNotifier
-
createNotification
protected org.springframework.http.HttpEntity<Map<String,Object>> createNotification(InstanceEvent event, Instance instance) -
buildContentModel
Description copied from class:AbstractContentNotifierProvides the data model used for evaluating the message template.The returned map contains key-value pairs that can be referenced in the SpEL template using #{key} syntax. For example, if the map contains {"name": "MyApp", "status": "UP"}, the template "#{name} is #{status}" would evaluate to "MyApp is UP".
- Overrides:
buildContentModelin classAbstractContentNotifier- Parameters:
event- the instance event containing event-specific datainstance- the instance containing registration and status information- Returns:
- a map of template variables and their values
-
getDefaultMessage
Description copied from class:AbstractContentNotifierDefines the default SpEL template string used for message generation.The template should use #{key} syntax to reference variables provided by
AbstractContentNotifier.buildContentModel(InstanceEvent, Instance). This default can be overridden at runtime usingAbstractContentNotifier.setMessage(String).- Specified by:
getDefaultMessagein classAbstractContentNotifier- Returns:
- the default SpEL template string (e.g., "#{name} is #{status}")
-
getWebhookUrl
-
setWebhookUrl
-
setRestTemplate
public void setRestTemplate(org.springframework.web.client.RestTemplate restTemplate) -
isAtAll
public boolean isAtAll() -
setAtAll
public void setAtAll(boolean atAll) -
getSecret
-
setSecret
-
getMessageType
-
setMessageType
-
getCard
-
setCard
-