fix balance end
All checks were successful
Build SMS Gateway / Build image (push) Successful in 20s

This commit is contained in:
2026-02-02 06:25:30 +07:00
parent 45d77b0285
commit 7906bf786b
3 changed files with 14 additions and 4 deletions

View File

@@ -124,7 +124,7 @@ curl -X POST http://localhost:3000/clear-all-sms
**Пример запроса:** **Пример запроса:**
```bash ```bash
curl http://localhost:3000/balance curl http://localhost:3000/balance.php
``` ```
**Ответ:** **Ответ:**
@@ -171,7 +171,7 @@ environment:
- `POST /sms/send` - `POST /sms/send`
- `GET /sms/view-all-sms` - `GET /sms/view-all-sms`
- `POST /sms/clear-all-sms` - `POST /sms/clear-all-sms`
- `GET /sms/balance` - `GET /sms/balance.php`
- `GET /sms/` - веб-интерфейс - `GET /sms/` - веб-интерфейс
Изменение порта в docker-compose.yml: Изменение порта в docker-compose.yml:

View File

@@ -1 +1 @@
0.3.2 0.3.3

View File

@@ -86,7 +86,17 @@ router.post("/clear-all-sms", (req, res) => {
}); });
// GET /balance - get account balance (SMSC API compatible) // GET /balance - get account balance (SMSC API compatible)
router.get("/balance", (req, res) => { router.get("/balance.php", (req, res) => {
const { login, psw } = req.query;
if (!login || !psw) {
return res.json({ error: "Отсутствуют обязательные параметры", error_code: 1 });
}
if (login !== AUTH_LOGIN || psw !== AUTH_PASSWORD) {
return res.json({ error: "Ошибка авторизации", error_code: 2 });
}
res.json({ balance: "1000.00" }); res.json({ balance: "1000.00" });
}); });