zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
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
package com.changhong.epc.demo2.rest;
 
 
import com.changhong.epc.constter.demo2.Demo2UrlConst;
import com.changhong.epc.constter.system.DataSourceKey;
import com.changhong.epc.demo2.service.DemoService;
import com.iemsoft.framework.cloud.core.thread.Keys;
import com.iemsoft.framework.cloud.core.thread.ThreadData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
@RestController
public class DemoRest implements Demo2UrlConst{
 
    @Resource
    private DemoService demoService;
 
    /**
     * 返回空值实例
     * @return
     */
    @PostMapping("/save")
    public Object restTest(){
        ThreadData.set(Keys.DATA_SOURCE, DataSourceKey.TENANT_DATA_1_SOURCE);
        return demoService.save();
    }
 
    /**
     * 返回空值实例
     * @return
     */
    @PostMapping("/save1")
    public Object restTest1(){
        ThreadData.set(Keys.DATA_SOURCE, DataSourceKey.TENANT_DATA_1_SOURCE);
        return demoService.save1();
    }
}