bit4sat/api/admin.go

35 lines
638 B
Go
Raw Permalink Normal View History

2019-04-09 07:20:46 +00:00
package api
import (
"net/http"
"git.sp4ke.com/sp4ke/bit4sat/storage"
"git.sp4ke.com/sp4ke/bit4sat/utils"
"github.com/gin-gonic/gin"
)
func adminGetInfo(c *gin.Context) {
adminToken := c.Param("adminToken")
// Get upload payments
//upInfo, err := storage.GetUploadInfoByToken(adminToken)
//if err != nil {
//utils.JSONErrPriv(c, http.StatusInternalServerError, err)
//return
//}
// Sum of payments
paySum, err := storage.GetMsatBalanceByAdminToken(adminToken)
if err != nil {
utils.JSONErrPriv(c, http.StatusInternalServerError, err)
return
}
c.JSON(http.StatusOK, gin.H{
"msat_avail": paySum,
})
return
}