12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package service
- import (
- "iot_manager_service/app/device/dao"
- )
- var UtilService = new(utilService)
- type utilService struct{}
- func (s *utilService) GetDeviceVendor(tenantId, deviceType int) ([]dao.DeviceVendor, error) {
- // 创建查询实例
- device := &dao.DeviceVendor{
- TenantId: tenantId,
- DeviceType: deviceType,
- }
- vendors, err := device.GetVendor()
- if err != nil {
- return nil, err
- }
- return vendors, nil
- }
- func (s *utilService) GetDeviceBrand(tenantId, deviceType int) ([]dao.DeviceVendor, error) {
- // 创建查询实例
- device := &dao.DeviceVendor{
- TenantId: tenantId,
- DeviceType: deviceType,
- }
- vendors, err := device.GetBrand()
- if err != nil {
- return nil, err
- }
- return vendors, nil
- }
- func (s *utilService) GetDeviceModel(tenantId, deviceType, parentId int) ([]dao.DeviceVendor, error) {
- // 创建查询实例
- device := &dao.DeviceVendor{
- TenantId: tenantId,
- DeviceType: deviceType,
- ParentId: parentId,
- }
- vendors, err := device.GetModel()
- if err != nil {
- return nil, err
- }
- return vendors, nil
- }
|