package service import ( "iot_manager_service/app/multimedia/dao" "iot_manager_service/util/common" ) var PublishLibrariesService = new(publishLibrariesService) type publishLibrariesService struct{} func (s *publishLibrariesService) List(tenantId int, searchValue string, current, size int) ([]dao.PublishLibraries, *common.Errors) { program := &dao.PublishLibraries{ TenantId: tenantId, } offset := (current - 1) * size limit := size if searchValue != "" { program.Name = searchValue } list, err := program.GetList(offset, limit) if err != nil { return nil, common.FailResponse(err.Error(), nil) } return list, nil }