/*
 * Copyright 2016 LINE Corporation
 *
 * LINE Corporation licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.example.bot.spring.echo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


import com.linecorp.bot.model.event.Event;
import com.linecorp.bot.model.event.MessageEvent;
import com.linecorp.bot.model.event.message.TextMessageContent;
import com.linecorp.bot.model.message.TextMessage;
import com.linecorp.bot.spring.boot.annotation.EventMapping;
import com.linecorp.bot.spring.boot.annotation.LineMessageHandler;

import com.linecorp.bot.client.LineMessagingService;
import com.linecorp.bot.model.ReplyMessage;
import com.linecorp.bot.model.event.BeaconEvent;
import com.linecorp.bot.model.event.Event;
import com.linecorp.bot.model.event.MessageEvent;
import com.linecorp.bot.model.event.beacon.BeaconContent;
import com.linecorp.bot.model.event.message.MessageContent;
import com.linecorp.bot.model.event.message.TextMessageContent;
import com.linecorp.bot.model.message.TextMessage;
import com.linecorp.bot.model.response.BotApiResponse;
import com.linecorp.bot.spring.boot.annotation.LineBotMessages;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.Date;
import java.util.List;

@SpringBootApplication
@LineMessageHandler
public class EchoApplication {
    public static void main(String[] args) {
        SpringApplication.run(EchoApplication.class, args);
    }

    @EventMapping
    public TextMessage handleTextMessageEvent(MessageEvent<TextMessageContent> event) {
        System.out.println("event: " + event);
        return new TextMessage(event.getMessage().getText());
    }

    @EventMapping
    public void handleDefaultMessageEvent(Event event) {
        System.out.println("event: " + event);
    }
    
    @EventMapping
    public Message handleBeaconMessageEvent(BeaconEvent event) {
    System.out.println(event.getBeacon().getHwid()); //HWIDを標準出力
    return new TextMessage("LINE Beanconから通知だよ！砂金さん、ありがとうございました！");
    }  
}

@@ -1152,216 +1152,26 @@
 bot.
-client.LineMessagingService;%0Aimport com.linecorp.bot.model.ReplyMessage;%0Aimport com.linecorp.bot.model.event.BeaconEvent;%0Aimport com.linecorp.bot.model.event.Event;%0Aimport com.linecorp.bot.model.event.Message
+model.event.Beacon
 Even
@@ -1275,16 +1275,21 @@
 message.
+Image
 MessageC
@@ -1332,36 +1332,39 @@
 l.event.message.
-Text
+Sticker
 MessageContent;%0A
@@ -1385,32 +1385,38 @@
 ecorp.bot.model.
+event.
 message.TextMess
@@ -1422,311 +1422,122 @@
 sage
-;%0Aimport com.linecorp.bot.model.response.BotApiResponse;%0Aimport com.linecorp.bot.spring.
+Content;%0Aimport com.nic.line
 bo
-o
 t.
-annotation.LineBotMessages;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework
+meetbeacon.app.MeetBeaconApplication;%0A%0Aimport com.linecorp
 .bo
-o
 t.
-autoconfigure.EnableAutoConfiguration;%0Aimport org.springframework.web.bind.annotation.*
+model.event.Message
 ;%0A%0Ai

Update EchoApplication.java