CommentAction no practical effect, just check if token is valid
(c *gin.Context)
| 17 | |
| 18 | // CommentAction no practical effect, just check if token is valid |
| 19 | func 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 |
| 42 | func CommentList(c *gin.Context) { |
nothing calls this directly
no outgoing calls
no test coverage detected