mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-05 15:11:48 +01:00
This commit is contained in:
parent
863df0a2e1
commit
6edcdf7d50
4 changed files with 68 additions and 0 deletions
|
|
@ -89,3 +89,37 @@ func chatGPTSummary(c *gin.Context) {
|
|||
}
|
||||
ret.Data = model.ChatGPTSummary(ids)
|
||||
}
|
||||
|
||||
func chatGPTBrainStorm(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
idsArg := arg["ids"].([]interface{})
|
||||
var ids []string
|
||||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
ret.Data = model.ChatGPTBrainStorm(ids)
|
||||
}
|
||||
|
||||
func chatGPTFixGrammarSpell(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
idsArg := arg["ids"].([]interface{})
|
||||
var ids []string
|
||||
for _, id := range idsArg {
|
||||
ids = append(ids, id.(string))
|
||||
}
|
||||
ret.Data = model.ChatGPTFixGrammarSpell(ids)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -332,4 +332,6 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/ai/chatGPTContinueWriteBlocks", model.CheckAuth, chatGPTContinueWriteBlocks)
|
||||
ginServer.Handle("POST", "/api/ai/chatGPTTranslate", model.CheckAuth, chatGPTTranslate)
|
||||
ginServer.Handle("POST", "/api/ai/chatGPTSummary", model.CheckAuth, chatGPTSummary)
|
||||
ginServer.Handle("POST", "/api/ai/chatGPTBrainStorm", model.CheckAuth, chatGPTBrainStorm)
|
||||
ginServer.Handle("POST", "/api/ai/chatGPTFixGrammarSpell", model.CheckAuth, chatGPTFixGrammarSpell)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue