mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 08:56:42 +08:00
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:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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{}{
|
||||
|
||||
Reference in New Issue
Block a user