refactor: 移除 StoryItem 的分享相关功能和字段
All checks were successful
test/timeline-server/pipeline/head This commit looks good
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:
4029
deploy/all-databases-no-data.sql
Normal file
4029
deploy/all-databases-no-data.sql
Normal file
File diff suppressed because it is too large
Load Diff
@@ -80,12 +80,15 @@ public class StoryItemController {
|
|||||||
return ResponseEntity.success(count);
|
return ResponseEntity.success(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/public/story/item/{shareId}")
|
/*
|
||||||
public ResponseEntity<StoryItemShareVo> getStoryItemByShareId(@PathVariable String shareId) {
|
* @GetMapping("/public/story/item/{shareId}")
|
||||||
log.info("获取分享的 StoryItem,shareId: {}", shareId);
|
* public ResponseEntity<StoryItemShareVo> getStoryItemByShareId(@PathVariable
|
||||||
StoryItemShareVo item = storyItemService.getItemByShareId(shareId);
|
* String shareId) {
|
||||||
return ResponseEntity.success(item);
|
* log.info("获取分享的 StoryItem,shareId: {}", shareId);
|
||||||
}
|
* StoryItemShareVo item = storyItemService.getItemByShareId(shareId);
|
||||||
|
* return ResponseEntity.success(item);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
public ResponseEntity<Map> searchItems(@RequestParam String keyword,
|
public ResponseEntity<Map> searchItems(@RequestParam String keyword,
|
||||||
|
|||||||
@@ -18,10 +18,13 @@ public class StoryPublicController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private StoryItemService storyItemService;
|
private StoryItemService storyItemService;
|
||||||
|
|
||||||
@GetMapping("/{shareId}")
|
/*
|
||||||
public ResponseEntity<StoryItem> getStoryItemByShareId(@PathVariable String shareId) {
|
* @GetMapping("/{shareId}")
|
||||||
log.info("根据 shareId 获取 StoryItem: {}", shareId);
|
* public ResponseEntity<StoryItem> getStoryItemByShareId(@PathVariable String
|
||||||
StoryItem storyItem = storyItemService.getItemByShareId(shareId);
|
* shareId) {
|
||||||
return ResponseEntity.success(storyItem);
|
* log.info("根据 shareId 获取 StoryItem: {}", shareId);
|
||||||
}
|
* StoryItem storyItem = storyItemService.getItemByShareId(shareId);
|
||||||
|
* return ResponseEntity.success(storyItem);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ public interface StoryItemMapper {
|
|||||||
|
|
||||||
int countByStoryId(String storyInstanceId);
|
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);
|
List<StoryItemVo> searchItems(@Param("keyword") String keyword);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,12 +14,8 @@ public class StoryItem {
|
|||||||
private String description;
|
private String description;
|
||||||
private String location;
|
private String location;
|
||||||
private LocalDateTime storyItemTime;
|
private LocalDateTime storyItemTime;
|
||||||
private String type;
|
|
||||||
private String status;
|
|
||||||
private String cover;
|
|
||||||
private String createId;
|
private String createId;
|
||||||
private String updateId;
|
private String updateId;
|
||||||
private String shareId;
|
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public interface StoryItemService {
|
|||||||
|
|
||||||
Integer getStoryItemCount(String storyInstanceId);
|
Integer getStoryItemCount(String storyInstanceId);
|
||||||
|
|
||||||
StoryItemShareVo getItemByShareId(String shareId);
|
// StoryItemShareVo getItemByShareId(String shareId);
|
||||||
|
|
||||||
Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize);
|
Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,10 +94,12 @@ public class StoryItemServiceImpl implements StoryItemService {
|
|||||||
return storyItemMapper.countByStoryId(storyInstanceId);
|
return storyItemMapper.countByStoryId(storyInstanceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/*
|
||||||
public StoryItemShareVo getItemByShareId(String shareId) {
|
* @Override
|
||||||
return storyItemMapper.selectByShareIdWithAuthor(shareId);
|
* public StoryItemShareVo getItemByShareId(String shareId) {
|
||||||
}
|
* return storyItemMapper.selectByShareIdWithAuthor(shareId);
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize) {
|
public Map<String, Object> searchItems(String keyword, Integer pageNum, Integer pageSize) {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
<mapper namespace="com.timeline.story.dao.StoryItemMapper">
|
<mapper namespace="com.timeline.story.dao.StoryItemMapper">
|
||||||
|
|
||||||
<insert id="insert">
|
<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)
|
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}, #{shareId}, #{cover})
|
VALUES (#{instanceId}, #{masterItemId}, #{description}, #{location}, #{title},#{createId}, #{storyInstanceId}, #{isDelete}, #{storyItemTime}, #{updateId})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="update">
|
<update id="update">
|
||||||
@@ -14,11 +14,9 @@
|
|||||||
SET description = #{description},
|
SET description = #{description},
|
||||||
location = #{location},
|
location = #{location},
|
||||||
title = #{title},
|
title = #{title},
|
||||||
cover = #{cover},
|
|
||||||
create_id = #{createId},
|
create_id = #{createId},
|
||||||
update_time = NOW(),
|
update_time = NOW(),
|
||||||
update_id = #{updateId},
|
update_id = #{updateId}
|
||||||
share_id = #{shareId}
|
|
||||||
WHERE instance_id = #{instanceId}
|
WHERE instance_id = #{instanceId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -48,10 +46,6 @@
|
|||||||
si.title,
|
si.title,
|
||||||
si.story_instance_id,
|
si.story_instance_id,
|
||||||
si.master_item_id,
|
si.master_item_id,
|
||||||
si.share_id,
|
|
||||||
si.cover,
|
|
||||||
si.type,
|
|
||||||
si.status,
|
|
||||||
si.is_delete,
|
si.is_delete,
|
||||||
si.story_item_time as story_item_time,
|
si.story_item_time as story_item_time,
|
||||||
si.create_id AS create_id,
|
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 COUNT(*) FROM story_item WHERE story_instance_id = #{storyInstanceId} AND is_delete = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--
|
||||||
<select id="selectByShareId" resultType="com.timeline.story.entity.StoryItem">
|
<select id="selectByShareId" resultType="com.timeline.story.entity.StoryItem">
|
||||||
SELECT * FROM story_item WHERE share_id = #{shareId} AND is_delete = 0
|
SELECT * FROM story_item WHERE share_id = #{shareId} AND is_delete = 0
|
||||||
</select>
|
</select>
|
||||||
@@ -94,6 +89,7 @@
|
|||||||
WHERE
|
WHERE
|
||||||
si.share_id = #{shareId} AND si.is_delete = 0
|
si.share_id = #{shareId} AND si.is_delete = 0
|
||||||
</select>
|
</select>
|
||||||
|
-->
|
||||||
|
|
||||||
<select id="searchItems" resultType="com.timeline.story.vo.StoryItemVo">
|
<select id="searchItems" resultType="com.timeline.story.vo.StoryItemVo">
|
||||||
SELECT
|
SELECT
|
||||||
@@ -101,8 +97,7 @@
|
|||||||
si.story_instance_id,
|
si.story_instance_id,
|
||||||
si.title,
|
si.title,
|
||||||
si.description,
|
si.description,
|
||||||
si.story_item_time,
|
si.story_item_time
|
||||||
si.cover
|
|
||||||
FROM
|
FROM
|
||||||
story_item si
|
story_item si
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
Reference in New Issue
Block a user