gomod引用

This commit is contained in:
2025-12-19 09:42:39 +08:00
parent 0814c6c819
commit ed0e384907
33 changed files with 723 additions and 3123 deletions

View File

@@ -36,15 +36,18 @@ func (s *adSourceService) CreateAdSource(ctx context.Context, req *dto.CreateAdS
}
adSource := &entity.AdSource{
Name: req.Name,
Code: req.Code,
Provider: req.Provider,
Type: req.Type,
APIEndpoint: req.APIEndpoint,
Status: "active", // 默认状态
Priority: 1, // 默认优先级
Name: req.Name,
Code: req.Code,
Provider: req.Provider,
Type: req.Type,
APIConfig: entity.APIConfig{
Endpoint: req.APIEndpoint,
},
}
// 设置状态
adSource.Status = "active" // 默认状态
return dao.AdSource.Create(ctx, adSource)
}
@@ -77,7 +80,7 @@ func (s *adSourceService) UpdateAdSource(ctx context.Context, id string, req *dt
updateData.Name = req.Name
}
if req.APIEndpoint != "" {
updateData.APIEndpoint = req.APIEndpoint
updateData.APIConfig.Endpoint = req.APIEndpoint
}
return dao.AdSource.UpdateFields(ctx, id, updateData)