-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
|
||
<parent> | ||
<groupId>com.uengine</groupId> | ||
<artifactId>education</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>marketing</artifactId> | ||
|
||
</project> |
12 changes: 12 additions & 0 deletions
12
marketing/src/main/java/com/uengine/education/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.uengine.education; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
marketing/src/main/java/com/uengine/education/ClazzDayRegistered.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.uengine.education; | ||
|
||
import java.util.Date; | ||
|
||
/** | ||
* Created by uengine on 2018. 11. 21.. | ||
*/ | ||
public class ClazzDayRegistered { | ||
|
||
String instructorName; | ||
|
||
public String getInstructorName() { | ||
return instructorName; | ||
} | ||
|
||
public void setInstructorName(String instructorName) { | ||
this.instructorName = instructorName; | ||
} | ||
|
||
|
||
|
||
} |
23 changes: 23 additions & 0 deletions
23
marketing/src/main/java/com/uengine/education/EventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.uengine.education; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.cloud.stream.annotation.StreamListener; | ||
import org.springframework.messaging.handler.annotation.Payload; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class EventListener { | ||
|
||
/** version 1. callback version **/ | ||
@StreamListener(Streams.INPUT) | ||
@JsonDeserialize(as = ClazzDayRegistered.class) | ||
public void handleClazzDay(@Payload ClazzDayRegistered clazzDayRegistered) { | ||
|
||
System.out.println("<이메일 발송>"); | ||
System.out.println("제목: " + clazzDayRegistered.getInstructorName() +" 강사의 OOO강의 [마감임박]"); | ||
|
||
|
||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
marketing/src/main/java/com/uengine/education/Streams.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.uengine.education; | ||
|
||
import org.springframework.cloud.stream.annotation.Input; | ||
import org.springframework.messaging.SubscribableChannel; | ||
|
||
public interface Streams { | ||
String INPUT = "class-topic"; | ||
|
||
@Input(INPUT) | ||
SubscribableChannel inboundGreetings(); | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
marketing/src/main/java/com/uengine/education/StreamsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.uengine.education; | ||
|
||
import org.springframework.cloud.stream.annotation.EnableBinding; | ||
|
||
@EnableBinding(Streams.class) | ||
public class StreamsConfig { | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
spring: | ||
cloud: | ||
stream: | ||
kafka: | ||
binder: | ||
brokers: education-kafka:9092 # ${vcap.services.kakfa.host_port} and inject value from env variable | ||
zkNodes: education-kafka-zookeeper:2181 | ||
bindings: | ||
class-topic: | ||
destination: class.topic | ||
contentType: application/json | ||
|
||
eureka: | ||
client: | ||
enabled: false |
16 changes: 16 additions & 0 deletions
16
marketing/src/test/java/com/uengine/education/EducationApplicationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.uengine.education; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
@RunWith(SpringRunner.class) | ||
@SpringBootTest | ||
public class EducationApplicationTests { | ||
|
||
@Test | ||
public void contextLoads() { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
|
||
<module>course</module> | ||
<module>calendar</module> | ||
<module>marketing</module> | ||
|
||
</modules> | ||
|
||
|