-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 改动 1. 操作日志增加自定义操作类型 proto传参类型: ```proto message I18nObject { message I18n { string default = 1; optional string en = 2; optional string zh_cn = 3; } I18n i18n = 1; } message CustomEvent { string type = 1; common.I18nObject name = 2; common.I18nObject content = 3; } ``` 展示时,会根据页面国际化直接展示国际化内容 ![image](https://github.com/PKUHPC/SCOW/assets/130351655/bf352acb-7c14-4dd8-8296-abd87e7c6204) ![image](https://github.com/PKUHPC/SCOW/assets/130351655/711c51ff-2148-45a3-980b-30fc3b4facbf) 2. 新增一个接口,获取自定义类型里的type类型 ![image](https://github.com/PKUHPC/SCOW/assets/130351655/4271048d-ceef-4e20-badc-bae1b8ec199c) ps: 新增一个type时,需要校验数据库内是否有已有的type,如果存在的话, 需要name一致。
- Loading branch information
1 parent
25f9caf
commit 24db413
Showing
27 changed files
with
584 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
"@scow/lib-operation-log": patch | ||
"@scow/audit-server": patch | ||
"@scow/portal-web": patch | ||
"@scow/mis-web": patch | ||
"@scow/ai": patch | ||
--- | ||
|
||
操作日志增加自定义操作类型 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/grpc-api": patch | ||
--- | ||
|
||
增加 GetCustomEventTypes 接口获取自定义操作类型,增加 CustomEvent 保存自定义操作类型 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/audit-server/src/migrations/Migration20240313015230.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Migration } from '@mikro-orm/migrations'; | ||
|
||
export class Migration20240313015230 extends Migration { | ||
|
||
async up(): Promise<void> { | ||
this.addSql('alter table `operation_log` add `custom_event_type` varchar(255) null;'); | ||
this.addSql('alter table `operation_log` modify `operation_time` DATETIME(6) not null default current_timestamp(6), modify `operation_result` enum(\'UNKNOWN\', \'SUCCESS\', \'FAIL\') not null comment \'UNKNOWN, SUCCESS, FAIL\';'); | ||
this.addSql('alter table `operation_log` add index `custom_event`(`custom_event_type`);'); | ||
} | ||
|
||
async down(): Promise<void> { | ||
this.addSql('alter table `operation_log` drop index `custom_event`;'); | ||
this.addSql('alter table `operation_log` drop column `custom_event_type`;'); | ||
|
||
this.addSql('alter table `operation_log` modify `operation_time` DATETIME(6) not null default current_timestamp(0), modify `operation_result` enum(\'UNKNOWN\', \'SUCCESS\', \'FAIL\') not null comment \'UNKNOWN, SUCCESS, FAIL\';'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.