From b7505c52f4bfdc311a7fc5541f1ba5bc1e345b69 Mon Sep 17 00:00:00 2001 From: Xc Date: Sun, 27 Oct 2024 12:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E6=AE=8B=E7=95=99?= =?UTF-8?q?=E7=9A=84=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/src/aspects/index.ts | 3 +- template/src/aspects/sample.ts | 6 --- template/src/checkers/store.ts | 33 ------------ template/src/entities/Store.ts | 95 ---------------------------------- 4 files changed, 1 insertion(+), 136 deletions(-) delete mode 100644 template/src/aspects/sample.ts delete mode 100644 template/src/checkers/store.ts delete mode 100644 template/src/entities/Store.ts diff --git a/template/src/aspects/index.ts b/template/src/aspects/index.ts index 39a4682..982e1ec 100644 --- a/template/src/aspects/index.ts +++ b/template/src/aspects/index.ts @@ -1,8 +1,7 @@ import { AspectDict } from './AspectDict'; -import { test } from './sample'; + const aspectDict = { - test, } as AspectDict; export default aspectDict; diff --git a/template/src/aspects/sample.ts b/template/src/aspects/sample.ts deleted file mode 100644 index d4f1cd2..0000000 --- a/template/src/aspects/sample.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { EntityDict } from '@oak-app-domain'; -import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; - -export async function test(params: string, context: BackendRuntimeContext) { - return 'hello world'; -} diff --git a/template/src/checkers/store.ts b/template/src/checkers/store.ts deleted file mode 100644 index 1460666..0000000 --- a/template/src/checkers/store.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { EntityDict } from '@oak-app-domain'; -import { Checker } from 'oak-domain/lib/types'; -import { RuntimeCxt } from '../types/RuntimeCxt'; -import { checkAttributesNotNull } from 'oak-domain/lib/utils/validator'; -import { CreateOperationData as CreateStoreData } from '@oak-app-domain/Store/Schema'; - -export const checkers: Checker[] = [ - { - type: 'data', - action: 'create', - entity: 'store', - checker: (data, context) => { - if (data instanceof Array) { - data.forEach((ele) => { - checkAttributesNotNull('store', data, [ - 'coordinate', - 'name', - 'addrDetail', - 'areaId', - ]); - }); - } else { - checkAttributesNotNull('store', data, [ - 'coordinate', - 'name', - 'addrDetail', - 'areaId', - ]); - } - return 0; - }, - }, -]; diff --git a/template/src/entities/Store.ts b/template/src/entities/Store.ts deleted file mode 100644 index 978ca1f..0000000 --- a/template/src/entities/Store.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { - String, - Int, - Text, - Float, - SingleGeo, -} from 'oak-domain/lib/types/DataType'; -import { ActionDef, EntityDesc } from 'oak-domain/lib/types'; -// import { Schema as Area } from 'oak-general-business/lib/entities/Area'; -// import { Schema as ExtraFile } from 'oak-general-business/lib/entities/ExtraFile'; -import { EntityShape } from 'oak-domain/lib/types/Entity'; - -export interface Schema extends EntityShape { - coordinate: SingleGeo; //坐标 - // area: Area; //地区 - name: String<32>; //名称 - addrDetail: String<32>; //地址详情 - // files: Array; //封面图 -} - -type IAction = 'online' | 'offline' | 'disable'; -type IState = 'online' | 'offline' | 'disabled'; - -const IActionDef: ActionDef = { - stm: { - online: ['offline', 'online'], - offline: ['online', 'offline'], - disable: [['online', 'offline'], 'disabled'], - }, - is: 'offline', -}; - -type Action = IAction; - -const entityDesc: EntityDesc< - Schema, - Action, - '', - { - iState: IState; - } -> = { - indexes: [ - { - name: 'index_name', - attributes: [ - { - name: 'name', - }, - ], - config: { - unique: true, - }, - }, - ], - locales: { - zh_CN: { - name: '门店', - attr: { - coordinate: '位置', - // area: '地区', - name: '名称', - addrDetail: '地址详情', - // files: '照片', - iState: '状态', - }, - action: { - online: '上线', - offline: '下线', - disable: '禁用', - }, - v: { - iState: { - online: '已上线', - offline: '已下线', - disabled: '已禁用', - }, - }, - }, - }, - style: { - icon: { - offline: '', - online: '', - disable: '' - }, - color: { - iState: { - offline: '#FFFFFF', - online: '#FF0000', - disabled: '#00FF00', - } - } - } -};