spring-axum-macros

Crates.iospring-axum-macros
lib.rsspring-axum-macros
version0.1.3
created_at2025-10-13 15:34:24.724044+00
updated_at2025-10-17 15:51:51.924561+00
descriptionProcedural macros for spring-axum: auto discovery, controllers, components, interceptors, transactions, caching, events, and SQL/Mapper.
homepagehttps://gitee.com/luzhihaoTestingLab/spring-axum
repositoryhttps://gitee.com/luzhihaoTestingLab/spring-axum.git
max_upload_size
id1880678
size24,565
luzhihaoTestingLab (luzhihaoTestingLab)

documentation

https://docs.rs/spring-axum-macros

README

spring-axum-macros

Procedural macros for spring-axum: auto discovery, controllers, components, interceptors, transactions, caching, events, and SQL/Mapper.

Repository: https://gitee.com/luzhihaoTestingLab/spring-axum.git

Examples

use spring_axum_macros::{controller, route_get, component, interceptor, transactional, cacheable, event_listener, sql, mapper};

#[controller(hello)]
struct UserController;

#[route_get("/users/:id")] 
async fn get_user(id: i64) -> String { format!("{}", id) }

#[component]
#[derive(Default)]
struct MyService;

#[interceptor]
#[derive(Default, Clone)]
struct MyInterceptor;

#[mapper]
impl UserMapper {
    #[sql("SELECT * FROM users WHERE id = #{id}")]
    async fn find_by_id(&self, id: i64) -> anyhow::Result<User> { todo!() }
}

See the root repository README for detailed usage.

License

MIT

Commit count: 0

cargo fmt