TestApiController.java
1.55 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
package com.yoho.search.consumer.test;
import com.yoho.search.consumer.service.utils.BrandRelationUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@RestController
public class TestApiController {
@Autowired
private BrandRelationUtils brandRelationUtils;
@RequestMapping(value = "/test")
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 = "/buildBrandRelation")
public Map<String, Object> buildBrandRelation() {
Map<String, Object> testResult = new HashMap<>();
if (brandRelationUtils.buildBrandRelation()) {
testResult.put("code", 200);
testResult.put("message", "success");
} else {
testResult.put("code", 500);
testResult.put("message", "fail");
}
return testResult;
}
@RequestMapping(value = "/showTblRelationResult")
public Map<String, Object> brandRelationUtils() {
Map<String, Object> testResult = new HashMap<>();
testResult.put("data", brandRelationUtils.showTblRelationResult());
testResult.put("code", 200);
testResult.put("message", "success");
return testResult;
}
}