Skip to content

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

@ichunming

Description

@ichunming

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

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

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

@Resource
private AccountGateway accountGateway;`

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions