From a2afd81213946e181da99d4f93dfa9fc21b51644 Mon Sep 17 00:00:00 2001
From: doudou <coderlmm@gmail.com>
Date: Mon, 19 Jun 2017 14:42:24 +0800
Subject: [PATCH] homework

---
 .gitignore                                    |  2 --
 .../com/coderising/ood/ocp/DateFormater.java  | 14 +++++++++++++
 .../java/com/coderising/ood/ocp/DateUtil.java | 10 ++++++++++
 .../java/com/coderising/ood/ocp/Formater.java | 12 +++++++++++
 .../java/com/coderising/ood/ocp/Logger.java   | 20 +++++++++++++++++++
 .../com/coderising/ood/ocp/MailPrintUtil.java | 10 ++++++++++
 .../java/com/coderising/ood/ocp/Printer.java  | 11 ++++++++++
 .../com/coderising/ood/ocp/SMSPrintUtil.java  |  9 +++++++++
 8 files changed, 86 insertions(+), 2 deletions(-)
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateFormater.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateUtil.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Formater.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Logger.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/MailPrintUtil.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Printer.java
 create mode 100644 students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/SMSPrintUtil.java

diff --git a/.gitignore b/.gitignore
index 4b65de1971..ccf385a085 100644
--- a/.gitignore
+++ b/.gitignore
@@ -280,8 +280,6 @@ target
 liuxin/.DS_Store
 liuxin/src/.DS_Store
 
-students/*
-!students/785396327
 
 
 
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateFormater.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateFormater.java
new file mode 100644
index 0000000000..18b61a77b3
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateFormater.java
@@ -0,0 +1,14 @@
+package com.coderising.ood.ocp;
+
+/**
+ * 日期类型格式化模板
+ * Created by Tudou on 2017/6/19.
+ */
+public class DateFormater extends Formater {
+
+    @Override
+    public String formatMessage(String message) {
+        String txtDate = DateUtil.getCurrentDateAsString();
+        return txtDate + " : " + message;
+    }
+}
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateUtil.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateUtil.java
new file mode 100644
index 0000000000..b6cf28c096
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/DateUtil.java
@@ -0,0 +1,10 @@
+package com.coderising.ood.ocp;
+
+public class DateUtil {
+
+	public static String getCurrentDateAsString() {
+		
+		return null;
+	}
+
+}
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Formater.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Formater.java
new file mode 100644
index 0000000000..7a94fea749
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Formater.java
@@ -0,0 +1,12 @@
+package com.coderising.ood.ocp;
+
+/**
+ * 格式化打印参数基类
+ * Created by Tudou on 2017/6/19.
+ */
+public class Formater {
+
+    public String formatMessage(String message){
+        return message;
+    }
+}
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Logger.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Logger.java
new file mode 100644
index 0000000000..a9f62d6a66
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Logger.java
@@ -0,0 +1,20 @@
+package com.coderising.ood.ocp;
+
+public class Logger {
+
+    private Printer printer;
+    private Formater formater;
+
+
+    public Logger(Printer printer, Formater formater) {
+        this.printer = printer;
+        this.formater = formater;
+    }
+
+
+    public void log(String msg) {
+        String logMsg = formater.formatMessage(msg);
+        printer.print(logMsg);
+    }
+}
+
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/MailPrintUtil.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/MailPrintUtil.java
new file mode 100644
index 0000000000..d522e5e7d2
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/MailPrintUtil.java
@@ -0,0 +1,10 @@
+package com.coderising.ood.ocp;
+
+
+public class MailPrintUtil extends Printer {
+
+	@Override
+	public void print(String msg) {
+
+	}
+}
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Printer.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Printer.java
new file mode 100644
index 0000000000..caa28fbf0c
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/Printer.java
@@ -0,0 +1,11 @@
+package com.coderising.ood.ocp;
+
+/**
+ * Created by Tudou on 2017/6/19.
+ */
+public class Printer {
+
+    public void print(String msg){
+        System.out.println(msg);
+    }
+}
diff --git a/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/SMSPrintUtil.java b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/SMSPrintUtil.java
new file mode 100644
index 0000000000..204256f44b
--- /dev/null
+++ b/students/759412759/ood-assignment/src/main/java/com/coderising/ood/ocp/SMSPrintUtil.java
@@ -0,0 +1,9 @@
+package com.coderising.ood.ocp;
+
+public class SMSPrintUtil extends Printer {
+
+	@Override
+	public void print(String msg) {
+
+	}
+}
