You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bit4sat/api/admin.go

35 lines
638 B
Go

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
}