1234567891011121314151617181920212223242526272829303132333435 |
- package service
- import (
- "iot_manager_service/app/device/dao"
- )
- var UtilService = new(utilService)
- type utilService struct{}
- func (s *utilService) GetDeviceVendor(modeType, deviceType int) (*dao.DeviceVendor, error) {
- // 创建查询实例
- device := &dao.DeviceVendor{
- VendorType: modeType,
- DeviceType: deviceType,
- }
- err := device.GetByType()
- if err != nil {
- return nil, err
- }
- return device, nil
- }
- func (s *utilService) GetTenantCode(modeType, deviceType int) (*dao.DeviceVendor, error) {
- // 创建查询实例
- device := &dao.DeviceVendor{
- VendorType: modeType,
- DeviceType: deviceType,
- }
- err := device.GetByType()
- if err != nil {
- return nil, err
- }
- return device, nil
- }
|