想提供信息收集接口,无需登录。但目前接口都要登录
@Component
public class CustomerEndpoint implements CustomEndpoint {
@Override
public RouterFunction<ServerResponse> endpoint() {
return RouterFunctions.route()
.POST("/customers", RequestPredicates.accept(APPLICATION_JSON), this::createCustomer)
.build();
}
@AuthorizeReturnObject
private Mono<ServerResponse> createCustomer(ServerRequest request) {
// TODO 发送邮件通知管理员
System.out.println("hahahahha2");
return ServerResponse.ok().bodyValue("Hello");
}
@Override
public GroupVersion groupVersion() {
return new GroupVersion("my-plugin.halo.run", "v1alpha1");
}
}