Documentation ¶
Index ¶
- Variables
- func RecursivelyQueryAllPeggedModels(db *gorm.DB, modelObjs []mdl.IModel, begin time.Time, end time.Time) error
- type BaseServiceV1
- func (serv *BaseServiceV1) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *BaseServiceV1) DeleteOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *BaseServiceV1) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *BaseServiceV1) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type BaseServiceV2
- func (serv *BaseServiceV2) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *BaseServiceV2) DeleteOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *BaseServiceV2) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID, ...) (mdl.IModel, userrole.UserRole, error)
- func (serv *BaseServiceV2) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type GlobalService
- func (serv *GlobalService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *GlobalService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (service *GlobalService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *GlobalService) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *GlobalService) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *GlobalService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *GlobalService) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (service *GlobalService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *GlobalService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type IServiceV1
- type IServiceV2
- type LinkTableService
- func (serv *LinkTableService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *LinkTableService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (serv *LinkTableService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *LinkTableService) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *LinkTableService) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *LinkTableService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *LinkTableService) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (service *LinkTableService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *LinkTableService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type OrgPartition
- func (serv *OrgPartition) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *OrgPartition) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (serv *OrgPartition) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *OrgPartition) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OrgPartition) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OrgPartition) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OrgPartition) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OrgPartition) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID, ...) (mdl.IModel, userrole.UserRole, error)
- func (serv *OrgPartition) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type OrganizationService
- func (serv *OrganizationService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *OrganizationService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (serv *OrganizationService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *OrganizationService) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OrganizationService) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OrganizationService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OrganizationService) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OrganizationService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *OrganizationService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type OwnershipService
- func (serv *OwnershipService) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OwnershipService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *OwnershipService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (serv *OwnershipService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *OwnershipService) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OwnershipService) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OwnershipService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *OwnershipService) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *OwnershipService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *OwnershipService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
- type UserService
- func (serv *UserService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
- func (serv *UserService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, ...) ([]userrole.UserRole, error)
- func (serv *UserService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, []userrole.UserRole, error)
- func (serv *UserService) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *UserService) HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *UserService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) ([]mdl.IModel, error)
- func (serv *UserService) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (mdl.IModel, error)
- func (serv *UserService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
- func (serv *UserService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ...) (modelObj2 mdl.IModel, err error)
Constants ¶
This section is empty.
Variables ¶
var ErrBatchUpdateOrPatchOneNotFound = errors.New("at least one not found")
var ErrIDEmpty = errors.New("cannot operate when ID is empty")
var ErrIDNotMatch = errors.New("cannot operate when ID in HTTP body and URL parameter not match")
var ErrPatch = errors.New("patch syntax error") // json: cannot unmarshal object into Go value of type jsonpatch.Patch
var ErrPermission = errors.New("permission denied")
Error
var ErrPermissionWrongEndPoint = errors.New("permission denied. Change it through the resource endpoint or unable to change your own role.")
Functions ¶
func RecursivelyQueryAllPeggedModels ¶ added in v0.9.7
func RecursivelyQueryAllPeggedModels(db *gorm.DB, modelObjs []mdl.IModel, begin time.Time, end time.Time) error
It is assumed that modelObjs are all from the same table (same IModel) If there is a third-level, it is not performant because it's depth first right now Wow, this is really difficult.
Types ¶
type BaseServiceV1 ¶ added in v0.9.7
type BaseServiceV1 struct { }
BaseServiceV1 is the superclass of all services
func (*BaseServiceV1) CreateOneCore ¶ added in v0.9.7
func (serv *BaseServiceV1) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (mdl.IModel, error)
CreateOneCore create the model
func (*BaseServiceV1) DeleteOneCore ¶ added in v0.9.7
func (*BaseServiceV1) ReadOneCore ¶ added in v0.9.7
func (*BaseServiceV1) UpdateOneCore ¶ added in v0.9.7
func (serv *BaseServiceV1) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type BaseServiceV2 ¶ added in v0.9.7
type BaseServiceV2 struct { }
BaseServiceV2 is the superclass of all services
func (*BaseServiceV2) CreateOneCore ¶ added in v0.9.7
func (serv *BaseServiceV2) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (mdl.IModel, error)
CreateOneCore create the model
func (*BaseServiceV2) DeleteOneCore ¶ added in v0.9.7
func (*BaseServiceV2) ReadOneCore ¶ added in v0.9.7
func (*BaseServiceV2) UpdateOneCore ¶ added in v0.9.7
func (serv *BaseServiceV2) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type GlobalService ¶
type GlobalService struct {
BaseServiceV1
}
func (*GlobalService) GetAllQueryContructCore ¶ added in v0.3.4
func (serv *GlobalService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore construct the meat of the query
func (*GlobalService) GetAllRolesCore ¶ added in v0.3.4
func (serv *GlobalService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore gets all roles according to the criteria
func (*GlobalService) GetManyCore ¶ added in v0.5.0
func (*GlobalService) HookBeforeCreateMany ¶
func (*GlobalService) HookBeforeCreateOne ¶
func (*GlobalService) HookBeforeDeleteMany ¶
func (*GlobalService) HookBeforeDeleteOne ¶
func (*GlobalService) ReadOneCore ¶ added in v0.5.0
func (service *GlobalService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
ReadOneCore get one model object based on its type and its id string
func (*GlobalService) UpdateOneCore ¶
func (serv *GlobalService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type IServiceV1 ¶ added in v0.9.7
type IServiceV1 interface { HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel) (mdl.IModel, error) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]mdl.IModel, error) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel) (mdl.IModel, error) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]mdl.IModel, error) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (mdl.IModel, error) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error) DeleteOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObjs mdl.IModel) (mdl.IModel, error) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ids []*datatype.UUID) ([]mdl.IModel, []userrole.UserRole, error) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error) }
IServiceV1 provice basic data fetch for various type of table to user relationships
type IServiceV2 ¶ added in v0.9.7
type IServiceV2 interface { HookBeforeCreateOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel) (mdl.IModel, error) HookBeforeCreateMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]mdl.IModel, error) HookBeforeDeleteOne(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel) (mdl.IModel, error) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]mdl.IModel, error) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (mdl.IModel, error) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID, options map[urlparam.Param]interface{}) (mdl.IModel, userrole.UserRole, error) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error) DeleteOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObjs mdl.IModel) (mdl.IModel, error) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ids []*datatype.UUID) ([]mdl.IModel, []userrole.UserRole, error) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error) }
IServiceV2 provice basic data fetch for various type of table to user relationships
type LinkTableService ¶
type LinkTableService struct {
BaseServiceV1
}
func (*LinkTableService) GetAllQueryContructCore ¶ added in v0.3.4
func (serv *LinkTableService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore construct query core
func (*LinkTableService) GetAllRolesCore ¶ added in v0.3.4
func (serv *LinkTableService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore gets all roles according to the criteria
func (*LinkTableService) GetManyCore ¶ added in v0.5.0
func (*LinkTableService) HookBeforeCreateMany ¶
func (*LinkTableService) HookBeforeCreateOne ¶
func (*LinkTableService) HookBeforeDeleteMany ¶
func (*LinkTableService) HookBeforeDeleteOne ¶
func (*LinkTableService) ReadOneCore ¶ added in v0.5.0
func (service *LinkTableService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
ReadOneCore get one model object based on its type and its id string
func (*LinkTableService) UpdateOneCore ¶
func (serv *LinkTableService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type OrgPartition ¶ added in v0.9.7
type OrgPartition struct {
BaseServiceV2
}
OrgPartition handles all the ownership specific db calls
func (*OrgPartition) GetAllQueryContructCore ¶ added in v0.9.7
func (serv *OrgPartition) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore construct query core
func (*OrgPartition) GetAllRolesCore ¶ added in v0.9.7
func (serv *OrgPartition) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore gets all roles according to the criteria
func (*OrgPartition) GetManyCore ¶ added in v0.9.7
func (*OrgPartition) HookBeforeCreateMany ¶ added in v0.9.7
func (*OrgPartition) HookBeforeCreateOne ¶ added in v0.9.7
func (*OrgPartition) HookBeforeDeleteMany ¶ added in v0.9.7
func (*OrgPartition) HookBeforeDeleteOne ¶ added in v0.9.7
func (*OrgPartition) ReadOneCore ¶ added in v0.9.7
func (serv *OrgPartition) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID, options map[urlparam.Param]interface{}) (mdl.IModel, userrole.UserRole, error)
getOneWithIDCore get one model object based on its type and its id string since this is organizationMapper, need to make sure it's the same organization
func (*OrgPartition) UpdateOneCore ¶ added in v0.9.7
func (serv *OrgPartition) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permission should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type OrganizationService ¶
type OrganizationService struct {
BaseServiceV1
}
OrganizationService handles all the ownership specific db calls
func (*OrganizationService) GetAllQueryContructCore ¶ added in v0.3.4
func (serv *OrganizationService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore construct query core
func (*OrganizationService) GetAllRolesCore ¶ added in v0.3.4
func (serv *OrganizationService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore gets all roles according to the criteria
func (*OrganizationService) GetManyCore ¶ added in v0.5.0
func (*OrganizationService) HookBeforeCreateMany ¶
func (*OrganizationService) HookBeforeCreateOne ¶
func (*OrganizationService) HookBeforeDeleteMany ¶
func (*OrganizationService) HookBeforeDeleteOne ¶
func (*OrganizationService) ReadOneCore ¶ added in v0.5.0
func (serv *OrganizationService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
getOneWithIDCore get one model object based on its type and its id string since this is organizationMapper, need to make sure it's the same organization
func (*OrganizationService) UpdateOneCore ¶
func (serv *OrganizationService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permission should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type OwnershipService ¶
type OwnershipService struct {
BaseServiceV1
}
OwnershipService handles all the ownership specific db calls
func (*OwnershipService) CreateOneCore ¶
func (serv *OwnershipService) CreateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (mdl.IModel, error)
CreateOneCore creates the stuff
func (*OwnershipService) GetAllQueryContructCore ¶ added in v0.3.4
func (serv *OwnershipService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore construct the meat of the query
func (*OwnershipService) GetAllRolesCore ¶ added in v0.3.4
func (serv *OwnershipService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore gets all roles according to the criteria
func (*OwnershipService) GetManyCore ¶ added in v0.5.0
func (serv *OwnershipService) GetManyCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, ids []*datatype.UUID) ([]mdl.IModel, []userrole.UserRole, error)
GetManyCore -
func (*OwnershipService) HookBeforeCreateMany ¶
func (*OwnershipService) HookBeforeCreateOne ¶
func (*OwnershipService) HookBeforeDeleteMany ¶
func (serv *OwnershipService) HookBeforeDeleteMany(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]mdl.IModel, error)
HookBeforeDeleteMany deletes link table because GORM isn't automatic here when we customize it with UUID or when we have role
func (*OwnershipService) HookBeforeDeleteOne ¶
func (*OwnershipService) ReadOneCore ¶ added in v0.5.0
func (serv *OwnershipService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
ReadOneCore get one model object based on its type and its id string
func (*OwnershipService) UpdateOneCore ¶
func (serv *OwnershipService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)
type UserService ¶
type UserService struct {
BaseServiceV1
}
func (*UserService) GetAllQueryContructCore ¶ added in v0.3.4
func (serv *UserService) GetAllQueryContructCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string) (*gorm.DB, error)
GetAllQueryContructCore :-
func (*UserService) GetAllRolesCore ¶ added in v0.3.4
func (serv *UserService) GetAllRolesCore(dbChained *gorm.DB, dbClean *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObjs []mdl.IModel) ([]userrole.UserRole, error)
GetAllRolesCore :-
func (*UserService) GetManyCore ¶ added in v0.5.0
func (*UserService) HookBeforeCreateMany ¶
func (*UserService) HookBeforeCreateOne ¶
func (*UserService) HookBeforeDeleteMany ¶
func (*UserService) HookBeforeDeleteOne ¶
func (*UserService) ReadOneCore ¶ added in v0.5.0
func (serv *UserService) ReadOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, id *datatype.UUID) (mdl.IModel, userrole.UserRole, error)
ReadOneCore get one model object based on its type and its id string ReadOne get one model object based on its type and its id string without invoking read hookpoing
func (*UserService) UpdateOneCore ¶
func (serv *UserService) UpdateOneCore(db *gorm.DB, who mdlutil.UserIDFetchable, typeString string, modelObj mdl.IModel, id *datatype.UUID, oldModelObj mdl.IModel) (modelObj2 mdl.IModel, err error)
UpdateOneCore one, permissin should already be checked called for patch operation as well (after patch has already applied) Fuck, repeat the following code for now (you can't call the overriding method from the non-overriding one)