|
|
@@ -0,0 +1,39 @@
|
|
|
+package com.seeckg.knowledgegraph_backend.controller;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import com.seeckg.knowledgegraph_backend.pojo.KnowledgeForumVO;
|
|
|
+import com.seeckg.knowledgegraph_backend.pojo.Response;
|
|
|
+import com.seeckg.knowledgegraph_backend.service.ForumService;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author chenjiawei09 <chenjiawei09@kuaishou.com>
|
|
|
+ * Created on 2023-05-22
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/forum")
|
|
|
+public class KnowledgeForumController {
|
|
|
+ @Resource
|
|
|
+ ForumService forumService;
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public Response addKnowledgeForum(@RequestBody KnowledgeForumVO knowledgeForumVO) {
|
|
|
+ return forumService.addKnowledgeForum(knowledgeForumVO);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public Response deleteKnowledgeForum(@RequestParam Long knowledgeForumId, @RequestParam Long userId) {
|
|
|
+ return forumService.deleteKnowledgeForum(knowledgeForumId, userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ public Response getKnowledgeForum(@RequestParam Long knowledgeForumId, @RequestParam Long userId) {
|
|
|
+ return forumService.getKnowledgeForum(knowledgeForumId, userId);
|
|
|
+ }
|
|
|
+}
|