gomod引用
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user