TestApiController.java
2.59 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
package com.yoho.search.consumer.test;
import com.yoho.search.consumer.job.ProductHeatValueJob;
import com.yoho.search.consumer.job.ProductModelValueJob;
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.ResponseBody;
import java.util.HashMap;
import java.util.Map;
@Controller
public class TestApiController {
@Autowired
private ProductHeatValueJob productHeatValueJob;
@Autowired
private ProductModelValueJob productModelValueJob;
@RequestMapping(value = "/test")
@ResponseBody
public Map<String, Object> test() {
Map<String, Object> testResult = new HashMap<String, Object>();
testResult.put("data", null);
testResult.put("code", 200);
testResult.put("message", "success");
return testResult;
}
// @RequestMapping(value = "/doUpdateProductIndexHeatValue")
// @ResponseBody
// public Map<String, Object> doUpdateProductIndexHeatValue() {
// Map<String, Object> returnMap = new HashMap<String, Object>();
// try {
// returnMap.put("code", 200);
// returnMap.put("message", "success");
// productHeatValueJob.doUpdateProductIndexHeatValue();
// } catch (Exception e) {
// e.printStackTrace();
// returnMap.put("code", 400);
// returnMap.put("message", e.getMessage());
// }
// return returnMap;
// }
@RequestMapping(value = "/doCleanHeatValue")
@ResponseBody
public Map<String, Object> doCleanHeatValue() {
Map<String, Object> returnMap = new HashMap<String, Object>();
try {
returnMap.put("code", 200);
returnMap.put("message", "success");
productHeatValueJob.clean();
} catch (Exception e) {
e.printStackTrace();
returnMap.put("code", 400);
returnMap.put("message", e.getMessage());
}
return returnMap;
}
@RequestMapping(value = "/doCleanProductModelValue")
@ResponseBody
public Map<String, Object> doCleanProductModelValue() {
Map<String, Object> returnMap = new HashMap<String, Object>();
try {
returnMap.put("code", 200);
returnMap.put("message", "success");
productModelValueJob.clean();
} catch (Exception e) {
e.printStackTrace();
returnMap.put("code", 400);
returnMap.put("message", e.getMessage());
}
return returnMap;
}
}