完成动态发布功能(审核未实现)
This commit is contained in:
@@ -5,25 +5,18 @@ import com.bao.dating.common.Result;
|
|||||||
import com.bao.dating.common.ResultCode;
|
import com.bao.dating.common.ResultCode;
|
||||||
import com.bao.dating.pojo.entity.Post;
|
import com.bao.dating.pojo.entity.Post;
|
||||||
import com.bao.dating.service.PostService;
|
import com.bao.dating.service.PostService;
|
||||||
import com.bao.dating.util.AliOssUtil;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/posts")
|
@RequestMapping("/posts")
|
||||||
public class PostController {
|
public class PostController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AliOssUtil ossUtil;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PostService postService;
|
private PostService postService;
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result<Post> createPost(@RequestBody Post post) {
|
public Result<Post> createPost(Post post) {
|
||||||
// 调用 Service 层处理发布动态业务逻辑
|
// 调用 Service 层处理发布动态业务逻辑
|
||||||
Post result = postService.createPost(post);
|
Post result = postService.createPost(post);
|
||||||
return Result.success(ResultCode.SUCCESS_REVIEW,"动态发布成功,等待审核。",result);
|
return Result.success(ResultCode.SUCCESS_REVIEW,"动态发布成功,等待审核。",result);
|
||||||
|
|||||||
Reference in New Issue
Block a user