feat: news router

This commit is contained in:
ericprd
2025-03-02 04:36:17 +08:00
parent f4ae93bc48
commit 915f12eaf7
49 changed files with 863 additions and 132 deletions
+13
View File
@@ -0,0 +1,13 @@
package newsrepository
import (
"fmt"
newsdomain "legalgo-BE-go/internal/domain/news"
)
func (a *accessor) Create(spec *newsdomain.News) error {
if err := a.db.Create(&spec).Error; err != nil {
return fmt.Errorf("failed to create news: %w", err)
}
return nil
}