feat: Implement file upload and folder creation features by GO (#13903)

### What problem does this PR solve?

feat: Implement file upload and folder creation features

- Add file upload route in router.go
- Add file operation methods in dao/file.go
- Add util/file.go for file type detection and filename handling
- Implement file upload and folder creation endpoints in handler/file.go
- Implement file upload and folder creation logic in service/file.go
- Modify response message format in memory.go
- Add document count method in dao/document.go

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
chanx
2026-04-02 20:21:04 +08:00
committed by GitHub
parent 6c29128de1
commit bbb9b1df85
7 changed files with 596 additions and 5 deletions

View File

@@ -194,7 +194,7 @@ func (h *MemoryHandler) CreateMemory(c *gin.Context) {
// Return success response
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": true,
"message": "success",
"data": result,
})
}
@@ -293,7 +293,7 @@ func (h *MemoryHandler) UpdateMemory(c *gin.Context) {
// Return success response
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": true,
"message": "success",
"data": result,
})
}
@@ -347,7 +347,7 @@ func (h *MemoryHandler) DeleteMemory(c *gin.Context) {
// Return success response
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": true,
"message": "success",
"data": nil,
})
}
@@ -436,7 +436,7 @@ func (h *MemoryHandler) ListMemories(c *gin.Context) {
// Return success response
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": true,
"message": "success",
"data": result,
})
}
@@ -490,7 +490,7 @@ func (h *MemoryHandler) GetMemoryConfig(c *gin.Context) {
// Return success response
c.JSON(http.StatusOK, gin.H{
"code": common.CodeSuccess,
"message": true,
"message": "success",
"data": result,
})
}