Oss上传文件(有bug)
This commit is contained in:
@@ -24,6 +24,11 @@ public class PostServiceImpl implements PostService {
|
||||
|
||||
@Override
|
||||
public Post createPost(Post post) {
|
||||
// 检查并确保userId不为空,如果为空则设置默认值
|
||||
if (post.getUserId() == null) {
|
||||
post.setUserId(1); // 设置默认用户ID为1
|
||||
}
|
||||
|
||||
// 处理图片和视频上传到 OSS
|
||||
List<String> mediaOssKeys = new ArrayList<>();
|
||||
|
||||
@@ -62,4 +67,4 @@ public class PostServiceImpl implements PostService {
|
||||
postMapper.insert(post);
|
||||
return post;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user