controllers

package
v0.0.0-...-a3e3982 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDailySentenceHandler

func CreateDailySentenceHandler(c *gin.Context)

创建记录 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

func DeleteDailySentenceHandler(c *gin.Context)

删除记录 curl -i -X DELETE http://0.0.0.0:8080/v1/daily_sentence/2

func DownloadHandler

func DownloadHandler(c *gin.Context)

关于页面 curl -i -X GET http://0.0.0.0:8080/download

func GetAboutHandler

func GetAboutHandler(c *gin.Context)

关于页面 curl -i -X GET http://0.0.0.0:8080/about

func GetDailySentenceHandler

func GetDailySentenceHandler(c *gin.Context)

获取详情 curl -i -X GET http://0.0.0.0:8080/v1/daily_sentence/1

func GetIndexHandler

func GetIndexHandler(c *gin.Context)

首页页面 curl -i -X GET http://0.0.0.0:8080

func GetInfoHandler

func GetInfoHandler(c *gin.Context)

首页页面 curl -i -X GET http://0.0.0.0:8080/v1/info

func GetTokenHandler

func GetTokenHandler(c *gin.Context)

获取列表 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

func ListsDailySentenceHandler(c *gin.Context)

获取列表 curl -i -X GET http://0.0.0.0:8080/v1/daily_sentences

func ReTitleDailySentenceHandler

func ReTitleDailySentenceHandler(c *gin.Context)

修改记录标题 curl -i -X PUT http://0.0.0.0:8080/v1/daily_sentence/1/title -d '{"title": "测试更换标题"}'

func ScoreDailySentenceHandler

func ScoreDailySentenceHandler(c *gin.Context)

打分 curl -i -X PATCH http://0.0.0.0:8080/v1/daily_sentence/1/score -d '{"score": 0}'

func StreamCRDHandler

func StreamCRDHandler(c *gin.Context)

流式请求 curl -i -X GET http://0.0.0.0:8080/v1/stream/crd

func StreamSSEHandler

func StreamSSEHandler(c *gin.Context)

流式请求(利用 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

func UpdateDailySentenceHandler(c *gin.Context)

更新记录 curl -i -X PUT http://0.0.0.0:8080/v1/daily_sentence/1 -d '{"Author": "Tom"}'

func UpdateDailySentenceTransactionHandler

func UpdateDailySentenceTransactionHandler(c *gin.Context)

更新记录 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL