Compare commits
3 Commits
a4faa11036
...
feature-Po
| Author | SHA1 | Date | |
|---|---|---|---|
| d20ce917a2 | |||
| d8b16e0287 | |||
| b1ea85b5e4 |
@@ -21,7 +21,7 @@ public class PostController {
|
||||
private PostService postService;
|
||||
|
||||
/**
|
||||
* 上传媒体文件接口 like
|
||||
* 上传媒体文件接口
|
||||
* @param files 媒体文件数组
|
||||
* @return 上传后的文件URL列表
|
||||
*/
|
||||
@@ -33,14 +33,13 @@ public class PostController {
|
||||
|
||||
/**
|
||||
* 发布动态接口 - JSON格式请求
|
||||
* @param postDTO 动态信息
|
||||
* @param userId 用户ID
|
||||
* @param postRequestDTO 动态信息
|
||||
* @return 发布的动态对象
|
||||
*/
|
||||
@PostMapping(consumes = "application/json")
|
||||
public Result<Post> createPostJson(@RequestBody PostRequestDTO postDTO, @RequestParam Long userId) {
|
||||
public Result<Post> createPostJson(@RequestBody PostRequestDTO postRequestDTO) {
|
||||
// 调用 Service 层处理发布动态业务逻辑
|
||||
Post result = postService.createPost(userId, postDTO);
|
||||
Post result = postService.createPost(postRequestDTO);
|
||||
return Result.success(ResultCode.SUCCESS_REVIEW, "动态发布成功,等待审核。", result);
|
||||
}
|
||||
|
||||
@@ -51,7 +50,7 @@ public class PostController {
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/{postId}")
|
||||
public Result<String> deleteById(@PathVariable Long postId){
|
||||
public Result<String> deleteById(@PathVariable Integer postId){
|
||||
postService.deletePostById(postId);
|
||||
return Result.success(ResultCode.SUCCESS_DELETE, "动态删除成功", null);
|
||||
}
|
||||
@@ -66,7 +65,7 @@ public class PostController {
|
||||
PostEditVO postEditVO = postService.getPostForEdit(postId);
|
||||
return Result.success(ResultCode.SUCCESS,"查询成功", postEditVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新动态接口
|
||||
* @param postId 动态ID
|
||||
|
||||
@@ -17,11 +17,11 @@ public interface PostService {
|
||||
|
||||
/**
|
||||
* 创建动态
|
||||
* @param userId 用户ID
|
||||
*
|
||||
* @param postRequestDTO 动态数据传输对象
|
||||
* @return 创建的动态对象
|
||||
*/
|
||||
Post createPost(Long userId, PostRequestDTO postRequestDTO);
|
||||
Post createPost(PostRequestDTO postRequestDTO);
|
||||
|
||||
/**
|
||||
* 删除动态
|
||||
|
||||
@@ -79,12 +79,11 @@ public class PostServiceImpl implements PostService {
|
||||
/**
|
||||
* 创建动态
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param postRequestDTO 动态数据传输对象
|
||||
* @return 创建的动态对象
|
||||
*/
|
||||
@Override
|
||||
public Post createPost(Long userId, PostRequestDTO postRequestDTO) {
|
||||
public Post createPost(PostRequestDTO postRequestDTO) {
|
||||
|
||||
// 创建动态对象
|
||||
Post post = new Post();
|
||||
|
||||
Reference in New Issue
Block a user