package com.dreamchain.skeleton.web;

import com.dreamchain.skeleton.aoptest.BeforeAop;
import com.dreamchain.skeleton.model.User;
import com.dreamchain.skeleton.service.UserService;
import org.springframework.aop.framework.ProxyFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/secret")
public class SecretController {

	@Autowired
	UserService userService;

	@RequestMapping(value = "/info", method = RequestMethod.GET, headers="Accept=application/json")
	public @ResponseBody
	List<String> listAllUsers() {
		BeforeAop boa=new BeforeAop();
		ProxyFactoryBean pfb=new ProxyFactoryBean();
		pfb.setTarget(userService);
		pfb.addAdvice(boa);

		UserService userService1=(UserService)pfb.getObject();
//		User user=userService1.get(301l);
//		System.out.println(user.getName());


		List<String> lst=new ArrayList<String>();
//		User s=new User();
//		s.setName("Babu");
//		s.setEmail("BD");
//
//		User s1=new User();
//		s1.setName("Babu1");
//		s1.setEmail("BD1");

		lst.add("ggg");
//		lst.add(s1);

		return lst;
	}

}

@@ -603,34 +603,8 @@
 ler%0A
-@RequestMapping(%22/secret%22)
 %0Apub
@@ -638,707 +638,360 @@
 %7B%0A%0A%09
-@Autowired%0A%09UserService userService;%0A%0A%09@RequestMapping(value = %22/info%22, method = RequestMethod.GET, headers=%22Accept=application/json%22)%0A%09public @ResponseBody%0A%09List%3CString%3E listAllUsers() %7B%0A%09%09BeforeAop boa=new BeforeAop();%0A%09%09ProxyFactoryBean pfb=new ProxyFactoryBean();%0A%09%09pfb.setTarget(userService);%0A%09%09pfb.addAdvice(boa);%0A%0A%09%09UserService userService1=(UserService)pfb.getObject();%0A//%09%09User user=userService1.get(301l);%0A//%09%09System.out.println(user.
+%0A%0A    @RequestMapping(%22/tables%22)%0A    public ModelAndView main(HttpServletRequest request, HttpServletResponse response) throws FileNotFoundException, TransformerException, ParserConfigurationException %7B%0A        ModelAndView model = new ModelAndView();%0A        String pa
 ge
-t
 Name
-());%0A%0A%0A%09%09List%3CString%3E lst=new ArrayList%3CString%3E();%0A//%09%09User s=new User();%0A//%09%09s.setName(%22Babu%22);%0A//%09%09s.setEmail(%22BD%22);%0A//%0A//%09%09User s1=new User();%0A//%09%09s1.setName(%22Babu1%22);%0A//%09%09s1.setEmail(%22BD1%22);%0A%0A%09%09lst.add(%22ggg%22);%0A//%09%09lst.add(s1);%0A%0A%09%09return lst;%0A%09%7D%0A
+ = %22tables%22;%0A        model.setViewName(pageName);%0A        return model;%0A%0A    %7D
 %0A%7D%0A

Update SecretController.java