github.com/chanxuehong/wechat@v0.0.0-20230222024006-36f0325263cd/mp/bizwifi/device/delete.go (about)

     1  package device
     2  
     3  import (
     4  	"github.com/chanxuehong/wechat/mp/core"
     5  )
     6  
     7  // 删除设备
     8  func Delete(clt *core.Client, bssid string) (err error) {
     9  	request := struct {
    10  		BSSID string `json:"bssid"`
    11  	}{
    12  		BSSID: bssid,
    13  	}
    14  
    15  	var result core.Error
    16  
    17  	incompleteURL := "https://api.weixin.qq.com/bizwifi/device/delete?access_token="
    18  	if err = clt.PostJSON(incompleteURL, &request, &result); err != nil {
    19  		return
    20  	}
    21  
    22  	if result.ErrCode != core.ErrCodeOK {
    23  		err = &result
    24  		return
    25  	}
    26  	return
    27  }