|
|
@ -11,9 +11,9 @@ router = APIRouter( |
|
|
|
|
|
|
|
# 新增 |
|
|
|
@router.post("/add") |
|
|
|
@limiter.limit("10/minute") |
|
|
|
@limiter.limit("1/minute") |
|
|
|
async def comment_add(request: Request,comment:Comment): |
|
|
|
insert_query="""INSERT INTO comments (parent_id,blog_id,commentname,email,commenturl,commentcontent) VALUES(%s,%s,%s,%s)""" |
|
|
|
insert_query="""INSERT INTO comments (parent_id,blog_id,commentname,email,commenturl,commentcontent) VALUES(%s,%s,%s,%s,%s,%s)""" |
|
|
|
insert_value=(comment.parent_id,comment.blog_id,comment.commentname,comment.email,comment.commenturl,comment.commentcontent) |
|
|
|
execute_query(insert_query,insert_value) |
|
|
|
return response_success(data=comment,message="comment create success") |
|
|
|