CShisan

Results 12 comments of CShisan

> Please elaborate. 请详细说明。 ![image](https://github.com/valinet/ExplorerPatcher/assets/55305718/ff2fcd45-0ecc-4d6d-b830-e199909d5d5b) I only want to open this item and not other items.

> He meant just like #2828他的意思就像#2828 It should mean something similar

> `qualifiedByName`引用的方法,需要定义在别的转换接口中,并通过 uses 进行依赖调用。 > > 你可以看下生成的转换接口,`type2Nav` 在接口中,调用不到。 ``` @Mapper( config = AutoMapperConfig$296.class, uses = {Test.class}, imports = {} ) public interface ResourceToRouteVOMapper extends BaseMapper { @Mapping( target = "meta.title",...

> 对,类中的这种方法,并不会添加到转换接口中。 > > 如果想要调用到,需要通过 uses 属性来依赖。 `@AutoMapper(target = Resource.class, uses = RouteVO.class, convertGenerate = false)` 我有使用 uses 属性来依赖,你的意思是一定要写一个ResTypeEnumToBooleanMapper转换接口然后再uses`ResTypeEnumToBooleanMapper`才能被应用到吗

> 除了你用的这种方法,还可以定义一个接口,用 `@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)` 标注。 > > 在改接口中添加 `ResTypeEnum` 转换为 `Boolean` 类型的方法,例如: > > ```java > @Mapper(componentModel = MappingConstants.ComponentModel.SPRING) > public interface ResTypeEnumToBooleanMapper { > default Boolean type2Nav(ResTypeEnum type)...

刚接触mapstruct 不是太懂 我总结一下你说的两种方法,你看看对不对 1.定义一个用于转换type2Nav的转换接口,通过 uses 进行依赖调用,然后用qualifiedByName引用 2.定义一个用于转换type2Nav的转换接口,用`@Mapper(componentModel = MappingConstants.ComponentModel.SPRING)`标注,通过 uses 进行依赖调用,不需要qualifiedByName引用 1和2的区别就是用注解标注以后就不需要qualifiedByName引用 这样理解对吗

> 最后这个报错,看下生成的转换接口实现类 ![image](https://github.com/user-attachments/assets/39b2de88-8eef-423c-979f-fa265a91aca4) ![image](https://github.com/user-attachments/assets/33e9491a-deca-4af1-93a1-929a0659e38f) 没有实现类 只有接口 报错了

不知道为什么我先是使用默认`@Mapper()`正确生成以后再加上`componentModel = MappingConstants.ComponentModel.SPRING`就可以正确生成了

https://mybatis-flex.com/zh/faq.html#springboot-3-2-%E9%A1%B9%E7%9B%AE-%E5%90%AF%E5%8A%A8%E6%8A%A5%E9%94%99-invalid-value-type-for-attribute-factorybeanobjecttype-java-lang-string

> 你这是哪个版本啊? 1.9.5