wuxw
2019-02-02 9454b49eeabd56894550f1419f14e96f9d10c2ef
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
105
package com.java110.code.rest;
 
import com.java110.code.smo.ICommonServiceSmo;
import com.java110.core.base.controller.BaseController;
import com.java110.entity.mapping.CodeMapping;
import com.java110.feign.base.ICommonService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.List;
 
/**
 * Created by wuxw on 2017/7/25.
 */
//@RestController
public class CommonServiceRest extends BaseController implements ICommonService{
 
    protected final static Logger logger = LoggerFactory.getLogger(CommonServiceRest.class);
 
    @Autowired
    ICommonServiceSmo commonServiceSmoImpl;
 
    @Override
    @RequestMapping("/commonService/getCodeMappingAll")
    public List<CodeMapping> getCodeMappingAll()  throws Exception{
        return commonServiceSmoImpl.getCodeMappingAll();
    }
 
    @Override
    @RequestMapping("/commonService/getCodeMappingByDomain")
    public List<CodeMapping> getCodeMappingByDomain(@RequestParam("domain") String domain)  throws Exception{
        CodeMapping codeMapping = new CodeMapping();
        codeMapping.setDomain(domain);
        return commonServiceSmoImpl.getCodeMappingByDomain(codeMapping);
    }
 
    @Override
    @RequestMapping("/commonService/getCodeMappingByHCode")
    public List<CodeMapping> getCodeMappingByHCode(@RequestParam("hCode") String hCode)  throws Exception{
        CodeMapping codeMapping = new CodeMapping();
        codeMapping.setH_code(hCode);
        return commonServiceSmoImpl.getCodeMappingByHCode(codeMapping);
    }
 
    @Override
    @RequestMapping("/commonService/getCodeMappingByPCode")
    public List<CodeMapping> getCodeMappingByPCode(@RequestParam("pCode") String pCode)  throws Exception{
        CodeMapping codeMapping = new CodeMapping();
        codeMapping.setP_code(pCode);
        return commonServiceSmoImpl.getCodeMappingByPCode(codeMapping);
    }
 
    @Override
    @RequestMapping("/commonService/getCodeMappingByDomainAndHCode")
    public List<CodeMapping> getCodeMappingByDomainAndHCode(@RequestParam("hCode") String hCode,@RequestParam("pCode") String pCode)  throws Exception{
        CodeMapping codeMapping = new CodeMapping();
        codeMapping.setH_code(hCode);
        codeMapping.setP_code(pCode);
        return commonServiceSmoImpl.getCodeMappingByDomainAndHCode(codeMapping);
    }
 
    @Override
    @RequestMapping("/commonService/getCodeMappingByDomainAndPCode")
    public List<CodeMapping> getCodeMappingByDomainAndPCode(@RequestParam("domain") String domain, @RequestParam("pCode") String pCode)  throws Exception{
        CodeMapping codeMapping = new CodeMapping();
        codeMapping.setDomain(domain);
        codeMapping.setP_code(pCode);
        return commonServiceSmoImpl.getCodeMappingByDomainAndPCode(codeMapping);
    }
 
 
    /**
     * 常量域和h_code 查询
     * @param hCode
     * @return
     * @throws Exception
     */
    @RequestMapping("/commonService/getDynamicConstantValueByHCode")
    public List<CodeMapping> getDynamicConstantValueByHCode(@RequestParam("hCode") String hCode) throws Exception{
        return getCodeMappingByDomainAndHCode("DynamicConstant",hCode);
    }
 
    /**
     * 常量域和h_code 查询
     * @param pCode
     * @return
     * @throws Exception
     */
    @RequestMapping("/commonService/getDynamicConstantValueByPCode")
    public List<CodeMapping> getDynamicConstantValueByPCode(@RequestParam("pCode") String pCode) throws Exception{
        return getCodeMappingByDomainAndPCode("DynamicConstant",pCode);
    }
 
    public ICommonServiceSmo getCommonServiceSmoImpl() {
        return commonServiceSmoImpl;
    }
 
    public void setCommonServiceSmoImpl(ICommonServiceSmo commonServiceSmoImpl) {
        this.commonServiceSmoImpl = commonServiceSmoImpl;
    }
}