You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.4 KiB
54 lines
1.4 KiB
package com.platform.test;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import com.platform.entities.EncodedInfoEntity;
|
|
import com.platform.service.EncodeInfoService;
|
|
|
|
@Controller
|
|
public class TestController {
|
|
// private static Logger logger = Logger.getLogger(TestController.class);
|
|
@Resource(name = "encodeInfoService")
|
|
private EncodeInfoService eis;
|
|
|
|
public void setEis(EncodeInfoService eis) {
|
|
this.eis = eis;
|
|
}
|
|
|
|
@RequestMapping("/hello")
|
|
@ResponseBody
|
|
public List<EncodedInfoEntity> hello(String name, HttpServletResponse res) {
|
|
System.out.println(name);
|
|
return eis.getAllEncodeInfo("system_info");
|
|
}
|
|
|
|
@RequestMapping("/json")
|
|
@ResponseBody
|
|
public List<User> getJson(HttpServletRequest res, HttpServletResponse req) {
|
|
List<User> list = new ArrayList<User>();
|
|
list.add(new User("lisi", 1, "ÄÐ"));
|
|
list.add(new User("zhansan", 2, "ÄÐ"));
|
|
return list;
|
|
}
|
|
|
|
@RequestMapping("log")
|
|
public void testLog(HttpServletResponse res) {
|
|
System.out.println(eis.getEncodeNameByCode("1", "system_info"));
|
|
}
|
|
|
|
@RequestMapping("/data111.json")
|
|
public void test(String name, HttpServletResponse res){
|
|
|
|
|
|
}
|
|
}
|