unit finish

This commit is contained in:
vanilia
2025-11-17 11:05:21 +07:00
parent bbf98b7a40
commit ebb3500d34
14 changed files with 528 additions and 315 deletions

No files matched your search

@@ -12,11 +12,27 @@ import (
"gorm.io/gorm"
e "simrs-vx/internal/domain/main-entities/unit"
elog "simrs-vx/internal/domain/sync-entities/log"
)
type createMw struct {
Name string
Func func(input *e.CreateDto, data *e.Unit, tx *gorm.DB) error
Func func(input *e.CreateDto) error
}
type createLogMw struct {
Name string
Func func(input *elog.SimxLogDto) error
}
type updateMw struct {
Name string
Func func(input *e.UpdateDto) error
}
type deleteMw struct {
Name string
Func func(input *e.DeleteDto) error
}
type readListMw struct {
@@ -29,16 +45,17 @@ type readDetailMw struct {
Func func(input *e.ReadDetailDto, data *e.Unit, tx *gorm.DB) error
}
type UpdateMw = readDetailMw
type DeleteMw = readDetailMw
type UpdateMw = updateMw
type DeleteMw = deleteMw
var createPreMw []createMw // preprocess middleware
var createPostMw []createMw // postprocess middleware
var createPreMw []createMw // preprocess middleware
var createPostMw []createMw // postprocess middleware
var createSimxLogMw []createLogMw
var readListPreMw []readListMw // ..
var readListPostMw []readListMw // ..
var readDetailPreMw []readDetailMw
var readDetailPostMw []readDetailMw
var updatePreMw []readDetailMw
var updatePreMw []updateMw
var updatePostMw []readDetailMw
var deletePreMw []readDetailMw
var deletePreMw []deleteMw
var deletePostMw []readDetailMw