package com.example.bot.spring.textsender;

import java.util.*;

import org.springframework.beans.factory.annotation.Autowired;

//import java.util.GregorianCalendar;
//import java.util.List;
//import java.util.Set;
//import java.util.concurrent.TimeUnit;
import com.example.bot.spring.database.*;
import com.linecorp.bot.client.LineMessagingClient;
import com.linecorp.bot.model.PushMessage;
import com.linecorp.bot.model.message.Message;
import com.linecorp.bot.model.message.TextMessage;

public class UQAnswerReplier implements Broadcaster{
	
	@Autowired
	LineMessagingClient lineMessagingClient;

	public UQAnswerReplier() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public void broadcast() throws Exception {
		UQDBEngine searchEngine = new UQDBEngine();
		ArrayList<String> reply=searchEngine.answer();
		for(int i=0; i<reply.size(); i++) {
			String userID;
			String question;
			String answer;
			String[] temp = reply.get(i).split(",");
			userID=temp[0];
			question=temp[1];
			answer=temp[2];
			Message message = new TextMessage("For your question "+question+", the answer is "+answer);
			lineMessagingClient.pushMessage(new PushMessage(userID, message));
		}
	}
}

@@ -343,16 +343,72 @@
 Client;%0A
+import com.linecorp.bot.client.LineMessagingClientImpl;%0A
 import c
@@ -628,16 +628,20 @@
 ngClient
+Impl
  lineMes
@@ -725,16 +725,71 @@
 or stub%0A
+%09%09lineMessagingClient = new LineMessagingClientImpl();%0A
 %09%7D%0A%0A%09@Ov
@@ -839,16 +839,77 @@
 ption %7B%0A
+%09%09System.out.println(%22You are here in the UQAnswerReplier%22);%0A
 %09%09UQDBEn

Test again