Showing
3 changed files
with
9 additions
and
6 deletions
@@ -3,6 +3,8 @@ package com.yohoufo.dal.resource.model; | @@ -3,6 +3,8 @@ package com.yohoufo.dal.resource.model; | ||
3 | import lombok.Data; | 3 | import lombok.Data; |
4 | import lombok.ToString; | 4 | import lombok.ToString; |
5 | 5 | ||
6 | +import java.util.List; | ||
7 | + | ||
6 | @Data | 8 | @Data |
7 | @ToString | 9 | @ToString |
8 | public class ActivtyTemplated { | 10 | public class ActivtyTemplated { |
@@ -19,4 +21,6 @@ public class ActivtyTemplated { | @@ -19,4 +21,6 @@ public class ActivtyTemplated { | ||
19 | private Integer updateTime; | 21 | private Integer updateTime; |
20 | 22 | ||
21 | private String updateUser; | 23 | private String updateUser; |
24 | + | ||
25 | + private List<ActivtyTemplatedFloor> floors; | ||
22 | } | 26 | } |
@@ -40,9 +40,8 @@ public class ActivtyTemplatedController { | @@ -40,9 +40,8 @@ public class ActivtyTemplatedController { | ||
40 | @IgnoreSession | 40 | @IgnoreSession |
41 | @ResponseBody | 41 | @ResponseBody |
42 | public ApiResponse getResource(@RequestParam(name = "templated_id") Integer templatedId) { | 42 | public ApiResponse getResource(@RequestParam(name = "templated_id") Integer templatedId) { |
43 | - | ||
44 | logger.info("Get activty by content templatedId[{}]", templatedId); | 43 | logger.info("Get activty by content templatedId[{}]", templatedId); |
45 | - List<ActivtyTemplatedFloor> data = activtyTemplatedService.get(templatedId); | 44 | + ActivtyTemplated data = activtyTemplatedService.get(templatedId); |
46 | logger.info("Get activty by content templatedId[{}] success.", templatedId); | 45 | logger.info("Get activty by content templatedId[{}] success.", templatedId); |
47 | return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("activty data").build(); | 46 | return new ApiResponse.ApiResponseBuilder().data(data).code(200).message("activty data").build(); |
48 | } | 47 | } |
@@ -21,14 +21,14 @@ public class ActivtyTemplatedService { | @@ -21,14 +21,14 @@ public class ActivtyTemplatedService { | ||
21 | @Autowired | 21 | @Autowired |
22 | private ActivtyTemplatedMapper activtyTemplatedMapper; | 22 | private ActivtyTemplatedMapper activtyTemplatedMapper; |
23 | 23 | ||
24 | - public List<ActivtyTemplatedFloor> get(Integer templatedId) { | 24 | + public ActivtyTemplated get(Integer templatedId) { |
25 | ActivtyTemplated activtyTemplated = activtyTemplatedMapper.selectByPrimaryKey(templatedId); | 25 | ActivtyTemplated activtyTemplated = activtyTemplatedMapper.selectByPrimaryKey(templatedId); |
26 | 26 | ||
27 | if (null == activtyTemplated) { | 27 | if (null == activtyTemplated) { |
28 | - return Lists.newArrayList(); | 28 | + return null; |
29 | } | 29 | } |
30 | 30 | ||
31 | - List<ActivtyTemplatedFloor> activtyTemplatedFloor = activtyTemplatedFloorMapper.selectByTemplatedId(templatedId); | ||
32 | - return activtyTemplatedFloor; | 31 | + activtyTemplated.setFloors(activtyTemplatedFloorMapper.selectByTemplatedId(templatedId)); |
32 | + return activtyTemplated; | ||
33 | } | 33 | } |
34 | } | 34 | } |
-
Please register or login to post a comment