feat: 积分商城-供应商-对账-发票4

This commit is contained in:
2026-09-08 20:12:40 +08:00
parent f42ea5b270
commit ff77ba16cc
39 changed files with 705 additions and 136 deletions
@@ -0,0 +1,21 @@
import { withErrorBoundary } from '../utils/handler.js'
import { guardMethod } from '../utils/method.js'
import { getBearerToken, readJson } from '../utils/request.js'
import { adminAuthService } from '../services/admin-auth.service.js'
import { serviceFail } from '../types/service-result.js'
import { merchantInvoiceService, type MerchantInvoiceListInput, type MerchantInvoiceFileInput } from '../services/merchant-invoice.service.js'
import { toHttpResponse } from './controller-response.js'
export const merchantInvoiceListController = withErrorBoundary(async request => {
const methodResponse = guardMethod(request, ['POST'])
if (methodResponse) return methodResponse
if (!await adminAuthService.findSession(getBearerToken(request))) return toHttpResponse(serviceFail('登录已失效,请重新登录', 401, 'UNAUTHORIZED'))
return toHttpResponse(await merchantInvoiceService.list(await readJson<MerchantInvoiceListInput>(request)))
})
export const merchantInvoiceFileController = withErrorBoundary(async request => {
const methodResponse = guardMethod(request, ['POST'])
if (methodResponse) return methodResponse
if (!await adminAuthService.findSession(getBearerToken(request))) return toHttpResponse(serviceFail('登录已失效,请重新登录', 401, 'UNAUTHORIZED'))
return toHttpResponse(await merchantInvoiceService.file(await readJson<MerchantInvoiceFileInput>(request)))
})