-ต้นแบบ โครงสร้าง ไฟล์ API เส้น /api/ttc
This commit is contained in:
59
exthernal-ttc-api/src/routes/route.js
Normal file
59
exthernal-ttc-api/src/routes/route.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import express from 'express'
|
||||
import { accountingSetup } from '../controllers/accountingSetupController.js'
|
||||
import { accountingSearch } from '../controllers/accountingSearchController.js'
|
||||
import { accountingSum } from '../controllers/accountingSumController.js'
|
||||
|
||||
// import { authMiddleware } from '../middlewares/auth.js'
|
||||
// import { sendResponse } from '../utils/response.js'
|
||||
|
||||
const router = express.Router()
|
||||
const controller_accountingSetup_post = new accountingSetup()
|
||||
const controller_accountingSearch_post = new accountingSearch()
|
||||
const controller_accountingSum_post = new accountingSum()
|
||||
|
||||
|
||||
router.post('/accountingSetup', async (req, res) => {
|
||||
const result = await controller_accountingSetup_post.onNavigate(req, res)
|
||||
if (result) return res.json(result)
|
||||
})
|
||||
|
||||
|
||||
router.post('/accountingSearch', async (req, res) => {
|
||||
const result = await controller_accountingSearch_post.onNavigate(req, res)
|
||||
if (result) return res.json(result)
|
||||
})
|
||||
|
||||
router.post('/accountingSum', async (req, res) => {
|
||||
const result = await controller_accountingSum_post.onNavigate(req, res)
|
||||
if (result) return res.json(result)
|
||||
})
|
||||
|
||||
|
||||
// // ===================================================
|
||||
// // 🔹 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)
|
||||
// })
|
||||
|
||||
// // ===================================================
|
||||
// // 🔹 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)
|
||||
// })
|
||||
|
||||
// // ===================================================
|
||||
// // 🔹 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)
|
||||
// })
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user