A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(lint): resolve the lint issue
LinkinStars8b61cad0143b
diff --git a/internal/base/constant/site_type.go b/internal/base/constant/site_type.goindex 20917f12..ff015ae6 100644--- a/internal/base/constant/site_type.go+++ b/internal/base/constant/site_type.go@@ -20,14 +20,13 @@package constantconst (- SiteTypeGeneral = "general"- // Deprecated: split SiteTypeInterfaceSettings and SiteTypeUsersSettings for better clarity+ // SiteTypeLegal\SiteTypeLegal\SiteTypeWrite The following items will no longer be used.+ SiteTypeLegal = "legal"SiteTypeInterface = "interface"- SiteTypeBranding = "branding"- // Deprecated: use SiteTypeAdvanced, SiteTypeQuestions, and SiteTypeTags instead- SiteTypeWrite = "write"- // Deprecated: use SiteTypePolicies and SiteTypeSecurity instead- SiteTypeLegal = "legal"+ SiteTypeWrite = "write"++ SiteTypeGeneral = "general"+ SiteTypeBranding = "branding"SiteTypeSeo = "seo"SiteTypeLogin = "login"SiteTypeCustomCssHTML = "css-html"diff --git a/internal/controller/ai_controller.go b/internal/controller/ai_controller.goindex 85db78a9..e020ed30 100644--- a/internal/controller/ai_controller.go+++ b/internal/controller/ai_controller.go@@ -613,7 +613,7 @@ func (c *AIController) executeToolCalls(ctx *gin.Context, _ http.ResponseWriter,for _, toolCall := range validToolCalls {if toolCall.Function.Name != "" {- var args map[string]interface{}+ var args map[string]anyif err := json.Unmarshal([]byte(toolCall.Function.Arguments), &args); err != nil {log.Errorf("Failed to parse tool arguments for %s: %v, arguments: %s", toolCall.Function.Name, err, toolCall.Function.Arguments)errorResult := fmt.Sprintf("Error parsing tool arguments: %v", err)@@ -677,14 +677,14 @@ func (c *AIController) getMCPTools() []openai.Tool {// convertMCPToolToOpenAIfunc (c *AIController) convertMCPToolToOpenAI(mcpTool mcp.Tool) openai.Tool {- properties := make(map[string]interface{})+ properties := make(map[string]any)required := make([]string, 0)maps.Copy(properties, mcpTool.InputSchema.Properties)required = append(required, mcpTool.InputSchema.Required...)- parameters := map[string]interface{}{+ parameters := map[string]any{"type": "object","properties": properties,}@@ -704,7 +704,7 @@ func (c *AIController) convertMCPToolToOpenAI(mcpTool mcp.Tool) openai.Tool {}// callMCPTool-func (c *AIController) callMCPTool(ctx context.Context, toolName string, arguments map[string]interface{}) (string, error) {+func (c *AIController) callMCPTool(ctx context.Context, toolName string, arguments map[string]any) (string, error) {request := mcp.CallToolRequest{Request: mcp.Request{},Params: struct {diff --git a/internal/migrations/v30.go b/internal/migrations/v30.goindex aa2f48b3..a2dca77e 100644--- a/internal/migrations/v30.go+++ b/internal/migrations/v30.go@@ -369,7 +369,7 @@ func splitLegalMenu(ctx context.Context, x *xorm.Engine) error {// save login settingsif existsLogin {- loginContent, err := json.Marshal(siteLogin)+ loginContent, _ := json.Marshal(siteLogin)_, err = x.Context(ctx).ID(siteInfoLogin.ID).Update(&entity.SiteInfo{Type: constant.SiteTypeLogin,Content: string(loginContent),@@ -382,7 +382,7 @@ func splitLegalMenu(ctx context.Context, x *xorm.Engine) error {// save general settingsif existGeneral {- generalContent, err := json.Marshal(siteGeneral)+ generalContent, _ := json.Marshal(siteGeneral)_, err = x.Context(ctx).ID(siteInfoGeneral.ID).Update(&entity.SiteInfo{Type: constant.SiteTypeGeneral,Content: string(generalContent),diff --git a/internal/schema/siteinfo_schema.go b/internal/schema/siteinfo_schema.goindex a72a8460..bdf2308d 100644--- a/internal/schema/siteinfo_schema.go+++ b/internal/schema/siteinfo_schema.go@@ -89,8 +89,7 @@ type SiteBrandingReq struct {Favicon string `validate:"omitempty,gt=0,lte=512" form:"favicon" json:"favicon"`}-// SiteWriteReq site write request-// Deprecated: use SiteQuestionsReq, SiteAdvancedReq and SiteTagsReq instead+// SiteWriteReq site write request use SiteQuestionsReq, SiteAdvancedReq and SiteTagsReq insteadtype SiteWriteReq struct {MinimumContent int `validate:"omitempty,gte=0,lte=65535" json:"min_content"`RestrictAnswer bool `validate:"omitempty" json:"restrict_answer"`@@ -159,8 +158,7 @@ type SiteWriteTag struct {DisplayName string `json:"display_name"`}-// SiteLegalReq site branding request-// Deprecated: use SitePoliciesReq and SiteSecurityReq instead+// SiteLegalReq site branding request use SitePoliciesReq and SiteSecurityReq insteadtype SiteLegalReq struct {TermsOfServiceOriginalText string `json:"terms_of_service_original_text"`TermsOfServiceParsedText string `json:"terms_of_service_parsed_text"`@@ -351,8 +349,7 @@ type SiteQuestionsResp SiteQuestionsReqtype SiteAdvancedResp SiteAdvancedReqtype SiteTagsResp SiteTagsReq-// SiteLegalResp site write response-// Deprecated: use SitePoliciesResp and SiteSecurityResp instead+// SiteLegalResp site write response use SitePoliciesResp and SiteSecurityResp insteadtype SiteLegalResp SiteLegalReq// SiteLegalSimpleResp site write responsediff --git a/internal/service/siteinfo/siteinfo_service.go b/internal/service/siteinfo/siteinfo_service.goindex 6cdb8ae5..1e25cbaa 100644--- a/internal/service/siteinfo/siteinfo_service.go+++ b/internal/service/siteinfo/siteinfo_service.go@@ -112,7 +112,6 @@ func (s *SiteInfoService) GetSiteUsers(ctx context.Context) (resp *schema.SiteUs// GetSiteTag get site info writefunc (s *SiteInfoService) GetSiteTag(ctx context.Context) (resp *schema.SiteTagsResp, err error) {- resp = &schema.SiteTagsResp{}resp, err = s.siteInfoCommonService.GetSiteTag(ctx)if err != nil {log.Error(err)