package de.jottyfan.camporganizer.module.business.business;

import javax.servlet.http.HttpServletRequest;

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

/**
 *
 * @author jotty
 *
 */
@Controller
public class BusinessController {

	@Autowired
	private HttpServletRequest request;

	@Autowired
	private IBusinessService indexService;

	@GetMapping("/business")
	public String getIndex(Model model) {
		String username = indexService.getCurrentUser(request);
		model.addAttribute("currentUser", username);
		model.addAttribute("campBudgets", indexService.getCampBudgets(username));
		return "business/business";
	}
}
