ConvertProfessionTool.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package com.persagy.fm.profession.model;
  2. import org.mapstruct.*;
  3. import org.mapstruct.MappingTarget;
  4. import org.mapstruct.factory.Mappers;
  5. import com.persagy.fm.profession.model.vo.*;
  6. import com.persagy.fm.profession.model.dto.*;
  7. import java.util.List;
  8. /**
  9. * 专业(Profession) dto、vo、do转换工具类
  10. *
  11. * @author lixing
  12. * @version V1.0 2021-03-19 16:38:21 2021-03-19 16:38:21
  13. */
  14. @Mapper(nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT,
  15. nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
  16. public interface ConvertProfessionTool {
  17. ConvertProfessionTool INSTANCE = Mappers.getMapper(ConvertProfessionTool.class);
  18. /**
  19. * do转换为ResponseItemVO
  20. *
  21. * @param profession do对象
  22. * @return ResponseItemVO
  23. * @author lixing
  24. * @version V1.0 2021-03-19 16:38:21
  25. */
  26. ResponseProfessionItemVO convert2ResponseItemDTO(Profession profession);
  27. /**
  28. * do转换为ResponseListItemVO
  29. *
  30. * @param profession do对象
  31. * @return ResponseListItemVO
  32. * @author lixing
  33. * @version V1.0 2021-03-19 16:38:21
  34. */
  35. ResponseProfessionListItemVO convert2ResponseListItemDTO(Profession profession);
  36. /**
  37. * do列表转换为ResponseListItemVO列表
  38. *
  39. * @param professionList do列表
  40. * @return ResponseListItemVO列表
  41. * @author lixing
  42. * @version V1.0 2021-03-19 16:38:21
  43. */
  44. List<ResponseProfessionListItemVO> convert2List(List<Profession> professionList);
  45. /**
  46. * addDTO转换为do
  47. *
  48. * @param addProfessionDTO addDTO
  49. * @return 要创建的do对象
  50. * @author lixing
  51. * @version V1.0 2021-03-19 16:38:21
  52. */
  53. Profession convertAddDto2Entity(AddProfessionDTO addProfessionDTO);
  54. /**
  55. * updateDTO转换为实体
  56. *
  57. * @param profession 更新前的do对象
  58. * @param updateProfessionDTO updateDTO
  59. * @return 更新后的do对象
  60. * @author lixing
  61. * @version V1.0 2021-03-19 16:38:21
  62. */
  63. Profession convertUpdateDto2Entity(@MappingTarget Profession profession, UpdateProfessionDTO updateProfessionDTO);
  64. }