EthController.java
2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
package org.emercit.app;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.*;
import javax.servlet.ServletContext;
import java.io.*;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
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 org.springframework.web.bind.annotation.RequestBody;
import java.util.Vector;
import org.emercit.ethmanager.model.EthBean;
import org.emercit.dnsmanager.model.DnsBean;
import org.emercit.service.EthService;
import org.emercit.service.DnsService;
@Controller
@RequestMapping("api")
public class EthController {
@RequestMapping(value = "eth/all", method = RequestMethod.GET)
public @ResponseBody Vector<EthBean> getAllEth() {
try {
return EthService.INSTANCE.getAllEthbean();
}
catch(Exception e)
{
return null;
}
}
/*
@RequestMapping(value = "net/proxy", method = RequestMethod.GET)
public @ResponseBody Vector<ProxyBean> getAllProxy() {
try {
return NetService.INSTANCE.getProxy();
}
catch(Exception e)
{
return null;
}
}
*/
/*
export http_proxy='http://user:password@prox-server:3128'
export https_proxy='http://user:password@prox-server:3128'
export ftp_proxy='http://user:password@prox-server:3128'
*/
/*
*
*/
@RequestMapping(value = "eth/byeth/{eth}", method = RequestMethod.GET)
public @ResponseBody EthBean getEth(@PathVariable String eth) {
return EthService.INSTANCE.getByName(eth);
}
@RequestMapping(value="eth/update" , method = RequestMethod.POST)
public @ResponseBody boolean update(@RequestBody EthBean m) {
return EthService.INSTANCE.Upd(m);
}
}