Skip to content

Commit

Permalink
chore(sys): rename entry.ts -> proxy.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Oct 13, 2021
1 parent ecc0466 commit 5a35278
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/system-server/src/router/dbm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import * as express from 'express'
import { handleDbProxy } from './entry'
import { handleDbProxy } from './proxy'
import { handleCollectionList } from './collections'
import { handleGetIndexesOfCollection } from './get-indexes'
import { handleCreateIndex } from './add-index'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-08-30 16:26:26
* @LastEditTime: 2021-10-07 22:00:34
* @LastEditTime: 2021-10-13 15:17:27
* @Description:
*/

Expand All @@ -13,7 +13,7 @@ import { Request, Response } from 'express'


/**
* The less-api proxy entry for database management
* The db proxy entry for database management
*/
export async function handleDbProxy(req: Request, res: Response) {
const uid = req['auth']?.uid
Expand All @@ -28,14 +28,14 @@ export async function handleDbProxy(req: Request, res: Response) {
const accessor = await getApplicationDbAccessor(app)

// don't need policy rules, open all collections' access permission for dbm use
const entry = new Proxy(accessor, new Policy(accessor))
const proxy = new Proxy(accessor, new Policy(accessor))

// parse params
const params = entry.parseParams(req.body)
const params = proxy.parseParams(req.body)

// execute query
try {
const data = await entry.execute(params)
const data = await proxy.execute(params)

return res.send({
code: 0,
Expand Down

0 comments on commit 5a35278

Please sign in to comment.