Refactor error handling in services to use internationalized error messages
- Updated OSSStorage validation errors to use internationalized messages. - Changed error messages in provider.go for unsupported file storage types. - Refactored tag_service.go to replace hardcoded error messages with internationalized versions. - Updated ticket_service.go to use internationalized error messages for various validation checks. - Refactored ticket_tag_service.go to use internationalized error messages for tag validation. - Changed ticket_view_service.go to use internationalized error messages for view validation. - Updated tool_catalog_service.go to use internationalized error messages for tool code validation. - Refactored user_service.go to replace error messages with internationalized versions. - Updated ws_service.go to use internationalized error messages for WebSocket handling. - Refactored wxwork_kf_inbound_service.go to use internationalized error messages for message handling. - Updated wxwork_kf_outbound_service.go to use internationalized error messages for outbound message handling. - Refactored wxwork_login_service.go to use internationalized error messages for login handling. - Updated login.go in wxwork package to use internationalized error messages for login state and ticket validation.
This commit is contained in:
@@ -37,7 +37,7 @@ func KnowledgeDocumentAnyList(ctx *gin.Context) {
|
||||
}
|
||||
if indexStatus, ok := params.Get(ctx, "indexStatus"); ok {
|
||||
if !enums.IsValidKnowledgeDocumentIndexStatus(indexStatus) {
|
||||
httpx.WriteJSON(ctx, web.JsonErrorMsg("indexStatus参数不合法"))
|
||||
httpx.WriteJSON(ctx, httpx.JsonErrorMsg(ctx, "error.e0067"))
|
||||
return
|
||||
}
|
||||
cnd.Where("index_status = ?", indexStatus)
|
||||
@@ -66,7 +66,7 @@ func KnowledgeDocumentGetBy(ctx *gin.Context) {
|
||||
|
||||
item := services.KnowledgeDocumentService.Get(id)
|
||||
if item == nil {
|
||||
httpx.WriteJSON(ctx, web.JsonErrorMsg("文档不存在"))
|
||||
httpx.WriteJSON(ctx, httpx.JsonErrorMsg(ctx, "error.e0218"))
|
||||
return
|
||||
}
|
||||
resp := builders.BuildKnowledgeDocument(item)
|
||||
|
||||
Reference in New Issue
Block a user