Skip to content

Commit 5058a4a

Browse files
committed
格式化代码
1 parent 028c30a commit 5058a4a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/services/MysqlCache.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,48 +15,48 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
1515

1616
async insert(data: CoaMysql.SafePartial<Scheme>, trx?: CoaMysql.Transaction) {
1717
const id = await super.insert(data, trx);
18-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, [id], [data]) : await this.deleteCache([id], [data])
18+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, [id], [data]) : await this.deleteCache([id], [data])
1919
return id
2020
}
2121

2222
async mInsert(dataList: Array<CoaMysql.SafePartial<Scheme>>, trx?: CoaMysql.Transaction) {
2323
const ids = await super.mInsert(dataList, trx);
24-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
24+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
2525
return ids
2626
}
2727

2828
async updateById(id: string, data: CoaMysql.SafePartial<Scheme>, trx?: CoaMysql.Transaction) {
2929
const dataList = await this.getCacheChangedDataList([id], data, trx)
3030
const result = await super.updateById(id, data, trx);
31-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
31+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
3232
return result
3333
}
3434

3535
async updateByIds(ids: string[], data: CoaMysql.SafePartial<Scheme>, trx?: CoaMysql.Transaction) {
3636
const dataList = await this.getCacheChangedDataList(ids, data, trx)
3737
const result = await super.updateByIds(ids, data, trx);
38-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
38+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
3939
return result
4040
}
4141

4242
async updateForQueryById(id: string, query: CoaMysql.Query, data: CoaMysql.SafePartial<Scheme>, trx?: CoaMysql.Transaction) {
4343
const dataList = await this.getCacheChangedDataList([id], data, trx)
4444
const result = await super.updateForQueryById(id, query, data, trx);
45-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
45+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
4646
return result
4747
}
4848

4949
async upsertById(id: string, data: CoaMysql.SafePartial<Scheme>, trx?: CoaMysql.Transaction) {
5050
const dataList = await this.getCacheChangedDataList([id], data, trx)
5151
const result = await super.upsertById(id, data, trx);
52-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
52+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, [id], dataList) : await this.deleteCache([id], dataList)
5353
return result
5454
}
5555

5656
async deleteByIds(ids: string[], trx?: CoaMysql.Transaction) {
5757
const dataList = await this.getCacheChangedDataList(ids, undefined, trx)
5858
const result = await super.deleteByIds(ids, trx);
59-
trx && (trx as any).trxUpdateCacheTaskList ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
59+
(trx && (trx as any).trxUpdateCacheTaskList) ? await (trx as any).trxUpdateCacheTaskList(this, ids, dataList) : await this.deleteCache(ids, dataList)
6060
return result
6161
}
6262

0 commit comments

Comments
 (0)