package v1

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"chain33-pai/pkg/app"
	"chain33-pai/pkg/e"
	"chain33-pai/service/pai_service"
)

func GetDevdetail(c *gin.Context) {
	appG := app.Gin{C: c}
	var pai pai_service.Pai
	ok := pai.GetConfig()
	if !ok {
		appG.Response(http.StatusOK, e.ERROR, nil)
	}
	appG.Response(http.StatusOK, e.SUCCESS, map[string]interface{}{
		"serial": pai.Serial,
	})
}


func GetDevstatus(c *gin.Context) {
	appG := app.Gin{C: c}
	var pai pai_service.Pai
	err := pai.GetDevstatus()
	if err != nil {
		appG.Response(http.StatusOK, e.ERROR, nil)
	}
	appG.Response(http.StatusOK, e.SUCCESS, pai)
}