MCPcopy Create free account
hub / github.com/RaymondCode/simple-demo / CommentAction

Function CommentAction

controller/comment.go:19–39  ·  view source on GitHub ↗

CommentAction no practical effect, just check if token is valid

(c *gin.Context)

Source from the content-addressed store, hash-verified

17
18// CommentAction no practical effect, just check if token is valid
19func CommentAction(c *gin.Context) {
20 token := c.Query("token")
21 actionType := c.Query("action_type")
22
23 if user, exist := usersLoginInfo[token]; exist {
24 if actionType == "1" {
25 text := c.Query("comment_text")
26 c.JSON(http.StatusOK, CommentActionResponse{Response: Response{StatusCode: 0},
27 Comment: Comment{
28 Id: 1,
29 User: user,
30 Content: text,
31 CreateDate: "05-01",
32 }})
33 return
34 }
35 c.JSON(http.StatusOK, Response{StatusCode: 0})
36 } else {
37 c.JSON(http.StatusOK, Response{StatusCode: 1, StatusMsg: "User doesn't exist"})
38 }
39}
40
41// CommentList all videos have same demo comment list
42func CommentList(c *gin.Context) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected