1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.factory.Mappers;
import java.util.List;
@Mapper(uses = TypeConversionWorker.class) public interface ShopConvert {
ShopConvert INSTANCE = Mappers.getMapper(ShopConvert.class); @Mapping(target = "serviceField", source = "serviceField", qualifiedByName = "jsonStringToNameObject") @Mapping(target = "costField", source = "costField", qualifiedByName = "jsonStringToNameValueObject") @Mapping(target = "examinationField", source = "examinationField", qualifiedByName = "jsonStringToValueObject") List<ShopRespVO> convertList(List<ShopDO> list);
List<ShopSimpleRespVO> convertList02(List<ShopDO> list);
@Mapping(target = "serviceField", source = "serviceField", qualifiedByName = "jsonStringToNameObject") @Mapping(target = "costField", source = "costField", qualifiedByName = "jsonStringToNameValueObject") @Mapping(target = "examinationField", source = "examinationField", qualifiedByName = "jsonStringToValueObject") ShopRespVO convert(ShopDO bean);
@Mapping(target = "serviceField", source = "serviceField", qualifiedByName = "toJsonString") @Mapping(target = "costField", source = "costField", qualifiedByName = "toJsonString") @Mapping(target = "examinationField", source = "examinationField", qualifiedByName = "toJsonString") ShopDO convert(ShopCreateReqVO bean);
@Mapping(target = "serviceField", source = "serviceField", qualifiedByName = "toJsonString") @Mapping(target = "costField", source = "costField", qualifiedByName = "toJsonString") @Mapping(target = "examinationField", source = "examinationField", qualifiedByName = "toJsonString") ShopDO convert(ShopUpdateReqVO bean); }
|