diff --git a/application/src/main/java/run/halo/app/notification/endpoint/ConsoleNotifierEndpoint.java b/application/src/main/java/run/halo/app/notification/endpoint/ConsoleNotifierEndpoint.java index b00d3976b0..b97f081e17 100644 --- a/application/src/main/java/run/halo/app/notification/endpoint/ConsoleNotifierEndpoint.java +++ b/application/src/main/java/run/halo/app/notification/endpoint/ConsoleNotifierEndpoint.java @@ -36,7 +36,7 @@ public class ConsoleNotifierEndpoint implements CustomEndpoint { public RouterFunction endpoint() { var tag = "api.console.halo.run/v1alpha1/Notifier"; return SpringdocRouteBuilder.route() - .GET("/notifiers/{name}/senderConfig", this::fetchSenderConfig, + .GET("/notifiers/{name}/sender-config", this::fetchSenderConfig, builder -> builder.operationId("FetchSenderConfig") .description("Fetch sender config of notifier") .tag(tag) @@ -48,7 +48,7 @@ public RouterFunction endpoint() { ) .response(responseBuilder().implementation(ObjectNode.class)) ) - .POST("/notifiers/{name}/senderConfig", this::saveSenderConfig, + .POST("/notifiers/{name}/sender-config", this::saveSenderConfig, builder -> builder.operationId("SaveSenderConfig") .description("Save sender config of notifier") .tag(tag) diff --git a/application/src/main/java/run/halo/app/notification/endpoint/UserNotifierEndpoint.java b/application/src/main/java/run/halo/app/notification/endpoint/UserNotifierEndpoint.java index c60fcbddca..31a98d1f36 100644 --- a/application/src/main/java/run/halo/app/notification/endpoint/UserNotifierEndpoint.java +++ b/application/src/main/java/run/halo/app/notification/endpoint/UserNotifierEndpoint.java @@ -37,7 +37,7 @@ public class UserNotifierEndpoint implements CustomEndpoint { public RouterFunction endpoint() { var tag = "api.notification.halo.run/v1alpha1/Notifier"; return SpringdocRouteBuilder.route() - .GET("/notifiers/{name}/receiverConfig", this::fetchReceiverConfig, + .GET("/notifiers/{name}/receiver-config", this::fetchReceiverConfig, builder -> builder.operationId("FetchReceiverConfig") .description("Fetch receiver config of notifier") .tag(tag) @@ -49,7 +49,7 @@ public RouterFunction endpoint() { ) .response(responseBuilder().implementation(ObjectNode.class)) ) - .POST("/notifiers/{name}/receiverConfig", this::saveReceiverConfig, + .POST("/notifiers/{name}/receiver-config", this::saveReceiverConfig, builder -> builder.operationId("SaveReceiverConfig") .description("Save receiver config of notifier") .tag(tag) diff --git a/application/src/main/resources/extensions/role-template-authenticated.yaml b/application/src/main/resources/extensions/role-template-authenticated.yaml index 7f2d9e05e5..0424b7544c 100644 --- a/application/src/main/resources/extensions/role-template-authenticated.yaml +++ b/application/src/main/resources/extensions/role-template-authenticated.yaml @@ -127,5 +127,5 @@ rules: resources: [ "notifications/mark-as-read", "notifications/mark-specified-as-read" ] verbs: [ "update" ] - apiGroups: [ "api.notification.halo.run" ] - resources: [ "notifiers/receiverConfig" ] + resources: [ "notifiers/receiver-config" ] verbs: [ "get", "update" ] diff --git a/application/src/main/resources/extensions/role-template-notification.yaml b/application/src/main/resources/extensions/role-template-notification.yaml index 492b764a82..0f59b87ae8 100644 --- a/application/src/main/resources/extensions/role-template-notification.yaml +++ b/application/src/main/resources/extensions/role-template-notification.yaml @@ -11,5 +11,5 @@ metadata: ["system:notifier:configuration"] rules: - apiGroups: [ "api.console.halo.run" ] - resources: [ "notifiers/senderConfig" ] + resources: [ "notifiers/sender-config" ] verbs: [ "get", "update" ] diff --git a/docs/notification/README.md b/docs/notification/README.md index 4531438116..f672332e99 100644 --- a/docs/notification/README.md +++ b/docs/notification/README.md @@ -248,13 +248,13 @@ spec: 管理员获取和保存通知器发送配置的 APIs: -1. 获取通知器发送方配置:`GET /apis/api.console.halo.run/v1alpha1/notifiers/{name}/senderConfig` -2. 保存通知器发送方配置:`POST /apis/api.console.halo.run/v1alpha1/notifiers/{name}/senderConfig` +1. 获取通知器发送方配置:`GET /apis/api.console.halo.run/v1alpha1/notifiers/{name}/sender-config` +2. 保存通知器发送方配置:`POST /apis/api.console.halo.run/v1alpha1/notifiers/{name}/sender-config` 个人中心用户获取和保存对应通知器接收消息配置的 APIs: -1. 获取通知器接收消息配置:`GET /apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiverConfig` -2. 获取通知器接收消息配置:`POST /apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiverConfig` +1. 获取通知器接收消息配置:`GET /apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiver-config` +2. 获取通知器接收消息配置:`POST /apis/api.notification.halo.run/v1alpha1/notifiers/{name}/receiver-config` 通知器扩展点用于实现发送通知的方式: