提交 | 用户 | 时间
|
71e81e
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.modular.demos.controller; |
|
17 |
|
|
18 |
import cn.stylefeng.guns.modular.demos.service.TranTestService; |
|
19 |
import cn.stylefeng.roses.core.base.controller.BaseController; |
|
20 |
import cn.stylefeng.roses.kernel.model.response.SuccessResponseData; |
|
21 |
import org.springframework.beans.factory.annotation.Autowired; |
|
22 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
23 |
import org.springframework.web.bind.annotation.RestController; |
|
24 |
|
|
25 |
/** |
|
26 |
* 测试单数据源回滚 |
|
27 |
* |
|
28 |
* @author stylefeng |
|
29 |
* @Date 2018/7/20 23:39 |
|
30 |
*/ |
|
31 |
@RestController |
|
32 |
@RequestMapping("/tran/single") |
|
33 |
public class TestSingleTranController extends BaseController { |
|
34 |
|
|
35 |
@Autowired |
|
36 |
private TranTestService testMultiDbService; |
|
37 |
|
|
38 |
@RequestMapping("/success") |
|
39 |
public Object testSuccess() { |
|
40 |
testMultiDbService.testSingleSuccess(); |
|
41 |
return SuccessResponseData.success(); |
|
42 |
} |
|
43 |
|
|
44 |
@RequestMapping("/fail") |
|
45 |
public Object testFail() { |
|
46 |
testMultiDbService.testSingleFail(); |
|
47 |
return SuccessResponseData.success(); |
|
48 |
} |
|
49 |
|
|
50 |
} |
|
51 |
|