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

[Feature] Action supports constructor injection with parameters in Spring #386

Closed
iohao opened this issue Oct 21, 2024 · 0 comments
Closed
Assignees
Labels
enhancement;功能增强 Function enhancement;功能增强

Comments

@iohao
Copy link
Owner

iohao commented Oct 21, 2024

Introduction

Action supports constructor injection with parameters in Spring.


In terms of injection, action only supports this method at present.

@Component
@ActionController(PersonCmd.cmd)
public class PersonAction {
    @Resource
    PersonService personService;
    ...
}

In the future, action will support constructor injection.

@Component
@AllArgsConstructor
@ActionController(PersonCmd.cmd)
public class PersonAction {    
    final PersonService personService;
    ...
}

Other code

@Service
@AllArgsConstructor
public class HeroService {
    final MongoTemplate mongoTemplate;
    ... 
}

@Service
@AllArgsConstructor
public class PersonService {
    final MongoTemplate mongoTemplate;
    final HeroService heroService;
    ... 
}
@iohao iohao added enhancement;功能增强 Function enhancement;功能增强 future;将要提供 The latest version will be available;近期版本将要提供的功能 labels Oct 21, 2024
@iohao iohao self-assigned this Oct 21, 2024
iohao added a commit that referenced this issue Oct 22, 2024
@iohao iohao removed the future;将要提供 The latest version will be available;近期版本将要提供的功能 label Oct 28, 2024
@iohao iohao closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement;功能增强 Function enhancement;功能增强
Projects
None yet
Development

No branches or pull requests

1 participant