u
This commit is contained in:
1 parent
1934225c53
commit
e51f4948d4
10 files changed
+89
-66
No files matched your search
@@ -129,6 +129,9 @@ func TimestampToMillis(ts pgtype.Timestamp) int64 {
|
|||||||
return ts.Time.UnixMilli()
|
return ts.Time.UnixMilli()
|
||||||
}
|
}
|
||||||
|
|
||||||
func DateToString(s pgtype.Date) string {
|
func DateToString(d pgtype.Date) string {
|
||||||
return s.Time.String()
|
if !d.Valid {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return d.Time.Format("2006-01-02")
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { MoneyRecordGroup, MoneyRecordItem } from '@/types/money/record'
|
import type { MoneyRecord, MoneyRecordGroup } from '@/types/money/record'
|
||||||
import React, { useCallback, useState } from 'react'
|
import React, { useCallback, useState } from 'react'
|
||||||
import { RefreshControl, SectionList, Text, TouchableHighlight, Vibration, View } from 'react-native'
|
import { RefreshControl, SectionList, Text, TouchableHighlight, Vibration, View } from 'react-native'
|
||||||
import {
|
import {
|
||||||
@@ -11,11 +11,13 @@ import {
|
|||||||
import { LucideIcon } from '@/components/common/ao'
|
import { LucideIcon } from '@/components/common/ao'
|
||||||
import EmptyState from '@/components/common/EmptyStatus'
|
import EmptyState from '@/components/common/EmptyStatus'
|
||||||
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
|
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
|
||||||
|
import { useMoneyCategoryStore } from '@/store/moneyCategory'
|
||||||
import { useUserStore } from '@/store/user'
|
import { useUserStore } from '@/store/user'
|
||||||
|
import { MoneyCategoryEnum } from '@/types/money/category'
|
||||||
|
|
||||||
interface StaticTransactionsProps {
|
interface StaticTransactionsProps {
|
||||||
records: MoneyRecordGroup[]
|
records: MoneyRecordGroup[]
|
||||||
onUpdate?: (data: MoneyRecordItem) => void
|
onUpdate?: (data: MoneyRecord) => void
|
||||||
onDelete?: (id: number) => void
|
onDelete?: (id: number) => void
|
||||||
onDetail?: (id: number) => void
|
onDetail?: (id: number) => void
|
||||||
onRefreshData?: () => void
|
onRefreshData?: () => void
|
||||||
@@ -30,6 +32,7 @@ export default function StaticTransactions({
|
|||||||
onLoadMore,
|
onLoadMore,
|
||||||
onRefreshData,
|
onRefreshData,
|
||||||
}: StaticTransactionsProps) {
|
}: StaticTransactionsProps) {
|
||||||
|
const moneyCategoryStore = useMoneyCategoryStore()
|
||||||
const userID = useUserStore().userInfo?.id
|
const userID = useUserStore().userInfo?.id
|
||||||
const [refreshing, setRefreshing] = useState(false)
|
const [refreshing, setRefreshing] = useState(false)
|
||||||
const [loadingMore, setLoadingMore] = useState(false)
|
const [loadingMore, setLoadingMore] = useState(false)
|
||||||
@@ -119,6 +122,7 @@ export default function StaticTransactions({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
renderItem={({ item }) => {
|
renderItem={({ item }) => {
|
||||||
|
const category = moneyCategoryStore.getCategoryById(item.category_id)
|
||||||
return (
|
return (
|
||||||
<Menu
|
<Menu
|
||||||
renderer={renderers.Popover}
|
renderer={renderers.Popover}
|
||||||
@@ -146,12 +150,12 @@ export default function StaticTransactions({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View className="relative w-10 h-10 rounded-full bg-gray-100 items-center justify-center">
|
<View className="relative w-10 h-10 rounded-full bg-gray-100 items-center justify-center">
|
||||||
<MoneyCategoryIcon name={item.category_icon} size={24} color="#000" />
|
<MoneyCategoryIcon name={category?.icon} size={24} color="#000" />
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className="flex-1">
|
<View className="flex-1">
|
||||||
<Text className="text-gray-800 text-base">
|
<Text className="text-gray-800 text-base">
|
||||||
{item.remark ? item.remark : item.category_name}
|
{item.remark ? item.remark : category?.name}
|
||||||
</Text>
|
</Text>
|
||||||
{
|
{
|
||||||
item.user_id !== userID && (
|
item.user_id !== userID && (
|
||||||
@@ -166,7 +170,7 @@ export default function StaticTransactions({
|
|||||||
<Text
|
<Text
|
||||||
className="text-sm text-gray-600 text-right"
|
className="text-sm text-gray-600 text-right"
|
||||||
>
|
>
|
||||||
{item.category_type === 1 ? '+' : '-'}
|
{category?.type === MoneyCategoryEnum.Income ? '+' : '-'}
|
||||||
{' '}
|
{' '}
|
||||||
{item.amount}
|
{item.amount}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ export default function Money() {
|
|||||||
record_time: searchParams.record_time,
|
record_time: searchParams.record_time,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.isSuccess) {
|
if (res.isSuccess) {
|
||||||
|
console.log(res.data.records)
|
||||||
moneyRecordStore.setRecords(res.data.records, searchParams.record_time)
|
moneyRecordStore.setRecords(res.data.records, searchParams.record_time)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -62,7 +63,7 @@ export default function Money() {
|
|||||||
}
|
}
|
||||||
}, []),
|
}, []),
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
className="flex-1"
|
className="flex-1"
|
||||||
|
|||||||
@@ -49,6 +49,12 @@ export default function CreateCategory({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsOpen(open)
|
setIsOpen(open)
|
||||||
|
if (!open) {
|
||||||
|
setForm({
|
||||||
|
icon: '',
|
||||||
|
name: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
}, [open])
|
}, [open])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -67,13 +73,12 @@ export default function CreateCategory({
|
|||||||
}, [category])
|
}, [category])
|
||||||
|
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
setIsOpen(false)
|
|
||||||
onClose && onClose()
|
|
||||||
|
|
||||||
setForm({
|
setForm({
|
||||||
icon: '',
|
icon: '',
|
||||||
name: '',
|
name: '',
|
||||||
})
|
})
|
||||||
|
setIsOpen(false)
|
||||||
|
onClose && onClose()
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ export default function MoneyCategorySetting() {
|
|||||||
sort_number: 0,
|
sort_number: 0,
|
||||||
type: selectedTab,
|
type: selectedTab,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
scrollableRef.current?.scrollToEnd({ animated: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
setshowEditCategory(false)
|
setshowEditCategory(false)
|
||||||
|
|||||||
@@ -4,14 +4,18 @@ import { Text, View } from 'react-native'
|
|||||||
import { AButton, ACell, ACellGroup, AModal } from '@/components/common/ao'
|
import { AButton, ACell, ACellGroup, AModal } from '@/components/common/ao'
|
||||||
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
|
import MoneyCategoryIcon from '@/components/common/MoneyCategoryIcon'
|
||||||
import CustomHeader from '@/components/custom/Header'
|
import CustomHeader from '@/components/custom/Header'
|
||||||
|
import { useMoneyCategoryStore } from '@/store/moneyCategory'
|
||||||
import { useMoneyRecordStore } from '@/store/moneyRecord'
|
import { useMoneyRecordStore } from '@/store/moneyRecord'
|
||||||
import { useUserStore } from '@/store/user'
|
import { useUserStore } from '@/store/user'
|
||||||
|
import { MoneyCategoryEnum } from '@/types/money/category'
|
||||||
import { toDateString, toDateTimeString } from '@/utils/time'
|
import { toDateString, toDateTimeString } from '@/utils/time'
|
||||||
|
|
||||||
export default function MoneyRecordDetail() {
|
export default function MoneyRecordDetail() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const moneyRecordStore = useMoneyRecordStore()
|
const moneyRecordStore = useMoneyRecordStore()
|
||||||
|
const moneyCategoryStore = useMoneyCategoryStore()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|
||||||
const { id: detailId } = useLocalSearchParams<{ id: string }>()
|
const { id: detailId } = useLocalSearchParams<{ id: string }>()
|
||||||
|
|
||||||
const moneryRecord = moneyRecordStore.getMoneyRecordById(Number(detailId))
|
const moneryRecord = moneyRecordStore.getMoneyRecordById(Number(detailId))
|
||||||
@@ -22,18 +26,20 @@ export default function MoneyRecordDetail() {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const moneyCategory = moneyCategoryStore.getCategoryById(moneryRecord.category_id)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View className="flex-1">
|
<View className="flex-1">
|
||||||
<CustomHeader title="账单详情" />
|
<CustomHeader title="账单详情" />
|
||||||
<View className="flex-1">
|
<View className="flex-1">
|
||||||
<View className="flex flex-col items-center">
|
<View className="flex flex-col items-center">
|
||||||
<MoneyCategoryIcon name={moneryRecord.category_icon} size={56} />
|
<MoneyCategoryIcon name={moneyCategory?.icon} size={56} />
|
||||||
<Text className="mt-1">{moneryRecord.category_name}</Text>
|
<Text className="mt-1">{moneyCategory?.name}</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<ACellGroup showDivider={false} className="mt-4">
|
<ACellGroup showDivider={false} className="mt-4">
|
||||||
<ACell title="类别" rightText={moneryRecord.category_type === 0 ? '支出' : '收入'} />
|
<ACell title="类别" rightText={moneyCategory?.type === MoneyCategoryEnum.Expense ? '支出' : '收入'} />
|
||||||
<ACell title="金额" rightText={moneryRecord.amount} />
|
<ACell title="金额" rightText={moneryRecord.amount} />
|
||||||
<ACell title="备注" rightText={moneryRecord.remark} />
|
<ACell title="备注" rightText={moneryRecord.remark} />
|
||||||
<ACell title="日期" rightText={toDateString(moneryRecord.record_time)} />
|
<ACell title="日期" rightText={toDateString(moneryRecord.record_time)} />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { MoneyCategoryItem } from '@/types/money/category'
|
import type { MoneyCategoryItem } from '@/types/money/category'
|
||||||
import type { MoneyRecordBase, MoneyRecordItem } from '@/types/money/record'
|
import type { MoneyRecord } from '@/types/money/record'
|
||||||
import { useLocalSearchParams, useRouter } from 'expo-router'
|
import { useLocalSearchParams, useRouter } from 'expo-router'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { Text, TouchableOpacity, View } from 'react-native'
|
import { Text, TouchableOpacity, View } from 'react-native'
|
||||||
@@ -28,21 +28,19 @@ export default function MoenyRecordEditor() {
|
|||||||
// 选中分类
|
// 选中分类
|
||||||
const [selectedCategory, setSelectedCategory] = useState<MoneyCategoryItem | null>(null)
|
const [selectedCategory, setSelectedCategory] = useState<MoneyCategoryItem | null>(null)
|
||||||
// 记账记录
|
// 记账记录
|
||||||
const defaultMoneyRecord: MoneyRecordBase = {
|
const defaultMoneyRecord: MoneyRecord = {
|
||||||
id: -1,
|
id: -1,
|
||||||
category_id: -1,
|
category_id: -1,
|
||||||
username: '',
|
username: '',
|
||||||
category_icon: '',
|
|
||||||
category_name: '',
|
|
||||||
category_type: 0,
|
|
||||||
user_id: -1,
|
user_id: -1,
|
||||||
amount: '0.00',
|
amount: '0.00',
|
||||||
remark: '',
|
remark: '',
|
||||||
record_time: getCurrentDate(),
|
record_time: getCurrentDate(),
|
||||||
create_time: '',
|
create_time: 0,
|
||||||
|
update_time: 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
const [moneyRecord, setMoneyRecord] = useState<MoneyRecordBase>(defaultMoneyRecord)
|
const [moneyRecord, setMoneyRecord] = useState<MoneyRecord>(defaultMoneyRecord)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (updateId) {
|
if (updateId) {
|
||||||
@@ -90,12 +88,9 @@ export default function MoenyRecordEditor() {
|
|||||||
record_time: moneyRecord.record_time,
|
record_time: moneyRecord.record_time,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.isSuccess) {
|
if (res.isSuccess) {
|
||||||
const result: MoneyRecordItem = {
|
const result: MoneyRecord = {
|
||||||
...moneyRecord,
|
...moneyRecord,
|
||||||
category_id: selectedCategory.id,
|
category_id: selectedCategory.id,
|
||||||
category_type: selectedCategory.type,
|
|
||||||
category_name: selectedCategory.name,
|
|
||||||
category_icon: selectedCategory.icon,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
moneyRecordStore.updateMoneyRecord(result)
|
moneyRecordStore.updateMoneyRecord(result)
|
||||||
@@ -115,12 +110,9 @@ export default function MoenyRecordEditor() {
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.isSuccess) {
|
if (res.isSuccess) {
|
||||||
const result: MoneyRecordItem = {
|
const result: MoneyRecord = {
|
||||||
...res.data,
|
...res.data,
|
||||||
category_id: selectedCategory.id,
|
category_id: selectedCategory.id,
|
||||||
category_type: selectedCategory.type,
|
|
||||||
category_name: selectedCategory.name,
|
|
||||||
category_icon: selectedCategory.icon,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
moneyRecordStore.addMoneyRecord(result)
|
moneyRecordStore.addMoneyRecord(result)
|
||||||
|
|||||||
@@ -96,7 +96,12 @@ export const useMoneyCategoryStore = create<MoneyCategoryStore>()(
|
|||||||
|
|
||||||
categories: [],
|
categories: [],
|
||||||
|
|
||||||
setCategories: categories => set({ categories }),
|
setCategories: categories =>
|
||||||
|
set({
|
||||||
|
categories: [...categories].sort(
|
||||||
|
(a, b) => (a.sort_number ?? 0) - (b.sort_number ?? 0),
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
|
||||||
init: async () => {
|
init: async () => {
|
||||||
try {
|
try {
|
||||||
@@ -120,14 +125,10 @@ export const useMoneyCategoryStore = create<MoneyCategoryStore>()(
|
|||||||
},
|
},
|
||||||
|
|
||||||
getExpenseCategories: () =>
|
getExpenseCategories: () =>
|
||||||
(get().categories || [])
|
get().categories.filter(c => c.type === MoneyCategoryEnum.Expense),
|
||||||
.filter(c => c.type === MoneyCategoryEnum.Expense)
|
|
||||||
.sort((a, b) => (a.sort_number ?? 0) - (b.sort_number ?? 0)),
|
|
||||||
|
|
||||||
getIncomeCategories: () =>
|
getIncomeCategories: () =>
|
||||||
(get().categories || [])
|
get().categories.filter(c => c.type === MoneyCategoryEnum.Income),
|
||||||
.filter(c => c.type === MoneyCategoryEnum.Income)
|
|
||||||
.sort((a, b) => (a.sort_number ?? 0) - (b.sort_number ?? 0)),
|
|
||||||
|
|
||||||
getCategoryById: (id: number) => {
|
getCategoryById: (id: number) => {
|
||||||
return get().categories.find(c => c.id === id) || null
|
return get().categories.find(c => c.id === id) || null
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import type { MoneyRecordGroup, MoneyRecordItem } from '@/types/money/record'
|
import type { MoneyRecord, MoneyRecordGroup } from '@/types/money/record'
|
||||||
import { create } from 'zustand'
|
import { create } from 'zustand'
|
||||||
import { deleteMoneyRecordApi } from '@/request/api/money/record'
|
import { deleteMoneyRecordApi } from '@/request/api/money/record'
|
||||||
import { MoneyCategoryEnum } from '@/types/money/category'
|
import { MoneyCategoryEnum } from '@/types/money/category'
|
||||||
import { add, sub } from '@/utils/math'
|
import { add, sub } from '@/utils/math'
|
||||||
import { isInMonth } from '@/utils/time'
|
import { isInMonth } from '@/utils/time'
|
||||||
|
import { useMoneyCategoryStore } from './moneyCategory'
|
||||||
|
|
||||||
interface MoneyRecordStore {
|
interface MoneyRecordStore {
|
||||||
records: MoneyRecordGroup[]
|
records: MoneyRecordGroup[]
|
||||||
@@ -14,30 +15,47 @@ interface MoneyRecordStore {
|
|||||||
getTotalExpense: () => string
|
getTotalExpense: () => string
|
||||||
getTotalBalance: () => string
|
getTotalBalance: () => string
|
||||||
|
|
||||||
setRecords: (records: MoneyRecordGroup[], month: string) => void
|
setRecords: (records: MoneyRecord[], month: string) => void
|
||||||
setCurrentMonth: (month: string) => void
|
setCurrentMonth: (month: string) => void
|
||||||
|
|
||||||
addMoneyRecord: (data: MoneyRecordItem) => void
|
addMoneyRecord: (data: MoneyRecord) => void
|
||||||
updateMoneyRecord: (updated: MoneyRecordItem) => void
|
updateMoneyRecord: (updated: MoneyRecord) => void
|
||||||
deleteMoneyRecord: (id: number) => void
|
deleteMoneyRecord: (id: number) => void
|
||||||
|
|
||||||
getMoneyRecordById: (id: number) => MoneyRecordItem | null
|
getMoneyRecordById: (id: number) => MoneyRecord | null
|
||||||
}
|
}
|
||||||
|
|
||||||
function recomputeGroups(records: MoneyRecordItem[]) {
|
function recomputeGroups(records: MoneyRecord[]) {
|
||||||
|
const { getCategoryById } = useMoneyCategoryStore.getState()
|
||||||
|
|
||||||
const groupsMap: Record<string, MoneyRecordGroup> = {}
|
const groupsMap: Record<string, MoneyRecordGroup> = {}
|
||||||
|
|
||||||
records.forEach((r) => {
|
records.forEach((r) => {
|
||||||
const group = groupsMap[r.record_time] ?? { record_time: r.record_time, records: [], income: '0.00', expense: '0.00' }
|
const category = getCategoryById(r.category_id)
|
||||||
|
if (!category)
|
||||||
|
return
|
||||||
|
|
||||||
|
const group = groupsMap[r.record_time] ?? {
|
||||||
|
record_time: r.record_time,
|
||||||
|
records: [],
|
||||||
|
income: '0.00',
|
||||||
|
expense: '0.00',
|
||||||
|
}
|
||||||
|
|
||||||
group.records.push(r)
|
group.records.push(r)
|
||||||
if (r.category_type === MoneyCategoryEnum.Expense)
|
|
||||||
|
if (category.type === MoneyCategoryEnum.Expense)
|
||||||
group.expense = add(group.expense, r.amount)
|
group.expense = add(group.expense, r.amount)
|
||||||
if (r.category_type === MoneyCategoryEnum.Income)
|
|
||||||
|
if (category.type === MoneyCategoryEnum.Income)
|
||||||
group.income = add(group.income, r.amount)
|
group.income = add(group.income, r.amount)
|
||||||
|
|
||||||
groupsMap[r.record_time] = group
|
groupsMap[r.record_time] = group
|
||||||
})
|
})
|
||||||
|
|
||||||
return Object.values(groupsMap).sort((a, b) => b.record_time.localeCompare(a.record_time))
|
return Object.values(groupsMap).sort((a, b) =>
|
||||||
|
b.record_time.localeCompare(a.record_time),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useMoneyRecordStore = create<MoneyRecordStore>((set, get) => ({
|
export const useMoneyRecordStore = create<MoneyRecordStore>((set, get) => ({
|
||||||
@@ -59,8 +77,10 @@ export const useMoneyRecordStore = create<MoneyRecordStore>((set, get) => ({
|
|||||||
|
|
||||||
/* ---------------- base ---------------- */
|
/* ---------------- base ---------------- */
|
||||||
setRecords: (records, month) => {
|
setRecords: (records, month) => {
|
||||||
const flatRecords = records.flatMap(g => g.records)
|
const filtered = records.filter(r =>
|
||||||
const newGroups = recomputeGroups(flatRecords)
|
isInMonth(r.record_time, month),
|
||||||
|
)
|
||||||
|
const newGroups = recomputeGroups(filtered)
|
||||||
set({ records: newGroups, currentMonth: month })
|
set({ records: newGroups, currentMonth: month })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
// types/money/record.ts
|
// types/money/record.ts
|
||||||
|
|
||||||
// 基础记录
|
// 基础记录
|
||||||
export interface MoneyRecordBase {
|
export interface MoneyRecord {
|
||||||
id: number
|
id: number
|
||||||
category_id: number
|
|
||||||
category_type: number
|
|
||||||
category_name: string
|
|
||||||
category_icon: string
|
|
||||||
user_id: number
|
user_id: number
|
||||||
username: string
|
username: string
|
||||||
|
category_id: number
|
||||||
amount: string
|
amount: string
|
||||||
remark: string
|
remark: string
|
||||||
record_time: string
|
record_time: string
|
||||||
create_time: string
|
create_time: number
|
||||||
update_time?: string
|
update_time: number
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询条件(请求参数)
|
// 查询条件(请求参数)
|
||||||
@@ -21,24 +18,16 @@ export interface QueryMoneyRecordsParams {
|
|||||||
record_time: string
|
record_time: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询结果的记录
|
|
||||||
export interface MoneyRecordItem extends MoneyRecordBase {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分组 & 查询结果
|
// 分组 & 查询结果
|
||||||
export interface MoneyRecordGroup {
|
export interface MoneyRecordGroup {
|
||||||
record_time: string
|
record_time: string
|
||||||
expense: string
|
expense: string
|
||||||
income: string
|
income: string
|
||||||
records: MoneyRecordItem[]
|
records: MoneyRecord[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface QueryMoneyRecordsResult {
|
export interface QueryMoneyRecordsResult {
|
||||||
records: MoneyRecordGroup[]
|
records: MoneyRecord[]
|
||||||
total_income: string
|
|
||||||
total_expense: string
|
|
||||||
total_balance: string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增请求参数
|
// 新增请求参数
|
||||||
@@ -49,7 +38,7 @@ export interface InsertMoneyRecordParams {
|
|||||||
record_time: string
|
record_time: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InsertMoneyRecordResult extends MoneyRecordBase {}
|
export interface InsertMoneyRecordResult extends MoneyRecord {}
|
||||||
|
|
||||||
// 更新
|
// 更新
|
||||||
export interface UpdateMoneyRecordParams {
|
export interface UpdateMoneyRecordParams {
|
||||||
|
|||||||
Reference in new issue
Block a user