TblRelationController.java
1.84 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
package com.yoho.search.consumer.restapi;
import com.yoho.search.consumer.service.logic.tbl.TblBrandRelationLogicService;
import com.yoho.search.consumer.service.logic.tbl.TblSortRelationLogicService;
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;
/**
* Created by wangnan on 2017/3/7.
*/
@Controller
public class TblRelationController {
@Autowired
private TblSortRelationLogicService tblSortRelationLogicService;
@Autowired
private TblBrandRelationLogicService tblBrandRelationLogicService;
@RequestMapping(value = "/tblSortRelation")
@ResponseBody
public Map<String, Object> loadSortRelationData() {
Map<String, Object> result = new HashMap<String, Object>();
try {
tblSortRelationLogicService.loadSortRelationData();
result.put("code", 200);
result.put("message", "success");
} catch (Exception e) {
e.printStackTrace();
result.put("code", 400);
result.put("message", e.getMessage());
}
return result;
}
@RequestMapping(value = "/tblBrandRelation")
@ResponseBody
public Map<String, Object> loadBrandRelationData() {
Map<String, Object> result = new HashMap<String, Object>();
try {
tblBrandRelationLogicService.loadBrandRelationData();
result.put("data", "");
result.put("code", 200);
result.put("message", "success");
} catch (Exception e) {
e.printStackTrace();
result.put("code", 400);
result.put("message", e.getMessage());
}
return result;
}
}