Documentation ¶
Index ¶
- func CreateDailySentenceHandler(c *gin.Context)
- func DeleteDailySentenceHandler(c *gin.Context)
- func DownloadHandler(c *gin.Context)
- func GetAboutHandler(c *gin.Context)
- func GetDailySentenceHandler(c *gin.Context)
- func GetIndexHandler(c *gin.Context)
- func GetInfoHandler(c *gin.Context)
- func GetTokenHandler(c *gin.Context)
- func ListsDailySentenceHandler(c *gin.Context)
- func ReTitleDailySentenceHandler(c *gin.Context)
- func ScoreDailySentenceHandler(c *gin.Context)
- func StreamCRDHandler(c *gin.Context)
- func StreamSSEHandler(c *gin.Context)
- func UpdateDailySentenceHandler(c *gin.Context)
- func UpdateDailySentenceTransactionHandler(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDailySentenceHandler ¶
创建记录 curl -i -X POST http://0.0.0.0:8080/v1/daily_sentence -d '{"Author": "Tom", "Title": "this is a test", "Classification": "news"}'
func DeleteDailySentenceHandler ¶
删除记录 curl -i -X DELETE http://0.0.0.0:8080/v1/daily_sentence/2
func DownloadHandler ¶
关于页面 curl -i -X GET http://0.0.0.0:8080/download
func GetAboutHandler ¶
关于页面 curl -i -X GET http://0.0.0.0:8080/about
func GetDailySentenceHandler ¶
获取详情 curl -i -X GET http://0.0.0.0:8080/v1/daily_sentence/1
func GetInfoHandler ¶
首页页面 curl -i -X GET http://0.0.0.0:8080/v1/info
func GetTokenHandler ¶
获取列表 curl -u username:password -i -X GET http://0.0.0.0:8080/v1/token curl -u foo:bar -i -X GET http://0.0.0.0:8080/v1/token
func ListsDailySentenceHandler ¶
获取列表 curl -i -X GET http://0.0.0.0:8080/v1/daily_sentences
func ReTitleDailySentenceHandler ¶
修改记录标题 curl -i -X PUT http://0.0.0.0:8080/v1/daily_sentence/1/title -d '{"title": "测试更换标题"}'
func ScoreDailySentenceHandler ¶
打分 curl -i -X PATCH http://0.0.0.0:8080/v1/daily_sentence/1/score -d '{"score": 0}'
func StreamCRDHandler ¶
流式请求 curl -i -X GET http://0.0.0.0:8080/v1/stream/crd
func StreamSSEHandler ¶
流式请求(利用 H5 的新特性 SSE) curl -i -X GET http://0.0.0.0:8080/v1/stream/sse https://www.html5rocks.com/en/tutorials/eventsource/basics/
func UpdateDailySentenceHandler ¶
更新记录 curl -i -X PUT http://0.0.0.0:8080/v1/daily_sentence/1 -d '{"Author": "Tom"}'
func UpdateDailySentenceTransactionHandler ¶
更新记录 curl -X POST \ http://0.0.0.0:8080/v1/daily_sentence/transaction \ -H 'Content-Type: application/json' \
-d '{ "id": "1", "Title": "this is a test", "Classification": "news" }'
Types ¶
This section is empty.