This commit is contained in:
@@ -49,9 +49,9 @@ public class StoryController {
|
||||
}
|
||||
|
||||
@GetMapping("/{storyId}")
|
||||
public ResponseEntity<Story> getStoryById(@PathVariable String storyId) {
|
||||
public ResponseEntity<StoryDetailVo> getStoryById(@PathVariable String storyId) {
|
||||
log.info("获取故事详情, ID: {}", storyId);
|
||||
Story story = storyService.getStoryByInstanceId(storyId);
|
||||
StoryDetailVo story = storyService.getStoryByInstanceId(storyId);
|
||||
return ResponseEntity.success(story);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface StoryService {
|
||||
void createStory(StoryVo storyVo);
|
||||
void updateStory(StoryVo storyVo, String storyId);
|
||||
void deleteStory(String storyId);
|
||||
Story getStoryByInstanceId(String storyId);
|
||||
StoryDetailVo getStoryByInstanceId(String storyId);
|
||||
List<StoryDetailVo> getStoriesByOwnerId(String ownerId);
|
||||
List<StoryDetailVo> getStories(StoryVo storyVo);
|
||||
|
||||
|
||||
@@ -136,9 +136,9 @@ public class StoryServiceImpl implements StoryService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Story getStoryByInstanceId(String storyId) {
|
||||
public StoryDetailVo getStoryByInstanceId(String storyId) {
|
||||
val userId = getCurrentUserId();
|
||||
Story story = storyMapper.selectByInstanceId(storyId, userId);
|
||||
StoryDetailVo story = storyMapper.selectByInstanceId(storyId, userId);
|
||||
if (story == null) {
|
||||
throw new CustomException(ResponseEnum.NOT_FOUND);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
WHERE s.instance_id = #{instanceId}
|
||||
</select>
|
||||
|
||||
<select id="selectByOwnerId" resultType="com.timeline.story.entity.Story">
|
||||
<select id="selectByOwnerId" resultType="com.timeline.story.vo.StoryDetailVo">
|
||||
SELECT
|
||||
s.*,
|
||||
u1.username AS owner_name,
|
||||
|
||||
Reference in New Issue
Block a user