change_notify.go 543 B

1234567891011121314151617181920
  1. // Copyright 2019 github.com. All rights reserved.
  2. // Use of this source code is governed by github.com.
  3. package device
  4. import (
  5. "context"
  6. "smart-auth/errors"
  7. "smart-auth/pb/v1"
  8. )
  9. func DeviceChangeNotify(ctx context.Context, req *v1.DeviceChangeNotifyRequest) (reply *v1.DeviceChangeNotifyReply, err error) {
  10. if req.Sn == "" || req.DeviceCode == 0 {
  11. return nil, errors.ParamsError
  12. }
  13. DeleteDeviceInfoFromMem(req.Sn, req.DeviceCode)
  14. DeleteDeviceInfoByIdFromMem(req.Sn, req.DeviceCode)
  15. return &v1.DeviceChangeNotifyReply{}, nil
  16. }