package common.sunshine.model.selling.event;

import common.sunshine.model.Entity;

import java.util.Calendar;

/**
 * 活动默认从当前时间开始,默认持续时间为7天
 * Created by sunshine on 8/23/16.
 */
public abstract class Event extends Entity {
    private final int DURATION = 7;

    private String eventId;

    private String title;

    private String nickname;

    private Calendar start;

    private Calendar end;

    public Event() {
        this.start = Calendar.getInstance();
        this.end = Calendar.getInstance();
        this.end.add(Calendar.DATE, DURATION);
    }

    public Event(Calendar start, Calendar end) {
        this.start = start;
        this.end = end;
    }

    public Event(String title, Calendar start, Calendar end) {
        this(start, end);
        this.title = title;
    }

    public String getEventId() {
        return eventId;
    }

    public void setEventId(String eventId) {
        this.eventId = eventId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public Calendar getStart() {
        return start;
    }

    public void setStart(Calendar start) {
        this.start = start;
    }

    public Calendar getEnd() {
        return end;
    }

    public void setEnd(Calendar end) {
        this.end = end;
    }
}

@@ -93,21 +93,21 @@
 ava.
-util.Calendar
+sql.Timestamp
 ;%0A%0A/
@@ -353,24 +353,25 @@
 private 
-Calendar
+Timestamp
  start;%0A
@@ -383,24 +383,25 @@
 private 
-Calendar
+Timestamp
  end;%0A%0A 
@@ -441,37 +441,56 @@
 start = 
-Calendar.getInstance(
+new Timestamp(System.currentTimeMillis()
 );%0A     
@@ -507,67 +507,61 @@
 d = 
-Calend
+new Timestamp(st
 ar
+t
 .get
-Instance();%0A        this.end.add(Calendar.DATE,
+Time() + 24 * 60 * 60 * 1000 *
  DUR
@@ -596,32 +596,34 @@
 ent(
-Calendar start, Calendar
+Timestamp start, Timestamp
  end
@@ -720,32 +720,34 @@
 le, 
-Calendar start, Calendar
+Timestamp start, Timestamp
  end
@@ -1256,32 +1256,33 @@
 %0A    public 
-Calendar
+Timestamp
  getStart() 
@@ -1337,24 +1337,25 @@
 etStart(
-Calendar
+Timestamp
  start) 
@@ -1402,24 +1402,25 @@
  public 
-Calendar
+Timestamp
  getEnd(
@@ -1477,16 +1477,17 @@
 End(
-Calendar
+Timestamp
  end

fix bugs