Skip to content

Commit 8b61cad

Browse files
committed
fix(lint): resolve the lint issue
1 parent bdd1949 commit 8b61cad

5 files changed

Lines changed: 15 additions & 20 deletions

File tree

internal/base/constant/site_type.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
package constant
2121

2222
const (
23-
SiteTypeGeneral = "general"
24-
// Deprecated: split SiteTypeInterfaceSettings and SiteTypeUsersSettings for better clarity
23+
// SiteTypeLegal\SiteTypeLegal\SiteTypeWrite The following items will no longer be used.
24+
SiteTypeLegal = "legal"
2525
SiteTypeInterface = "interface"
26-
SiteTypeBranding = "branding"
27-
// Deprecated: use SiteTypeAdvanced, SiteTypeQuestions, and SiteTypeTags instead
28-
SiteTypeWrite = "write"
29-
// Deprecated: use SiteTypePolicies and SiteTypeSecurity instead
30-
SiteTypeLegal = "legal"
26+
SiteTypeWrite = "write"
27+
28+
SiteTypeGeneral = "general"
29+
SiteTypeBranding = "branding"
3130
SiteTypeSeo = "seo"
3231
SiteTypeLogin = "login"
3332
SiteTypeCustomCssHTML = "css-html"

internal/controller/ai_controller.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ func (c *AIController) executeToolCalls(ctx *gin.Context, _ http.ResponseWriter,
613613

614614
for _, toolCall := range validToolCalls {
615615
if toolCall.Function.Name != "" {
616-
var args map[string]interface{}
616+
var args map[string]any
617617
if err := json.Unmarshal([]byte(toolCall.Function.Arguments), &args); err != nil {
618618
log.Errorf("Failed to parse tool arguments for %s: %v, arguments: %s", toolCall.Function.Name, err, toolCall.Function.Arguments)
619619
errorResult := fmt.Sprintf("Error parsing tool arguments: %v", err)
@@ -677,14 +677,14 @@ func (c *AIController) getMCPTools() []openai.Tool {
677677

678678
// convertMCPToolToOpenAI
679679
func (c *AIController) convertMCPToolToOpenAI(mcpTool mcp.Tool) openai.Tool {
680-
properties := make(map[string]interface{})
680+
properties := make(map[string]any)
681681
required := make([]string, 0)
682682

683683
maps.Copy(properties, mcpTool.InputSchema.Properties)
684684

685685
required = append(required, mcpTool.InputSchema.Required...)
686686

687-
parameters := map[string]interface{}{
687+
parameters := map[string]any{
688688
"type": "object",
689689
"properties": properties,
690690
}
@@ -704,7 +704,7 @@ func (c *AIController) convertMCPToolToOpenAI(mcpTool mcp.Tool) openai.Tool {
704704
}
705705

706706
// callMCPTool
707-
func (c *AIController) callMCPTool(ctx context.Context, toolName string, arguments map[string]interface{}) (string, error) {
707+
func (c *AIController) callMCPTool(ctx context.Context, toolName string, arguments map[string]any) (string, error) {
708708
request := mcp.CallToolRequest{
709709
Request: mcp.Request{},
710710
Params: struct {

internal/migrations/v30.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ func splitLegalMenu(ctx context.Context, x *xorm.Engine) error {
369369

370370
// save login settings
371371
if existsLogin {
372-
loginContent, err := json.Marshal(siteLogin)
372+
loginContent, _ := json.Marshal(siteLogin)
373373
_, err = x.Context(ctx).ID(siteInfoLogin.ID).Update(&entity.SiteInfo{
374374
Type: constant.SiteTypeLogin,
375375
Content: string(loginContent),
@@ -382,7 +382,7 @@ func splitLegalMenu(ctx context.Context, x *xorm.Engine) error {
382382

383383
// save general settings
384384
if existGeneral {
385-
generalContent, err := json.Marshal(siteGeneral)
385+
generalContent, _ := json.Marshal(siteGeneral)
386386
_, err = x.Context(ctx).ID(siteInfoGeneral.ID).Update(&entity.SiteInfo{
387387
Type: constant.SiteTypeGeneral,
388388
Content: string(generalContent),

internal/schema/siteinfo_schema.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ type SiteBrandingReq struct {
8989
Favicon string `validate:"omitempty,gt=0,lte=512" form:"favicon" json:"favicon"`
9090
}
9191

92-
// SiteWriteReq site write request
93-
// Deprecated: use SiteQuestionsReq, SiteAdvancedReq and SiteTagsReq instead
92+
// SiteWriteReq site write request use SiteQuestionsReq, SiteAdvancedReq and SiteTagsReq instead
9493
type SiteWriteReq struct {
9594
MinimumContent int `validate:"omitempty,gte=0,lte=65535" json:"min_content"`
9695
RestrictAnswer bool `validate:"omitempty" json:"restrict_answer"`
@@ -159,8 +158,7 @@ type SiteWriteTag struct {
159158
DisplayName string `json:"display_name"`
160159
}
161160

162-
// SiteLegalReq site branding request
163-
// Deprecated: use SitePoliciesReq and SiteSecurityReq instead
161+
// SiteLegalReq site branding request use SitePoliciesReq and SiteSecurityReq instead
164162
type SiteLegalReq struct {
165163
TermsOfServiceOriginalText string `json:"terms_of_service_original_text"`
166164
TermsOfServiceParsedText string `json:"terms_of_service_parsed_text"`
@@ -351,8 +349,7 @@ type SiteQuestionsResp SiteQuestionsReq
351349
type SiteAdvancedResp SiteAdvancedReq
352350
type SiteTagsResp SiteTagsReq
353351

354-
// SiteLegalResp site write response
355-
// Deprecated: use SitePoliciesResp and SiteSecurityResp instead
352+
// SiteLegalResp site write response use SitePoliciesResp and SiteSecurityResp instead
356353
type SiteLegalResp SiteLegalReq
357354

358355
// SiteLegalSimpleResp site write response

internal/service/siteinfo/siteinfo_service.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func (s *SiteInfoService) GetSiteUsers(ctx context.Context) (resp *schema.SiteUs
112112

113113
// GetSiteTag get site info write
114114
func (s *SiteInfoService) GetSiteTag(ctx context.Context) (resp *schema.SiteTagsResp, err error) {
115-
resp = &schema.SiteTagsResp{}
116115
resp, err = s.siteInfoCommonService.GetSiteTag(ctx)
117116
if err != nil {
118117
log.Error(err)

0 commit comments

Comments
 (0)