PageRenderTime 86ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/src/com/jieshuhuiyou/entity/notifications/EvaluatedNotification.java

https://bitbucket.org/psjay/ants-bookbase
Java | 49 lines | 32 code | 12 blank | 5 comment | 0 complexity | 68791a24a5cf367ac2f209ed3f836f1d MD5 | raw file
  1. package com.jieshuhuiyou.entity.notifications;
  2. import com.alibaba.fastjson.annotation.JSONCreator;
  3. import com.alibaba.fastjson.annotation.JSONField;
  4. import com.jieshuhuiyou.entity.Borrow;
  5. import com.jieshuhuiyou.entity.Sharing;
  6. import com.jieshuhuiyou.entity.Notification.Type;
  7. import com.jieshuhuiyou.entity.User;
  8. /**
  9. * ????????
  10. * @author Michael
  11. *
  12. */
  13. public class EvaluatedNotification extends AbstractNotification{
  14. private Borrow borrow;
  15. @JSONCreator
  16. public EvaluatedNotification(@JSONField(name = "borrow") Borrow borrow) {
  17. this.borrow = borrow;
  18. }
  19. @Override
  20. public String toHTML() {
  21. return "<a href=\"\\user\\" + Integer.toString(borrow.getSharing().getUser().getId()) + "\">" + borrow.getSharing().getUser().getName() + "</a>" + "?????<a href=\"\\book\\" + Integer.toString(borrow.getSharing().getBook().getId()) + "\">?" + borrow.getSharing().getBook().getTitle() + "?</a>?????????????????????????????";
  22. }
  23. @Override
  24. public User getOwner() {
  25. return borrow.getUser();
  26. }
  27. @Override
  28. public Type getType() {
  29. return Type.EVALUATE_FINISHED;
  30. }
  31. public Borrow getBorrow() {
  32. return borrow;
  33. }
  34. public void setBorrow(Borrow borrow) {
  35. this.borrow = borrow;
  36. }
  37. }