/**
 * Copyright (c) 2005-2012 https://github.com/zhangkaitao
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package com.huntering.index.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.huntering.beans.account.entity.Account;
import com.huntering.beans.account.service.AccountService;
import com.huntering.beans.activity.service.ActivityService;
import com.huntering.beans.message.entity.Message;
import com.huntering.beans.message.service.MessageService;
import com.huntering.beans.profile.service.PeopleService;
import com.huntering.security.CurrentAccount;

@Controller("indexController")
@RequestMapping("/")
public class IndexController {

	@Autowired
	private ActivityService activityService;
	
	@Autowired
    private AccountService accountService;
	
	@Autowired
	private PeopleService peopleService;
	
    @Autowired
    private MessageService messageService;

    @RequestMapping(value = "/welcome")
    public String welcome(@CurrentAccount Account loginUser, Model model) {

        model.addAttribute("user", loginUser);

        return "admin/index/welcome";
    }
    
    @RequestMapping(value = "/")
    public String home(@CurrentAccount Account loginUser, Model model) {

        model.addAttribute("user", loginUser);

        return "admin/index/welcome";
    }
    
    @RequestMapping(value = "/home")
    public String homeIndex(@CurrentAccount Account loginUser, Model model) {

    	List<Message> messages = messageService.findByAccountId(loginUser.getId());
        model.addAttribute("user", loginUser);
        model.addAttribute("messages", messages);

        return "front/home";
    }


}

@@ -1350,16 +1350,20 @@
 lue = %22/
+home
 %22)%0A    p
@@ -1439,48 +1439,179 @@
     
-    model.addAttribute(%22user%22, loginUser
+%09List%3CMessage%3E messages = messageService.findByAccountId(loginUser.getId());%0A        model.addAttribute(%22user%22, loginUser);%0A        model.addAttribute(%22messages%22, messages
 );%0A%0A
@@ -1626,32 +1626,23 @@
 return %22
-admin/index/welc
+front/h
 ome%22;%0A  
@@ -1672,36 +1672,32 @@
 pping(value = %22/
-home
 %22)%0A    public St

Modify the root page to message page