Documentation
¶
Index ¶
- type CRUDHandler
- type CRUDReq
- type CRUDService
- func (cs *CRUDService) Create(obj interface{}) error
- func (cs *CRUDService) Delete(obj interface{}, id int64) error
- func (cs *CRUDService) GetAll() (interface{}, int64, error)
- func (cs *CRUDService) GetByID(item interface{}, id int64) error
- func (cs *CRUDService) GetByUID(uid string, item interface{}) error
- func (cs *CRUDService) GetNew() models.Model
- func (cs *CRUDService) Joins(join string) (interface{}, int64, error)
- func (cs *CRUDService) List(l *ListParams) (interface{}, int64, error)
- func (cs *CRUDService) Update(obj interface{}, id int64) error
- func (cs *CRUDService) Where(condition string, args ...interface{}) (interface{}, int64, error)
- type Criteria
- type ICRUDHandler
- type ICRUDService
- type ListParams
- type ListReq
- type ProjectHandler
- type ProjectPatchForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRUDHandler ¶
type CRUDHandler struct {
Service *CRUDService
Name string
// contains filtered or unexported fields
}
func NewCRUDHandler ¶
func NewCRUDHandler(n string, s *CRUDService) *CRUDHandler
type CRUDReq ¶
type CRUDReq struct {
Data map[string]interface{} `json:"data"`
}
CRUDReq for CreateUpdateReq
type CRUDService ¶
type CRUDService struct {
Model models.Model
Type reflect.Type
Preloads []string
Results interface{}
Entity models.Entity
EntityName string
// contains filtered or unexported fields
}
func NewCrudService ¶
func (*CRUDService) Create ¶
func (cs *CRUDService) Create(obj interface{}) error
func (*CRUDService) Delete ¶
func (cs *CRUDService) Delete(obj interface{}, id int64) error
func (*CRUDService) GetAll ¶
func (cs *CRUDService) GetAll() (interface{}, int64, error)
func (*CRUDService) GetByID ¶
func (cs *CRUDService) GetByID(item interface{}, id int64) error
func (*CRUDService) GetByUID ¶
func (cs *CRUDService) GetByUID(uid string, item interface{}) error
func (*CRUDService) GetNew ¶
func (cs *CRUDService) GetNew() models.Model
func (*CRUDService) List ¶
func (cs *CRUDService) List(l *ListParams) (interface{}, int64, error)
func (*CRUDService) Update ¶
func (cs *CRUDService) Update(obj interface{}, id int64) error
type ICRUDHandler ¶
type ICRUDService ¶
type ICRUDService interface {
GetByID(interface{}, int64) error
GetByUID(string, interface{}) error
Create(interface{}) error
Update(interface{}, int64) error
Delete(interface{}, int64) error
GetAll() (interface{}, int64, error)
List(l ListParams) (interface{}, int64, error)
Where(condition string, args ...interface{}) (interface{}, int64, error)
Joins(join string) (interface{}, int64, error)
}
type ListParams ¶
type ListReq ¶
type ListReq struct {
Params ListParams `json:"params"`
}
type ProjectHandler ¶
type ProjectHandler struct {
CRUDHandler
Teacher CRUDService
Student CRUDService
Subject CRUDService
ProjectState CRUDService
Preloads []string
}
func NewProjectHandler ¶
func NewProjectHandler(d *gorm.DB, s *CRUDService) *ProjectHandler
type ProjectPatchForm ¶
Click to show internal directories.
Click to hide internal directories.