merge upstream

Signed-off-by: wozulong <>
This commit is contained in:
wozulong
2024-03-27 18:01:43 +08:00
18 changed files with 172 additions and 43 deletions

View File

@@ -108,6 +108,7 @@ func buildTestRequest() *dto.GeneralOpenAIRequest {
testRequest := &dto.GeneralOpenAIRequest{
Model: "", // this will be set later
MaxTokens: 1,
Stream: false,
}
content, _ := json.Marshal("hi")
testMessage := dto.Message{

View File

@@ -558,6 +558,14 @@ func HardDeleteUser(c *gin.Context) {
}
func DeleteSelf(c *gin.Context) {
if !common.UserSelfDeletionEnabled {
c.JSON(http.StatusOK, gin.H{
"success": false,
"message": "当前设置不允许用户自我删除账号",
})
return
}
id := c.GetInt("id")
user, _ := model.GetUserById(id, false)