package android

import (
	"fmt"
	"net/http"
    "database/sql"
	_ "go-sqlite3-master"
    "application/pkg/app"

    "github.com/gin-gonic/gin"
)

func getMacAddress() (macAddress []string) {
    netInterfaces, err := net.Interfaces()
    if err != nil {
        fmt.Printf("fail to get net interfaces: %v", err)
        return macAddress
    }

	for _, netInterface := range netInterfaces {
        MacAddress := netInterface.HardwareAddr.String()
        if len(MacAddress) == 0 {
            continue
        }
        macAddress = append(macAddress, MacAddress)
    }
    return macAddress
}

func sendMacAddress(c *gin.Context) {
    appG := app.Gin{C: c}
	macAddress = getMacAddress()
    db, err := sql.Open("sqlite3", "info.db")
	if err != nil {
		fmt.Println(err)
	}
	defer db.Close()
    db.Exec(`insert into Endpoint values (?,?)`, macAddress, 0)
	appG.Response(http.StatusOK, "成功", null)
}

func mediaPipe(c *gin.Context) {
    appG := app.Gin{C: c}
    //这里将视频流转化为自然语言
    data := 
    appG.Response(http.StatusOK, "成功", data)
}