Skip to content

Mapper 接口如何全局生效 #166

Description

@deveropers

状态类使用的是值对象类型,继承自 BaseStatus(含有 code、name两个字段),写了一个全局的 BaseStatusMapper 实现了从 BaseStatus -> Integer 的自动映射转换规则,在对应实体上打上注解 @AutoMapper(target = User.class, uses = BaseStatusMapper.class) ,这样可以生效能够实现 status 对象到 Integer 的互转。
现在我想全局生效,而不需要在每个实体对象上都加上 uses = BaseStatusMapper.class,需要怎么样进行全局生效呢?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions