()
| 149 | * 获取账户 Store 的接口实现 |
| 150 | */ |
| 151 | export function getAccountStoreInterface(): IAccountStore { |
| 152 | const store = useAccountStore |
| 153 | return { |
| 154 | get initialized() { |
| 155 | return store.getState().initialized |
| 156 | }, |
| 157 | get accounts() { |
| 158 | return store.getState().accounts |
| 159 | }, |
| 160 | get currentAccountId() { |
| 161 | return store.getState().currentAccountId |
| 162 | }, |
| 163 | init: () => store.getState().init(), |
| 164 | reset: () => store.getState().reset(), |
| 165 | getById: (id) => store.getState().getById(id), |
| 166 | getAll: () => store.getState().getAll(), |
| 167 | create: (data) => store.getState().create(data), |
| 168 | createMany: (data) => store.getState().createMany(data), |
| 169 | update: (id, changes) => store.getState().update(id, changes), |
| 170 | updateMany: (updates) => store.getState().updateMany(updates), |
| 171 | delete: (id) => store.getState().delete(id), |
| 172 | deleteMany: (ids) => store.getState().deleteMany(ids), |
| 173 | setCurrentAccountId: (id) => store.getState().setCurrentAccountId(id), |
| 174 | setInitialized: (initialized) => store.getState().setInitialized(initialized) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | export function getDefaultAccountId(): string { |
| 179 | return DEFAULT_ACCOUNT_ID |
no test coverage detected