utilService.go 404 B

12345678910111213141516171819202122
  1. package service
  2. import (
  3. "iot_manager_service/app/device/dao"
  4. )
  5. var UtilService = new(utilService)
  6. type utilService struct{}
  7. func (s *utilService) Get(modeType, deviceType int) (*dao.DeviceVendor, error) {
  8. // 创建查询实例
  9. device := &dao.DeviceVendor{
  10. VendorType: modeType,
  11. DeviceType: deviceType,
  12. }
  13. err := device.GetByType()
  14. if err != nil {
  15. return nil, err
  16. }
  17. return device, nil
  18. }