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(); } }