NoticeWrapper.java 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.modules.desk.wrapper;
  18. import lombok.AllArgsConstructor;
  19. import org.springblade.core.mp.support.BaseEntityWrapper;
  20. import org.springblade.core.tool.utils.BeanUtil;
  21. import org.springblade.modules.desk.entity.Notice;
  22. import org.springblade.modules.desk.vo.NoticeVO;
  23. import org.springblade.modules.system.service.IDictService;
  24. /**
  25. * Notice包装类,返回视图层所需的字段
  26. *
  27. * @author Chill
  28. */
  29. @AllArgsConstructor
  30. public class NoticeWrapper extends BaseEntityWrapper<Notice, NoticeVO> {
  31. private IDictService dictService;
  32. @Override
  33. public NoticeVO entityVO(Notice notice) {
  34. NoticeVO noticeVO = BeanUtil.copy(notice, NoticeVO.class);
  35. String categoryName = dictService.getValue("notice", noticeVO.getCategory());
  36. noticeVO.setCategoryName(categoryName);
  37. return noticeVO;
  38. }
  39. }