refactor: shorten model and table prefixes
This commit is contained in:
@@ -193,7 +193,7 @@ func randomStorageKey() (string, error) {
|
||||
}
|
||||
|
||||
// CreateSource 只持久化 Save 产生的相对路径,不接受 handler 自行拼接本地路径。
|
||||
func (s *Service) CreateSource(ownerID uint, project *models.SenlinAgentProject, title string, stored StoredFile) (*models.SenlinAgentSource, error) {
|
||||
func (s *Service) CreateSource(ownerID uint, project *models.SaProject, title string, stored StoredFile) (*models.SaSource, error) {
|
||||
title = strings.TrimSpace(title)
|
||||
if title == "" {
|
||||
title = stored.OriginalName
|
||||
@@ -205,7 +205,7 @@ func (s *Service) CreateSource(ownerID uint, project *models.SenlinAgentProject,
|
||||
if relativePath == "" || filepath.IsAbs(relativePath) {
|
||||
return nil, ErrSourcePathRequired
|
||||
}
|
||||
source := &models.SenlinAgentSource{
|
||||
source := &models.SaSource{
|
||||
ProjectID: project.ID, ProjectIdentity: project.Identity, CreatedBy: ownerID,
|
||||
Kind: "file", Title: title, FilePath: relativePath,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user