/src/com/jieshuhuiyou/entity/notifications/EvaluatedNotification.java
Java | 49 lines | 32 code | 12 blank | 5 comment | 0 complexity | 68791a24a5cf367ac2f209ed3f836f1d MD5 | raw file
- package com.jieshuhuiyou.entity.notifications;
- import com.alibaba.fastjson.annotation.JSONCreator;
- import com.alibaba.fastjson.annotation.JSONField;
- import com.jieshuhuiyou.entity.Borrow;
- import com.jieshuhuiyou.entity.Sharing;
- import com.jieshuhuiyou.entity.Notification.Type;
- import com.jieshuhuiyou.entity.User;
- /**
- * ????????
- * @author Michael
- *
- */
- public class EvaluatedNotification extends AbstractNotification{
- private Borrow borrow;
- @JSONCreator
- public EvaluatedNotification(@JSONField(name = "borrow") Borrow borrow) {
- this.borrow = borrow;
- }
-
-
- @Override
- public String toHTML() {
- 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>?????????????????????????????";
-
- }
- @Override
- public User getOwner() {
- return borrow.getUser();
- }
- @Override
- public Type getType() {
- return Type.EVALUATE_FINISHED;
- }
-
- public Borrow getBorrow() {
- return borrow;
- }
- public void setBorrow(Borrow borrow) {
- this.borrow = borrow;
- }
- }