统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
@@ -39,7 +39,9 @@ type AdminAuditLogListResult = {
total: number
}
export async function createAdminAuditLog(input: AdminAuditLogCreateInput): Promise<AdminAuditLogRow | null> {
export async function createAdminAuditLog(
input: AdminAuditLogCreateInput,
): Promise<AdminAuditLogRow | null> {
const result = await query<AdminAuditLogRow>(
`
INSERT INTO admin_audit_logs (
@@ -69,12 +71,19 @@ export async function createAdminAuditLog(input: AdminAuditLogCreateInput): Prom
return result.rows[0] || null
}
export async function getAdminAuditLogById(logId: number | string): Promise<AdminAuditLogRow | null> {
const result = await query<AdminAuditLogRow>('SELECT * FROM admin_audit_logs WHERE id = $1 LIMIT 1', [Number(logId)])
export async function getAdminAuditLogById(
logId: number | string,
): Promise<AdminAuditLogRow | null> {
const result = await query<AdminAuditLogRow>(
'SELECT * FROM admin_audit_logs WHERE id = $1 LIMIT 1',
[Number(logId)],
)
return result.rows[0] || null
}
export async function listAdminAuditLogs(queryInput: AdminAuditLogListInput = {}): Promise<AdminAuditLogListResult> {
export async function listAdminAuditLogs(
queryInput: AdminAuditLogListInput = {},
): Promise<AdminAuditLogListResult> {
const conditions: string[] = []
const params: unknown[] = []
@@ -108,7 +117,7 @@ export async function listAdminAuditLogs(queryInput: AdminAuditLogListInput = {}
const pageSize = Number(queryInput.pageSize) || 20
const offset = (page - 1) * pageSize
const totalResult = await query<{ [column: string]: unknown, total: number }>(
const totalResult = await query<{ [column: string]: unknown; total: number }>(
`SELECT COUNT(*)::int AS total FROM admin_audit_logs ${whereClause}`,
params,
)