| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- package service
- import (
- "xps/datamodels"
- "xps/datasource"
- "xps/repositories"
- "xps/viewmodels"
- )
- type BizObjectMappingService interface {
- GetList(m map[string]interface{}) ([]viewmodels.BizObjectMappingInfo, error)
- GetPage(m map[string]interface{}) (*viewmodels.PageResult, error)
- GetById(bizId, objectId, mappingId int64) (*viewmodels.BizObjectMappingInfo, error)
- GetListById(bizId, objectId int64) ([]viewmodels.BizObjectMappingInfo, error)
- Create(d *datamodels.BizObjectMapping) error
- Update(d *datamodels.BizObjectMapping) error
- Delete(m map[string]interface{}) error
- }
- type bizObjectMappingService struct {
- repo *repositories.BizObjectMappingRepo
- }
- func NewBizObjectMappingService() BizObjectMappingService {
- return &bizObjectMappingService{
- repo: repositories.NewBizObjectMappingRepo(datasource.InstanceMaster()),
- }
- }
- func (s *bizObjectMappingService) GetList(m map[string]interface{}) ([]viewmodels.BizObjectMappingInfo, error) {
- return s.repo.GetList(m)
- }
- func (s *bizObjectMappingService) GetListById(bizId, objectId int64) ([]viewmodels.BizObjectMappingInfo, error) {
- return s.repo.GetListById(bizId, objectId)
- }
- func (s *bizObjectMappingService) GetPage(m map[string]interface{}) (*viewmodels.PageResult, error) {
- return s.repo.GetPage(m)
- }
- func (s *bizObjectMappingService) GetById(bizId, objectId, attrId int64) (*viewmodels.BizObjectMappingInfo, error) {
- return s.repo.GetById(bizId, objectId, attrId)
- }
- func (s *bizObjectMappingService) Create(attr *datamodels.BizObjectMapping) error {
- attr.MappingId = NewID()
- return s.repo.Create(attr)
- }
- func (s *bizObjectMappingService) Update(attr *datamodels.BizObjectMapping) error {
- return s.repo.Update(attr)
- }
- func (s *bizObjectMappingService) Delete(m map[string]interface{}) error {
- return s.repo.Delete(m)
- }
|