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

实体内使用服务如何注入 #551

Open
ichunming opened this issue Sep 18, 2024 · 0 comments
Open

实体内使用服务如何注入 #551

ichunming opened this issue Sep 18, 2024 · 0 comments

Comments

@ichunming
Copy link

`public class Account {
/**
* 用户号码
*/
private long phoneNo;

/**
 * 账户余额
 */
private Money remaining;

/**
 * 账户所拥有的套餐
 */
@JsonIgnore
private List<ChargePlan> chargePlanList = new ArrayList<>();;

@Resource
private AccountGateway accountGateway;`

这里的@resource方式注入AccountGateway,是如何实现注入的?我看生成Account时候这个属性没有设置,不知道是通过什么机制注入的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant