refactor: 移除 StoryItem 的分享相关功能和字段
All checks were successful
test/timeline-server/pipeline/head This commit looks good

从 StoryItem 实体类中删除了 shareId、type、status 和 cover 字段,并注释掉了控制器、服务层及 Mapper 中所有根据 shareId 查询的方法。同时同步更新了 SQL 映射文件,移除了对应的数据库操作字段。
This commit is contained in:
2026-02-12 10:14:44 +08:00
parent d405d84dfe
commit 0349bf3c70
8 changed files with 4064 additions and 36 deletions

View File

File diff suppressed because it is too large Load Diff

View File

@@ -80,12 +80,15 @@ public class StoryItemController {
return ResponseEntity.success(count);
}
@GetMapping("/public/story/item/{shareId}")
public ResponseEntity<StoryItemShareVo> getStoryItemByShareId(@PathVariable String shareId) {
log.info("获取分享的 StoryItemshareId: {}", shareId);
StoryItemShareVo item = storyItemService.getItemByShareId(shareId);
return ResponseEntity.success(item);
}
/*
* @GetMapping("/public/story/item/{shareId}")
* public ResponseEntity<StoryItemShareVo> getStoryItemByShareId(@PathVariable
* String shareId) {
* log.info("获取分享的 StoryItemshareId: {}", shareId);
* StoryItemShareVo item = storyItemService.getItemByShareId(shareId);
* return ResponseEntity.success(item);
* }
*/
@GetMapping("/search")
public ResponseEntity<Map> searchItems(@RequestParam String keyword,

View File

@@ -18,10 +18,13 @@ public class StoryPublicController {
@Autowired
private StoryItemService storyItemService;
@GetMapping("/{shareId}")
public ResponseEntity<StoryItem> getStoryItemByShareId(@PathVariable String shareId) {
log.info("根据 shareId 获取 StoryItem: {}", shareId);
StoryItem storyItem = storyItemService.getItemByShareId(shareId);
return ResponseEntity.success(storyItem);
}
/*
* @GetMapping("/{shareId}")
* public ResponseEntity<StoryItem> getStoryItemByShareId(@PathVariable String
* shareId) {
* log.info("根据 shareId 获取 StoryItem: {}", shareId);
* StoryItem storyItem = storyItemService.getItemByShareId(shareId);
* return ResponseEntity.success(storyItem);
* }
*/
}

View File

@@ -28,9 +28,9 @@ public interface StoryItemMapper {
int countByStoryId(String storyInstanceId);
StoryItem selectByShareId(String shareId);
// StoryItem selectByShareId(String shareId);
StoryItemShareVo selectByShareIdWithAuthor(String shareId);
// StoryItemShareVo selectByShareIdWithAuthor(String shareId);
List<StoryItemVo> searchItems(@Param("keyword") String keyword);
}

View File

@@ -14,12 +14,8 @@ public class StoryItem {
private String description;
private String location;
private LocalDateTime storyItemTime;
private String type;
private String status;
private String cover;
private String createId;
private String updateId;
private String shareId;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Integer isDelete;

View File

@@ -24,7 +24,7 @@ public interface StoryItemService {
Integer getStoryItemCount(String storyInstanceId);
StoryItemShareVo getItemByShareId(String shareId);
// StoryItemShareVo getItemByShareId(String shareId);
Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize);
}

View File

@@ -94,10 +94,12 @@ public class StoryItemServiceImpl implements StoryItemService {
return storyItemMapper.countByStoryId(storyInstanceId);
}
@Override
public StoryItemShareVo getItemByShareId(String shareId) {
return storyItemMapper.selectByShareIdWithAuthor(shareId);
}
/*
* @Override
* public StoryItemShareVo getItemByShareId(String shareId) {
* return storyItemMapper.selectByShareIdWithAuthor(shareId);
* }
*/
@Override
public Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize) {

View File

@@ -5,8 +5,8 @@
<mapper namespace="com.timeline.story.dao.StoryItemMapper">
<insert id="insert">
INSERT INTO story_item (instance_id, master_item_id, description, location, title, create_id, story_instance_id, is_delete, story_item_time, update_id, share_id, cover)
VALUES (#{instanceId}, #{masterItemId}, #{description}, #{location}, #{title},#{createId}, #{storyInstanceId}, #{isDelete}, #{storyItemTime}, #{updateId}, #{shareId}, #{cover})
INSERT INTO story_item (instance_id, master_item_id, description, location, title, create_id, story_instance_id, is_delete, story_item_time, update_id)
VALUES (#{instanceId}, #{masterItemId}, #{description}, #{location}, #{title},#{createId}, #{storyInstanceId}, #{isDelete}, #{storyItemTime}, #{updateId})
</insert>
<update id="update">
@@ -14,11 +14,9 @@
SET description = #{description},
location = #{location},
title = #{title},
cover = #{cover},
create_id = #{createId},
update_time = NOW(),
update_id = #{updateId},
share_id = #{shareId}
update_id = #{updateId}
WHERE instance_id = #{instanceId}
</update>
@@ -48,10 +46,6 @@
si.title,
si.story_instance_id,
si.master_item_id,
si.share_id,
si.cover,
si.type,
si.status,
si.is_delete,
si.story_item_time as story_item_time,
si.create_id AS create_id,
@@ -78,6 +72,7 @@
SELECT COUNT(*) FROM story_item WHERE story_instance_id = #{storyInstanceId} AND is_delete = 0
</select>
<!--
<select id="selectByShareId" resultType="com.timeline.story.entity.StoryItem">
SELECT * FROM story_item WHERE share_id = #{shareId} AND is_delete = 0
</select>
@@ -94,6 +89,7 @@
WHERE
si.share_id = #{shareId} AND si.is_delete = 0
</select>
-->
<select id="searchItems" resultType="com.timeline.story.vo.StoryItemVo">
SELECT
@@ -101,8 +97,7 @@
si.story_instance_id,
si.title,
si.description,
si.story_item_time,
si.cover
si.story_item_time
FROM
story_item si
WHERE