Go: refactor to avoid conflicts (#17191)

### Summary

1. merge registery test into ingestion
2. move license code to EE version

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-07-21 18:47:02 +08:00
committed by GitHub
parent edeb47cd54
commit a5488d035a
5 changed files with 38 additions and 37 deletions

View File

@@ -712,38 +712,6 @@ func (h *Handler) GetVersion(c *gin.Context) {
common.SuccessWithData(c, gin.H{"version": version, "version_type": versionType}, "")
}
// GetFingerprint handle get system fingerprint
func (h *Handler) GetFingerprint(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
type SetLicenseHTTPRequest struct {
License string `json:"license" binding:"required"`
}
// SetLicense to set system license
func (h *Handler) SetLicense(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
type SetLicenseConfigHTTPRequest struct {
TimeRecordSaveInterval int64 `json:"value1" binding:"required"`
TimeRecordTaskDuration int64 `json:"value2" binding:"required"`
}
func (h *Handler) UpdateLicenseConfig(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
// ShowLicense to get system license
func (h *Handler) ShowLicense(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
// ListSandboxProviders handle list sandbox providers
func (h *Handler) ListSandboxProviders(c *gin.Context) {
providers, err := h.service.ListSandboxProviders()

View File

@@ -1992,5 +1992,36 @@ func (h *Handler) ListLogs(c *gin.Context) {
}
common.SuccessWithData(c, stats, "success")
}
// GetFingerprint handle get system fingerprint
func (h *Handler) GetFingerprint(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
type SetLicenseHTTPRequest struct {
License string `json:"license" binding:"required"`
}
// SetLicense to set system license
func (h *Handler) SetLicense(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
type SetLicenseConfigHTTPRequest struct {
TimeRecordSaveInterval int64 `json:"value1" binding:"required"`
TimeRecordTaskDuration int64 `json:"value2" binding:"required"`
}
func (h *Handler) UpdateLicenseConfig(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}
// ShowLicense to get system license
func (h *Handler) ShowLicense(c *gin.Context) {
common.ResponseWithHttpCodeData(c, http.StatusNotImplemented, common.CodeBadRequest, nil, "method not implemented")
return
}

View File

@@ -1649,9 +1649,7 @@ func (s *Service) HandleHeartbeat(message *common.BaseMessage) (common.ErrorCode
Timestamp: message.Timestamp,
Ext: message.Ext,
}
GlobalServerStore.UpdateServerInfo(message.ServerName, status)
return CheckLicense()
return UpdateServer(message.ServerName, status)
}
// InitDefaultAdmin initialize default admin user

View File

@@ -25,8 +25,12 @@ import (
"ragflow/internal/entity"
)
// Role management methods
func UpdateServer(serverName string, status *common.BaseMessage) (common.ErrorCode, string) {
GlobalServerStore.UpdateServerInfo(serverName, status)
return CheckLicense()
}
// Role management methods
// ListRoles list all roles
func (s *Service) ListRoles() ([]map[string]interface{}, error) {
result := []map[string]interface{}{