Files
micro-service-api/exthernal-accountingwep-api/src/routes/route.js

65 lines
2.7 KiB
JavaScript
Raw Normal View History

2025-11-11 12:36:06 +07:00
import express from 'express'
import { accountingSetup } from '../controllers/accountingSetupController.js'
import { accountingSearch } from '../controllers/accountingSearchController.js'
import { accountingSum } from '../controllers/accountingSumController.js'
import { accountingAdd } from '../controllers/accountingAddController.js'
2025-11-13 16:25:50 +07:00
2025-11-11 15:11:56 +07:00
// import { authMiddleware } from '../middlewares/auth.js'
// import { sendResponse } from '../utils/response.js'
2025-11-11 12:36:06 +07:00
const router = express.Router()
2025-11-11 17:55:41 +07:00
const controller_accountingSetup_post = new accountingSetup()
2025-11-13 16:25:50 +07:00
const controller_accountingSearch_post = new accountingSearch()
2025-11-13 20:23:30 +07:00
const controller_accountingSum_post = new accountingSum()
const controller_accountingAdd_post = new accountingAdd()
2025-11-11 12:36:06 +07:00
2025-11-11 17:55:41 +07:00
router.post('/accountingSetup', async (req, res) => {
const result = await controller_accountingSetup_post.onNavigate(req, res)
if (result) return res.json(result)
})
2025-11-11 12:36:06 +07:00
2025-11-13 16:25:50 +07:00
router.post('/accountingSearch', async (req, res) => {
const result = await controller_accountingSearch_post.onNavigate(req, res)
if (result) return res.json(result)
})
2025-11-13 20:23:30 +07:00
router.post('/accountingSum', async (req, res) => {
const result = await controller_accountingSum_post.onNavigate(req, res)
if (result) return res.json(result)
})
router.post('/accountingAdd', async (req, res) => {
const result = await controller_accountingAdd_post.onNavigate(req, res)
if (result) return res.json(result)
})
2025-11-13 16:25:50 +07:00
2025-11-11 15:11:56 +07:00
// // ===================================================
// // 🔹 BIOMETRIC LOGIN
// // ===================================================
// router.post('/biometric/login', async (req, res) => {
// const data = await controller_login_post.onBiometricLogin(req, res)
// if (data)
// return sendResponse(res, 200, 'เข้าสู่ระบบผ่าน Biometric สำเร็จ', 'Biometric login succeed', data)
// })
2025-11-11 12:36:06 +07:00
2025-11-11 15:11:56 +07:00
// // ===================================================
// // 🔹 BIOMETRIC REGISTER (ต้อง login ก่อน)
// // ===================================================
// router.post('/biometric/register', authMiddleware, async (req, res) => {
// const data = await controller_login_post.onBiometricRegister(req, res)
// if (data)
// return sendResponse(res, 200, 'ผูก Biometric สำเร็จ', 'Biometric registered', data)
// })
2025-11-11 12:36:06 +07:00
2025-11-11 15:11:56 +07:00
// // ===================================================
// // 🔹 TOKEN RENEW (ต่ออายุ Token)
// // ===================================================
// router.post('/token/renew', authMiddleware, async (req, res) => {
// const data = await controller_login_post.onRenewToken(req, res)
// if (data)
// return sendResponse(res, 200, 'ออก Token ใหม่สำเร็จ', 'Token renewed', data)
// })
2025-11-11 12:36:06 +07:00
export default router