This commit is contained in:
geek 2018-07-03 13:42:14 +09:00
parent 5d2503a224
commit ebe9ac6fd2

View File

@ -54,24 +54,12 @@ func (s *SensorService) StopSensor(id int64) error {
func (s *SensorService) AddSensor(sensorConfigBase64 string) error {
// base64 decode
//ddd := []byte(sensorConfigBase64)
//ff := make([]byte,len(ddd))
//fmt.Println(ddd)
bufByte, err := base64.StdEncoding.DecodeString(sensorConfigBase64)
//bufByte := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(sensorConfigBase64))
//bufByte, err := b64.RawStdEncoding.DecodeString(sensorConfigBase64)
//n, err := b64.StdEncoding.Decode(ff, ddd)
//fmt.Println(n)
if nil == bufByte || nil != err {
return err
}
//b, _ := ioutil.ReadAll(bufByte)
s.SensorConfigService.AddConfig(string(bufByte))
return nil