This commit is contained in:
Liang Ding 2023-03-05 11:49:57 +08:00
parent ba400854b0
commit 69c18db9ed
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 81 additions and 9 deletions

View file

@ -54,3 +54,38 @@ func chatGPTContinueWriteBlocks(c *gin.Context) {
}
ret.Data = model.ChatGPTContinueWriteBlocks(ids)
}
func chatGPTTranslate(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))
}
lang := arg["lang"].(string)
ret.Data = model.ChatGPTTranslate(ids, lang)
}
func chatGPTSummary(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.ChatGPTSummary(ids)
}