-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.go
More file actions
48 lines (41 loc) · 1.26 KB
/
service.go
File metadata and controls
48 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package apimaker
import "github.com/labstack/echo/v4"
// BaseServiceRequest defines common fields for all service requests.
type BaseServiceRequest struct {
Context echo.Context
Model Model
Security Security
}
// CreateServiceRequest defines the structure for a service request used for creating resources.
type CreateServiceRequest struct {
BaseServiceRequest
Form Form
AfterSave CreateFunc
BeforeSave CreateFunc
}
// UpdateServiceRequest defines the structure for a service request used for updating resources.
type UpdateServiceRequest struct {
BaseServiceRequest
Form Form
AfterSave CreateFunc
BeforeSave CreateFunc
}
// ListServiceRequest defines the structure for a service request used for listing resources.
type ListServiceRequest struct {
BaseServiceRequest
Pagination Pagination
Filters Filter
BeforeGetList CreateFunc
AfterGetList CreateFunc
}
// ViewServiceRequest defines the structure for a service request used for viewing a single resource.
type ViewServiceRequest struct {
BaseServiceRequest
AfterFind CreateFunc
}
// DeleteServiceRequest defines the structure for a service request used for deleting a resource.
type DeleteServiceRequest struct {
BaseServiceRequest
BeforeRemove CreateFunc
AfterRemove CreateFunc
}