budget-api: initial
This commit is contained in:
@@ -1,59 +1,36 @@
|
||||
import express from 'express'
|
||||
import { accountingSetup } from '../controllers/accountingSetupController.js'
|
||||
import { accountingSearch } from '../controllers/accountingSearchController.js'
|
||||
import { accountingSum } from '../controllers/accountingSumController.js'
|
||||
import { budgetSearch } from '../controllers/budgetSearchController.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()
|
||||
const controller_budgetSearch_get = new budgetSearch()
|
||||
|
||||
|
||||
router.post('/accountingSetup', async (req, res) => {
|
||||
const result = await controller_accountingSetup_post.onNavigate(req, res)
|
||||
router.post('/budgetSetup', async (req, res) => {
|
||||
const result = await controller_budgetSetup_post.onNavigate(req, res)
|
||||
if (result) return res.json(result)
|
||||
})
|
||||
|
||||
// router.put('/budgetadd', async (req, res) => {
|
||||
// const result = await controller_budgetSetup_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)
|
||||
router.get('/budgetsearch', async (req, res) => {
|
||||
const result = await controller_budgetSearch_get.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)
|
||||
// router.get('/projectsearch', async (req, res) => {
|
||||
// const result = await controller_budgetSetup_post.onNavigate(req, res)
|
||||
// if (result) return res.json(result)
|
||||
// })
|
||||
|
||||
// // ===================================================
|
||||
// // 🔹 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)
|
||||
// router.put('/budgetexpense', async (req, res) => {
|
||||
// const result = await controller_budgetSetup_post.onNavigate(req, res)
|
||||
// if (result) return res.json(result)
|
||||
// })
|
||||
|
||||
// // ===================================================
|
||||
// // 🔹 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