├── ui
├── src
│ ├── assets
│ │ ├── .gitkeep
│ │ ├── fonts
│ │ │ ├── dm-mono.woff2
│ │ │ └── inter.woff2
│ │ └── img
│ │ │ ├── sider
│ │ │ └── sider-1.jpg
│ │ │ └── logo
│ │ │ ├── aliyun-logo.png
│ │ │ ├── baidu-logo.png
│ │ │ ├── google-logo.png
│ │ │ ├── logo-16x16.png
│ │ │ ├── logo-32x32.png
│ │ │ ├── logo-48x48.png
│ │ │ ├── logo-72x72.png
│ │ │ ├── logo-96x96.png
│ │ │ ├── logo-128x128.png
│ │ │ ├── logo-144x144.png
│ │ │ ├── logo-152x152.png
│ │ │ ├── logo-194x194.png
│ │ │ ├── logo-384x384.png
│ │ │ └── logo-512x512.png
│ ├── app
│ │ ├── core
│ │ │ ├── components
│ │ │ │ ├── editor
│ │ │ │ │ ├── editor.component.html
│ │ │ │ │ └── editor.component.scss
│ │ │ │ ├── json-schema
│ │ │ │ │ ├── json-dialog
│ │ │ │ │ │ └── json-dialog.component.scss
│ │ │ │ │ ├── operation
│ │ │ │ │ │ ├── operation.component.html
│ │ │ │ │ │ └── operation.component.scss
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── worker
│ │ │ │ │ │ ├── json-schema.worker.ts
│ │ │ │ │ │ └── tree-data.worker.ts
│ │ │ │ │ ├── setting
│ │ │ │ │ │ ├── array
│ │ │ │ │ │ │ └── array.component.scss
│ │ │ │ │ │ ├── object
│ │ │ │ │ │ │ └── object.component.scss
│ │ │ │ │ │ └── boolean
│ │ │ │ │ │ │ ├── boolean.component.html
│ │ │ │ │ │ │ └── boolean.component.scss
│ │ │ │ │ └── json-schema.component.scss
│ │ │ │ ├── index.ts
│ │ │ │ └── ai-dialog
│ │ │ │ │ ├── ai-dialog.component.html
│ │ │ │ │ └── ai-dialog.component.scss
│ │ │ ├── directives
│ │ │ │ └── index.ts
│ │ │ ├── pipes
│ │ │ │ ├── index.ts
│ │ │ │ ├── zero-prefix.pipe.ts
│ │ │ │ └── base64-to-string.pipe.ts
│ │ │ ├── common
│ │ │ │ ├── index.ts
│ │ │ │ ├── base.model.ts
│ │ │ │ └── base.output.ts
│ │ │ ├── functions
│ │ │ │ ├── index.ts
│ │ │ │ ├── parse-gitignore.ts
│ │ │ │ └── file-reader.ts
│ │ │ ├── index.ts
│ │ │ └── services
│ │ │ │ ├── index.ts
│ │ │ │ ├── auth-guard.ts
│ │ │ │ └── icon.service.ts
│ │ ├── api
│ │ │ ├── openai
│ │ │ │ └── index.ts
│ │ │ ├── cache
│ │ │ │ ├── cache-keys.input.ts
│ │ │ │ ├── cache-group.model.ts
│ │ │ │ ├── cache.model.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── cache.enum.ts
│ │ │ ├── user
│ │ │ │ ├── reset-password.input.ts
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── user.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── user.enum.ts
│ │ │ │ ├── user.model.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ └── index.ts
│ │ │ ├── auth
│ │ │ │ ├── refresh-token.input.ts
│ │ │ │ ├── auth.model.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── login.input.ts
│ │ │ │ ├── verify-token.input.ts
│ │ │ │ └── verify-token.output.ts
│ │ │ ├── role
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── role-permissions.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── role.output.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── role.enum.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── role.model.ts
│ │ │ ├── model
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── model.output.ts
│ │ │ │ ├── model.model.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── model.enum.ts
│ │ │ │ └── index.ts
│ │ │ ├── logs
│ │ │ │ ├── logs-file.model.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── logs.output.ts
│ │ │ │ └── logs.enum.ts
│ │ │ ├── prompt
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── prompt.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── prompt.model.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── prompt.enum.ts
│ │ │ │ ├── where.ts
│ │ │ │ └── index.ts
│ │ │ ├── schema
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── schema.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── schema.model.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── schema.enum.ts
│ │ │ ├── subject
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── subject.model.ts
│ │ │ │ ├── subject.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── subject.enum.ts
│ │ │ │ └── index.ts
│ │ │ ├── language
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── language.model.ts
│ │ │ │ ├── language.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── language.enum.ts
│ │ │ ├── resource
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── resource.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── include.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── resource.enum.ts
│ │ │ ├── variable
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── save-many.input.ts
│ │ │ │ ├── variable-type.input.ts
│ │ │ │ ├── variable.output.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── variable.enum.ts
│ │ │ │ └── index.ts
│ │ │ ├── catalogue
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── catalogue.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ └── index.ts
│ │ │ ├── dictionary
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── dictionary.output.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── dictionary.model.ts
│ │ │ │ ├── where.ts
│ │ │ │ └── index.ts
│ │ │ ├── permission
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── save-many.input.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── permission.output.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── permission.model.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ └── index.ts
│ │ │ ├── schema-data
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── schema-data.output.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── schema-data.model.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── where.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── schema-data.enum.ts
│ │ │ ├── variable-category
│ │ │ │ ├── select.output.ts
│ │ │ │ ├── update.input.ts
│ │ │ │ ├── create.input.ts
│ │ │ │ ├── order.ts
│ │ │ │ ├── variable-category.output.ts
│ │ │ │ ├── select.input.ts
│ │ │ │ ├── pagination.input.ts
│ │ │ │ ├── variable-category.enum.ts
│ │ │ │ ├── variable-category.model.ts
│ │ │ │ ├── index.ts
│ │ │ │ └── where.ts
│ │ │ └── index.ts
│ │ ├── app.component.html
│ │ ├── pages
│ │ │ ├── overview
│ │ │ │ ├── overview.component.html
│ │ │ │ ├── overview-routing.module.ts
│ │ │ │ └── overview.component.ts
│ │ │ ├── json
│ │ │ │ ├── json.component.scss
│ │ │ │ ├── json-routing.module.ts
│ │ │ │ ├── json.component.html
│ │ │ │ └── json.component.ts
│ │ │ ├── prompt
│ │ │ │ ├── prompt-detail
│ │ │ │ │ └── prompt-detail.component.scss
│ │ │ │ ├── prompt-routing.module.ts
│ │ │ │ └── prompt.resover.ts
│ │ │ ├── schema-data
│ │ │ │ ├── schema-data-detail
│ │ │ │ │ └── schema-data-detail.component.scss
│ │ │ │ ├── schema-data-routing.module.ts
│ │ │ │ └── schema-data.resover.ts
│ │ │ ├── aigc
│ │ │ │ └── aigc-routing.module.ts
│ │ │ ├── cache
│ │ │ │ ├── cache.component.scss
│ │ │ │ ├── cache-routing.module.ts
│ │ │ │ └── cache-group
│ │ │ │ │ └── cache-group.component.scss
│ │ │ ├── user
│ │ │ │ ├── user.component.scss
│ │ │ │ ├── user-routing.module.ts
│ │ │ │ └── user.resover.ts
│ │ │ ├── code-generate
│ │ │ │ ├── catalogue
│ │ │ │ │ └── catalogue.component.scss
│ │ │ │ └── code-generate-routing.module.ts
│ │ │ ├── login
│ │ │ │ └── login-routing.module.ts
│ │ │ ├── schema
│ │ │ │ ├── schema-detail
│ │ │ │ │ └── schema-detail.component.scss
│ │ │ │ ├── schema-routing.module.ts
│ │ │ │ └── schema.resover.ts
│ │ │ ├── role
│ │ │ │ ├── role-routing.module.ts
│ │ │ │ ├── role-permission
│ │ │ │ │ └── role-permission.component.scss
│ │ │ │ └── role.resover.ts
│ │ │ ├── model
│ │ │ │ ├── model-routing.module.ts
│ │ │ │ └── model.resover.ts
│ │ │ └── subject
│ │ │ │ ├── subject-routing.module.ts
│ │ │ │ └── subject.resover.ts
│ │ ├── layout
│ │ │ └── index
│ │ │ │ ├── content
│ │ │ │ ├── content.component.html
│ │ │ │ ├── content.component.scss
│ │ │ │ └── content.component.ts
│ │ │ │ ├── index.component.scss
│ │ │ │ ├── index.component.html
│ │ │ │ ├── index-routing.module.ts
│ │ │ │ ├── aside
│ │ │ │ ├── aside.component.html
│ │ │ │ └── aside.component.ts
│ │ │ │ └── index.component.ts
│ │ ├── app.worker.ts
│ │ ├── app.component.ts
│ │ ├── app.config.server.ts
│ │ ├── graphql.config.ts
│ │ └── ng-nest.config.ts
│ ├── favicon.ico
│ ├── main.server.ts
│ ├── main.ts
│ └── index.html
├── .vscode
│ └── settings.json
├── .prettierrc.json
├── tsconfig.spec.json
├── tsconfig.app.json
├── tsconfig.worker.json
└── proxy.config.json
├── api
├── src
│ ├── generated
│ │ └── index.ts
│ ├── modules
│ │ ├── aigc
│ │ │ ├── index.ts
│ │ │ ├── aigc.controller.ts
│ │ │ └── aigc.module.ts
│ │ ├── auth
│ │ │ ├── index.ts
│ │ │ └── auth.resolver.ts
│ │ ├── cache
│ │ │ └── index.ts
│ │ ├── file
│ │ │ ├── index.ts
│ │ │ └── file.module.ts
│ │ ├── logs
│ │ │ ├── index.ts
│ │ │ ├── logs.module.ts
│ │ │ └── logs.resolver.ts
│ │ ├── model
│ │ │ ├── index.ts
│ │ │ └── model.module.ts
│ │ ├── openai
│ │ │ ├── index.ts
│ │ │ └── openai.module.ts
│ │ ├── prompt
│ │ │ ├── index.ts
│ │ │ └── prompt.module.ts
│ │ ├── role
│ │ │ ├── index.ts
│ │ │ └── role.module.ts
│ │ ├── schema
│ │ │ ├── index.ts
│ │ │ └── schema.module.ts
│ │ ├── upload
│ │ │ ├── index.ts
│ │ │ ├── upload.controller.ts
│ │ │ └── upload.module.ts
│ │ ├── user
│ │ │ ├── index.ts
│ │ │ └── user.module.ts
│ │ ├── language
│ │ │ ├── index.ts
│ │ │ └── language.module.ts
│ │ ├── resource
│ │ │ ├── index.ts
│ │ │ └── resource.module.ts
│ │ ├── subject
│ │ │ ├── index.ts
│ │ │ └── subject.module.ts
│ │ ├── variable
│ │ │ ├── index.ts
│ │ │ └── variable.module.ts
│ │ ├── catalogue
│ │ │ ├── index.ts
│ │ │ └── catalogue.module.ts
│ │ ├── dictionary
│ │ │ ├── index.ts
│ │ │ └── dictionary.module.ts
│ │ ├── permission
│ │ │ ├── index.ts
│ │ │ └── permission.module.ts
│ │ ├── schema-data
│ │ │ ├── index.ts
│ │ │ └── schema-data.module.ts
│ │ └── variable-category
│ │ │ ├── index.ts
│ │ │ └── variable-category.module.ts
│ ├── core
│ │ ├── filters
│ │ │ └── index.ts
│ │ ├── adapters
│ │ │ └── index.ts
│ │ ├── middlewares
│ │ │ ├── index.ts
│ │ │ └── gql-date.middleware.ts
│ │ ├── config
│ │ │ └── index.ts
│ │ ├── functions
│ │ │ └── index.ts
│ │ ├── interceptor
│ │ │ └── index.ts
│ │ ├── common
│ │ │ ├── index.ts
│ │ │ ├── base.output.ts
│ │ │ └── base.model.ts
│ │ ├── decorators
│ │ │ ├── file.decorator.ts
│ │ │ ├── files.decorator.ts
│ │ │ ├── current-user.decorator.ts
│ │ │ ├── gql-current-user.decorator.ts
│ │ │ ├── cache.decorator.ts
│ │ │ ├── index.ts
│ │ │ └── prisma-select.decorator.ts
│ │ ├── services
│ │ │ ├── index.ts
│ │ │ └── encrypt.service.ts
│ │ └── index.ts
│ ├── services
│ │ ├── openai
│ │ │ ├── openai.enum.ts
│ │ │ └── index.ts
│ │ ├── file
│ │ │ ├── index.ts
│ │ │ └── file.service.ts
│ │ ├── aigc
│ │ │ ├── aigc-stream.output.ts
│ │ │ ├── dashscope
│ │ │ │ ├── qwen.input.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── qwen-stream.input.ts
│ │ │ │ ├── qwen.constants.ts
│ │ │ │ └── qwen.enum.ts
│ │ │ ├── gemini
│ │ │ │ ├── gemini.input.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── gemini.constants.ts
│ │ │ │ ├── gemini.enum.ts
│ │ │ │ └── gemini-stream.input.ts
│ │ │ ├── qianfan
│ │ │ │ ├── qianfan.input.ts
│ │ │ │ ├── qianfan.constants.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── qianfan-stream.input.ts
│ │ │ │ └── qianfan.enum.ts
│ │ │ ├── aigc.output.ts
│ │ │ ├── aigc.constants.ts
│ │ │ ├── index.ts
│ │ │ └── aigc.enum.ts
│ │ ├── logs
│ │ │ ├── index.ts
│ │ │ └── logs-file.model.ts
│ │ ├── upload
│ │ │ ├── index.ts
│ │ │ ├── upload.model.ts
│ │ │ └── upload.enum.ts
│ │ ├── role
│ │ │ ├── select.output.ts
│ │ │ ├── permission.output.ts
│ │ │ ├── role.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ ├── index.ts
│ │ │ └── order.ts
│ │ ├── user
│ │ │ ├── select.output.ts
│ │ │ ├── user.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ ├── index.ts
│ │ │ └── reset-password.input.ts
│ │ ├── auth
│ │ │ ├── auth-payload.ts
│ │ │ ├── verify-token.output.ts
│ │ │ ├── auth.constants.ts
│ │ │ ├── auth.metadata.ts
│ │ │ ├── auth.model.ts
│ │ │ └── index.ts
│ │ ├── model
│ │ │ ├── select.output.ts
│ │ │ ├── model.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── prompt
│ │ │ ├── select.output.ts
│ │ │ ├── prompt.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── schema
│ │ │ ├── select.output.ts
│ │ │ ├── schema.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── subject
│ │ │ ├── select.output.ts
│ │ │ ├── subject.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── language
│ │ │ ├── select.output.ts
│ │ │ ├── language.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── catalogue
│ │ │ ├── select.output.ts
│ │ │ ├── catalogue.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── dictionary
│ │ │ ├── select.output.ts
│ │ │ ├── dictionary.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ ├── permission
│ │ │ ├── select.output.ts
│ │ │ ├── permission.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ ├── save-many.input.ts
│ │ │ └── index.ts
│ │ ├── cache
│ │ │ ├── index.ts
│ │ │ ├── cache-keys.input.ts
│ │ │ ├── cache-group.model.ts
│ │ │ └── cache.model.ts
│ │ ├── resource
│ │ │ ├── resource.output.ts
│ │ │ ├── pagination.input.ts
│ │ │ ├── index.ts
│ │ │ └── select.input.ts
│ │ ├── variable
│ │ │ ├── variable.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ ├── index.ts
│ │ │ ├── save-many.input.ts
│ │ │ └── variable-type.input.ts
│ │ ├── schema-data
│ │ │ ├── schema-data.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ │ └── variable-category
│ │ │ ├── variable-category.output.ts
│ │ │ ├── select.input.ts
│ │ │ ├── pagination.input.ts
│ │ │ └── index.ts
│ └── i18n
│ │ ├── zh-cn
│ │ ├── upload.json
│ │ ├── cache.json
│ │ ├── role.json
│ │ ├── schema-data.json
│ │ ├── model.json
│ │ ├── subject.json
│ │ ├── prompt.json
│ │ ├── aigc.json
│ │ ├── variable-category.json
│ │ ├── language.json
│ │ ├── schema.json
│ │ ├── variable.json
│ │ ├── dictionary.json
│ │ ├── user.json
│ │ ├── permission.json
│ │ ├── catalogue.json
│ │ ├── file.json
│ │ └── resource.json
│ │ └── en-us
│ │ ├── cache.json
│ │ ├── upload.json
│ │ ├── role.json
│ │ ├── schema-data.json
│ │ ├── subject.json
│ │ ├── model.json
│ │ ├── prompt.json
│ │ ├── schema.json
│ │ ├── variable-category.json
│ │ ├── aigc.json
│ │ ├── language.json
│ │ ├── variable.json
│ │ ├── dictionary.json
│ │ ├── user.json
│ │ ├── permission.json
│ │ ├── catalogue.json
│ │ ├── resource.json
│ │ └── file.json
├── .prettierrc
├── tsconfig.build.json
├── .vscode
│ └── settings.json
├── prisma
│ ├── migrations
│ │ ├── 20250620131148_update_resource
│ │ │ └── migration.sql
│ │ ├── 20250428120918_update_catalogue
│ │ │ └── migration.sql
│ │ ├── 20250525040435_update_catalogue
│ │ │ └── migration.sql
│ │ ├── 20250608050556_catalogue_add_file_type_enum
│ │ │ └── migration.sql
│ │ ├── 20250702143609_update_schema_data
│ │ │ └── migration.sql
│ │ ├── 20250831120306_update_prompt
│ │ │ └── migration.sql
│ │ ├── migration_lock.toml
│ │ ├── 20250611133443_update_resource
│ │ │ └── migration.sql
│ │ ├── 20250608042330_catalogue_add_file_type
│ │ │ └── migration.sql
│ │ ├── 20250702125741_update_variable
│ │ │ └── migration.sql
│ │ ├── 20250908121731_update_prompt
│ │ │ └── migration.sql
│ │ ├── 20250608055148_catalogue_update_file_type
│ │ │ └── migration.sql
│ │ ├── 20250420035010_update_catalogue
│ │ │ └── migration.sql
│ │ ├── 20250617133650_variable_category_add_time
│ │ │ └── migration.sql
│ │ ├── 20250626130650_update_resource
│ │ │ └── migration.sql
│ │ └── 20250623135501_update_schema
│ │ │ └── migration.sql
│ └── models
│ │ ├── model.prisma
│ │ └── prompt.prisma
├── test
│ └── jest-e2e.json
├── prisma.config.ts
└── nest-cli.json
├── .prettierrc.json
├── .gitignore
├── .vscode
└── settings.json
├── .editorconfig
└── README.md
/ui/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/editor/editor.component.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/api/src/generated/index.ts:
--------------------------------------------------------------------------------
1 | export * from './i18n.generated';
2 |
--------------------------------------------------------------------------------
/api/src/modules/aigc/index.ts:
--------------------------------------------------------------------------------
1 | export * from './aigc.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/auth/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/cache/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cache.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/file/index.ts:
--------------------------------------------------------------------------------
1 | export * from './file.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/logs/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logs.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/model/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./model.module";
2 |
--------------------------------------------------------------------------------
/api/src/modules/openai/index.ts:
--------------------------------------------------------------------------------
1 | export * from './openai.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/prompt/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./prompt.module";
2 |
--------------------------------------------------------------------------------
/api/src/modules/role/index.ts:
--------------------------------------------------------------------------------
1 | export * from './role.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/schema/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/upload/index.ts:
--------------------------------------------------------------------------------
1 | export * from './upload.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/user/index.ts:
--------------------------------------------------------------------------------
1 | export * from './user.module';
2 |
--------------------------------------------------------------------------------
/ui/src/app/api/openai/index.ts:
--------------------------------------------------------------------------------
1 | export * from './openai.service';
2 |
--------------------------------------------------------------------------------
/ui/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ui/src/app/pages/overview/overview.component.html:
--------------------------------------------------------------------------------
1 |
home
2 |
--------------------------------------------------------------------------------
/api/src/core/filters/index.ts:
--------------------------------------------------------------------------------
1 | export * from './all-exception.filter';
2 |
--------------------------------------------------------------------------------
/api/src/modules/language/index.ts:
--------------------------------------------------------------------------------
1 | export * from './language.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/resource/index.ts:
--------------------------------------------------------------------------------
1 | export * from './resource.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/subject/index.ts:
--------------------------------------------------------------------------------
1 | export * from './subject.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/variable/index.ts:
--------------------------------------------------------------------------------
1 | export * from './variable.module';
2 |
--------------------------------------------------------------------------------
/ui/src/app/core/directives/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.directive';
2 |
--------------------------------------------------------------------------------
/api/src/modules/catalogue/index.ts:
--------------------------------------------------------------------------------
1 | export * from './catalogue.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/dictionary/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dictionary.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/permission/index.ts:
--------------------------------------------------------------------------------
1 | export * from './permission.module';
2 |
--------------------------------------------------------------------------------
/api/src/modules/schema-data/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema-data.module';
2 |
--------------------------------------------------------------------------------
/ui/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "commentTranslate.targetLanguage": "zh-CN"
3 | }
--------------------------------------------------------------------------------
/ui/src/app/pages/json/json.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | }
4 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/json-dialog/json-dialog.component.scss:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/ui/src/app/pages/prompt/prompt-detail/prompt-detail.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | }
3 |
--------------------------------------------------------------------------------
/api/src/modules/variable-category/index.ts:
--------------------------------------------------------------------------------
1 | export * from './variable-category.module';
2 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/content/content.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/ui/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/favicon.ico
--------------------------------------------------------------------------------
/ui/src/app/api/cache/cache-keys.input.ts:
--------------------------------------------------------------------------------
1 | export class CacheKeysInput {
2 | key?: string;
3 | }
4 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema-data/schema-data-detail/schema-data-detail.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | }
3 |
--------------------------------------------------------------------------------
/api/src/services/openai/openai.enum.ts:
--------------------------------------------------------------------------------
1 | export enum OpenAiAuth {
2 | TestSse = 'openai-test-sse',
3 | }
4 |
--------------------------------------------------------------------------------
/api/src/core/adapters/index.ts:
--------------------------------------------------------------------------------
1 | export * from './websocket.adapter';
2 | export * from './redis-io.adapter';
3 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/upload.json:
--------------------------------------------------------------------------------
1 | {
2 | "FilepathIsNotEmpty": "文件路径不能为空",
3 | "UidIsUUID": "uid 格式错误"
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/reset-password.input.ts:
--------------------------------------------------------------------------------
1 | export class ResetPasswordInput {
2 | password!: string;
3 | }
4 |
--------------------------------------------------------------------------------
/api/src/core/middlewares/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logger.middleware';
2 | export * from './gql-date.middleware';
3 |
--------------------------------------------------------------------------------
/ui/src/app/api/auth/refresh-token.input.ts:
--------------------------------------------------------------------------------
1 | export class RefreshTokenInput {
2 | refreshToken!: string;
3 | }
4 |
--------------------------------------------------------------------------------
/api/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "trailingComma": "all",
4 | "printWidth": 100,
5 | "semi": true
6 | }
--------------------------------------------------------------------------------
/ui/src/app/api/auth/auth.model.ts:
--------------------------------------------------------------------------------
1 | export class Auth {
2 | accessToken!: string;
3 | refreshToken!: string;
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/cache/cache-group.model.ts:
--------------------------------------------------------------------------------
1 | export class CacheGroup {
2 | type!: string;
3 | keys!: string[];
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/index.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | width: 100%;
4 | height: 100%;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/assets/fonts/dm-mono.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/fonts/dm-mono.woff2
--------------------------------------------------------------------------------
/ui/src/assets/fonts/inter.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/fonts/inter.woff2
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/cache.json:
--------------------------------------------------------------------------------
1 | {
2 | "CacheKeyIsNotEmpty": "缓存 key 不能为空",
3 | "CacheKeyIsNotExist": "缓存 key 不存在"
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/create.input.ts:
--------------------------------------------------------------------------------
1 | export class RoleCreateInput {
2 | name!: string;
3 | description?: string;
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/assets/img/sider/sider-1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/sider/sider-1.jpg
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 140,
3 | "semi": true,
4 | "singleQuote": true,
5 | "trailingComma": "none"
6 | }
7 |
--------------------------------------------------------------------------------
/api/src/services/file/index.ts:
--------------------------------------------------------------------------------
1 | export * from './file.enum';
2 | export * from './file.model';
3 | export * from './file.service';
4 |
--------------------------------------------------------------------------------
/ui/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 100,
3 | "semi": true,
4 | "singleQuote": true,
5 | "trailingComma": "none"
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/auth/index.ts:
--------------------------------------------------------------------------------
1 | export * from './login.input';
2 | export * from './auth.model';
3 | export * from './auth.service';
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Role } from './role.model';
2 |
3 | export class RoleSelectOutput extends Role {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/select.output.ts:
--------------------------------------------------------------------------------
1 | import { User } from './user.model';
2 |
3 | export class UserSelectOutput extends User {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/index.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/aliyun-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/aliyun-logo.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/baidu-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/baidu-logo.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/google-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/google-logo.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-16x16.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-32x32.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-48x48.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-72x72.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-96x96.png
--------------------------------------------------------------------------------
/api/src/core/config/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logger.config';
2 | export * from './graphql.config';
3 | export * from './i18n.config';
4 |
--------------------------------------------------------------------------------
/api/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/cache/cache.model.ts:
--------------------------------------------------------------------------------
1 | export class Cache {
2 | key!: string;
3 | value!: string;
4 | expiretime!: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Model } from './model.model';
2 |
3 | export class ModelSelectOutput extends Model {}
4 |
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-128x128.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-144x144.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-152x152.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-194x194.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-194x194.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-384x384.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-384x384.png
--------------------------------------------------------------------------------
/ui/src/assets/img/logo/logo-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NG-NEST/ng-nest-admin/HEAD/ui/src/assets/img/logo/logo-512x512.png
--------------------------------------------------------------------------------
/api/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "commentTranslate.targetLanguage": "en",
3 | "commentTranslate.source": "DarkCWK.youdao-youdao"
4 | }
--------------------------------------------------------------------------------
/api/prisma/migrations/20250620131148_update_resource/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-resource" ADD COLUMN "type" TEXT;
3 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/cache.json:
--------------------------------------------------------------------------------
1 | {
2 | "CacheKeyIsNotEmpty": "key should not be empty",
3 | "CacheKeyIsNotExist": "key is not exist"
4 | }
5 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/upload.json:
--------------------------------------------------------------------------------
1 | {
2 | "FilepathIsNotEmpty": "The file path cannot be empty",
3 | "UidIsUUID": "uid invalid format"
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/auth/login.input.ts:
--------------------------------------------------------------------------------
1 | export class LoginInput {
2 | account!: string;
3 | password!: string;
4 | code!: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/auth/verify-token.input.ts:
--------------------------------------------------------------------------------
1 | export class VerifyTokenInput {
2 | accessToken?: string;
3 | refreshToken?: string;
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/logs/logs-file.model.ts:
--------------------------------------------------------------------------------
1 | export class LogsFile {
2 | name?: string;
3 | type?: string;
4 | extension?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Prompt } from './prompt.model';
2 |
3 | export class PromptSelectOutput extends Prompt {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Schema } from './schema.model';
2 |
3 | export class SchemaSelectOutput extends Schema {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/update.input.ts:
--------------------------------------------------------------------------------
1 | export class UserUpdateInput {
2 | name?: string;
3 | email?: string;
4 | phone?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | api/node_modules
2 | api/dist
3 | api/logs
4 | api/.env
5 | api/assets
6 | api/temp
7 | ui/node_modules
8 | ui/dist
9 | ui/.angular/cache
--------------------------------------------------------------------------------
/api/prisma/migrations/20250428120918_update_catalogue/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-catalogue" ADD COLUMN "content" TEXT;
3 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250525040435_update_catalogue/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-catalogue" ADD COLUMN "url" TEXT;
3 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/role.json:
--------------------------------------------------------------------------------
1 | {
2 | "RoleIdIsNotEmpty": "角色编码不能为空",
3 | "NameIsNotEmpty": "角色名称不能为空",
4 | "NameIsExist": "角色名称已经存在"
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/auth/verify-token.output.ts:
--------------------------------------------------------------------------------
1 | export class VerifyTokenOutput {
2 | accessToken?: boolean;
3 | refreshToken?: boolean;
4 | }
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/cache/update.input.ts:
--------------------------------------------------------------------------------
1 | export class CacheUpdateInput {
2 | key!: string;
3 | value?: string;
4 | expiretime?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/update.input.ts:
--------------------------------------------------------------------------------
1 | export class RoleUpdateInput {
2 | id!: string;
3 | name?: string;
4 | description?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Subject } from './subject.model';
2 |
3 | export class SubjectSelectOutput extends Subject {}
4 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250608050556_catalogue_add_file_type_enum/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterEnum
2 | ALTER TYPE "CatalogueFileType" ADD VALUE 'UnKonwn';
3 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250702143609_update_schema_data/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-schema-data" ADD COLUMN "formId" TEXT;
3 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250831120306_update_prompt/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-prompt" ALTER COLUMN "userVars" DROP NOT NULL;
3 |
--------------------------------------------------------------------------------
/api/src/core/functions/index.ts:
--------------------------------------------------------------------------------
1 | export * from './ms';
2 | export * from './strings';
3 | export * from './json-schema';
4 | export * from './array';
5 |
--------------------------------------------------------------------------------
/api/src/services/openai/index.ts:
--------------------------------------------------------------------------------
1 | export * from './openai.interface';
2 | export * from './openai.service';
3 | export * from './dashscope.service';
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Language } from './language.model';
2 |
3 | export class LanguageSelectOutput extends Language {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Resource } from './resource.model';
2 |
3 | export class ResourceSelectOutput extends Resource {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/create.input.ts:
--------------------------------------------------------------------------------
1 | export class SubjectCreateInput {
2 | name!: string;
3 | code!: string;
4 | description?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Variable } from './variable.model';
2 |
3 | export class VariableSelectOutput extends Variable {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/core/pipes/index.ts:
--------------------------------------------------------------------------------
1 | export * from './zero-prefix.pipe';
2 | export * from './file-icon.pipe';
3 | export * from './base64-to-string.pipe';
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Catalogue } from './catalogue.model';
2 |
3 | export class CatalogueSelectOutput extends Catalogue {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/create.input.ts:
--------------------------------------------------------------------------------
1 | export class LanguageCreateInput {
2 | key!: string;
3 | value?: string;
4 | languageCode!: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Dictionary } from './dictionary.model';
2 |
3 | export class DictionarySelectOutput extends Dictionary {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/select.output.ts:
--------------------------------------------------------------------------------
1 | import { Permission } from './permission.model';
2 |
3 | export class PermissionSelectOutput extends Permission {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/role-permissions.output.ts:
--------------------------------------------------------------------------------
1 | import { Permission } from '../permission';
2 |
3 | export class RolePermissionOutput extends Permission {}
4 |
--------------------------------------------------------------------------------
/api/src/services/aigc/aigc-stream.output.ts:
--------------------------------------------------------------------------------
1 | import { AigcOutput } from './aigc.output';
2 |
3 | export class AigcStreamOutput {
4 | data: AigcOutput[];
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/select.output.ts:
--------------------------------------------------------------------------------
1 | import { SchemaData } from './schema-data.model';
2 |
3 | export class SchemaDataSelectOutput extends SchemaData {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/save-many.input.ts:
--------------------------------------------------------------------------------
1 | import { Variable } from './variable.model';
2 |
3 | export class VariableSaveManyInput {
4 | many!: Variable[];
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/variable-type.input.ts:
--------------------------------------------------------------------------------
1 | export class VariableTypeInput {
2 | resourceId!: string;
3 | type!: string;
4 | schemaType?: string;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/core/common/index.ts:
--------------------------------------------------------------------------------
1 | export * from './base.enum';
2 | export * from './base.input';
3 | export * from './base.model';
4 | export * from './base.output';
5 |
--------------------------------------------------------------------------------
/api/src/services/logs/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logs.service';
2 | export * from './logs-file.model';
3 | export * from './logs.enum';
4 | export * from './logs.output';
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/logs/index.ts:
--------------------------------------------------------------------------------
1 | export * from './logs.service';
2 | export * from './logs-file.model';
3 | export * from './logs.enum';
4 | export * from './logs.output';
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/create.input.ts:
--------------------------------------------------------------------------------
1 | export class ModelCreateInput {
2 | name!: string;
3 | code!: string;
4 | platform!: string;
5 | description?: string;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/update.input.ts:
--------------------------------------------------------------------------------
1 | export class ModelUpdateInput {
2 | name?: string;
3 | code?: string;
4 | platform?: string;
5 | description?: string;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/update.input.ts:
--------------------------------------------------------------------------------
1 | export class SubjectUpdateInput {
2 | id!: string;
3 | name?: string;
4 | code?: string;
5 | description?: string;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/core/functions/index.ts:
--------------------------------------------------------------------------------
1 | export * from './parse-gitignore';
2 | export * from './file-reader';
3 | export * from './versions';
4 | export * from './functions';
5 |
--------------------------------------------------------------------------------
/api/src/services/aigc/dashscope/qwen.input.ts:
--------------------------------------------------------------------------------
1 | import { QwenModel } from './qwen.enum';
2 |
3 | export class QwenInput {
4 | model: QwenModel;
5 | prompt: string;
6 | }
7 |
--------------------------------------------------------------------------------
/api/src/services/upload/index.ts:
--------------------------------------------------------------------------------
1 | export * from './upload.service';
2 | export * from './upload.enum';
3 | export * from './upload.input';
4 | export * from './upload.model';
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/update.input.ts:
--------------------------------------------------------------------------------
1 | export class LanguageUpdateInput {
2 | id!: string;
3 | key?: string;
4 | value?: string;
5 | languageCode?: string;
6 | }
7 |
--------------------------------------------------------------------------------
/api/prisma/migrations/migration_lock.toml:
--------------------------------------------------------------------------------
1 | # Please do not edit this file manually
2 | # It should be added in your version-control system (e.g., Git)
3 | provider = "postgresql"
4 |
--------------------------------------------------------------------------------
/api/src/services/aigc/gemini/gemini.input.ts:
--------------------------------------------------------------------------------
1 | import { GeminiModel } from './gemini.enum';
2 |
3 | export class GeminiInput {
4 | model: GeminiModel;
5 | prompt: string;
6 | }
7 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "commentTranslate.targetLanguage": "en",
3 | "commentTranslate.source": "DarkCWK.youdao-youdao",
4 | "commentTranslate.multiLineMerge": true
5 | }
--------------------------------------------------------------------------------
/api/prisma/migrations/20250611133443_update_resource/migration.sql:
--------------------------------------------------------------------------------
1 | -- DropIndex
2 | DROP INDEX "sys-resource_code_key";
3 |
4 | -- DropIndex
5 | DROP INDEX "sys-resource_name_key";
6 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/role.json:
--------------------------------------------------------------------------------
1 | {
2 | "RoleIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "NameIsExist": "name already exist"
5 | }
6 |
--------------------------------------------------------------------------------
/api/src/services/upload/upload.model.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { File } from '../file';
3 |
4 | @ObjectType()
5 | export class Upload extends File {}
6 |
--------------------------------------------------------------------------------
/api/src/services/aigc/qianfan/qianfan.input.ts:
--------------------------------------------------------------------------------
1 | import { QianFanModel } from './qianfan.enum';
2 |
3 | export class QianFanInput {
4 | model: QianFanModel;
5 | prompt: string;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/create.input.ts:
--------------------------------------------------------------------------------
1 | export class SchemaCreateInput {
2 | name!: string;
3 | code!: string;
4 | description?: string;
5 | version?: string;
6 | json!: object;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/select.output.ts:
--------------------------------------------------------------------------------
1 | import { VariableCategory } from './variable-category.model';
2 |
3 | export class VariableCategorySelectOutput extends VariableCategory {}
4 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/operation/operation.component.html:
--------------------------------------------------------------------------------
1 | {{ title() }}
2 | JsonSchema
3 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/operation/operation.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | padding: 1rem;
3 | display: flex;
4 | align-items: center;
5 | justify-content: space-between;
6 | }
7 |
--------------------------------------------------------------------------------
/api/src/core/interceptor/index.ts:
--------------------------------------------------------------------------------
1 | export * from './transform.interceptor';
2 | export * from './cache.interceptor';
3 | export * from './file.interceptor';
4 | export * from './files.interceptor';
5 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/schema-data.json:
--------------------------------------------------------------------------------
1 | {
2 | "SchemaDataIdIsNotEmpty": "数据编码不能为空",
3 | "DataIsNotEmpty": "数据不能为空",
4 | "SchemaIdIsNotEmpty": "模型编码不能为空",
5 | "SchemaIdIsNotExist": "模型编码不存在"
6 | }
7 |
--------------------------------------------------------------------------------
/api/src/services/role/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Role } from './role.model';
3 |
4 | @ObjectType()
5 | export class RoleSelectOutput extends Role {}
6 |
--------------------------------------------------------------------------------
/api/src/services/user/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { User } from './user.model';
3 |
4 | @ObjectType()
5 | export class UserSelectOutput extends User {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/create.input.ts:
--------------------------------------------------------------------------------
1 | export class DictionaryCreateInput {
2 | name!: string;
3 | code!: string;
4 | sort!: number;
5 | description?: string;
6 | pid?: string;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class RoleOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | description?: SortOrder;
6 | }
7 |
--------------------------------------------------------------------------------
/api/src/core/common/index.ts:
--------------------------------------------------------------------------------
1 | export * from './context.type';
2 |
3 | export * from './base.enum';
4 | export * from './base.model';
5 | export * from './base.input';
6 | export * from './base.output';
7 |
--------------------------------------------------------------------------------
/api/src/services/auth/auth-payload.ts:
--------------------------------------------------------------------------------
1 | export interface AuthPayload {
2 | id: string;
3 | permissions?: string[];
4 | roles?: string[];
5 | readonly iat?: number;
6 | readonly exp?: number;
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/model/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Model } from './model.model';
3 |
4 | @ObjectType()
5 | export class ModelSelectOutput extends Model {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/create.input.ts:
--------------------------------------------------------------------------------
1 | export class PermissionCreateInput {
2 | name!: string;
3 | code!: string;
4 | sort!: number;
5 | description?: string;
6 | resourceId!: string;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/save-many.input.ts:
--------------------------------------------------------------------------------
1 | import { Permission } from './permission.model';
2 |
3 | export class PermessionSaveManyInput {
4 | many!: Permission[];
5 | resourceId!: string;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/create.input.ts:
--------------------------------------------------------------------------------
1 | import { JsonValue } from '@ui/core';
2 |
3 | export class SchemaDataCreateInput {
4 | data!: JsonValue;
5 | schemaId!: string;
6 | formId?: string;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/subject.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseModel } from '@ui/core';
2 |
3 | export class Subject extends BaseModel {
4 | name!: string;
5 | code!: string;
6 | description?: string;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/app.worker.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | addEventListener('message', ({ data }) => {
4 | const response = `worker response to ${data}`;
5 | postMessage(response);
6 | });
7 |
--------------------------------------------------------------------------------
/api/src/services/prompt/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Prompt } from './prompt.model';
3 |
4 | @ObjectType()
5 | export class PromptSelectOutput extends Prompt {}
6 |
--------------------------------------------------------------------------------
/api/src/services/schema/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Schema } from './schema.model';
3 |
4 | @ObjectType()
5 | export class SchemaSelectOutput extends Schema {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/role.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Role } from './role.model';
3 |
4 | export class RolePaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class SchemaDataOrderInput extends BaseOrder {
4 | schemaId?: SortOrder;
5 | formId?: SortOrder;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/user.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { User } from './user.model';
3 |
4 | export class UserPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/update.input.ts:
--------------------------------------------------------------------------------
1 | export class VariableCategoryUpdateInput {
2 | id!: string;
3 | name?: string;
4 | code?: string;
5 | sort?: number;
6 | description?: string;
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/subject/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Subject } from './subject.model';
3 |
4 | @ObjectType()
5 | export class SubjectSelectOutput extends Subject {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/update.input.ts:
--------------------------------------------------------------------------------
1 | export class DictionaryUpdateInput {
2 | id!: string;
3 | name?: string;
4 | code?: string;
5 | sort?: number;
6 | description?: string;
7 | pid?: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/model.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Model } from './model.model';
3 |
4 | export class ModelPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/update.input.ts:
--------------------------------------------------------------------------------
1 | export class SchemaUpdateInput {
2 | id!: string;
3 | name?: string;
4 | code?: string;
5 | description?: string;
6 | version?: string;
7 | json?: object;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/core/common/base.model.ts:
--------------------------------------------------------------------------------
1 | export class BaseAudit {
2 | createdAt?: Date | string;
3 | updatedAt?: Date | string;
4 | }
5 |
6 | export class BaseModel extends BaseAudit {
7 | id!: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/core/index.ts:
--------------------------------------------------------------------------------
1 | export * from './services';
2 | export * from './pipes';
3 | export * from './common';
4 | export * from './directives';
5 | export * from './components';
6 | export * from './functions';
7 |
--------------------------------------------------------------------------------
/api/src/services/aigc/dashscope/index.ts:
--------------------------------------------------------------------------------
1 | export * from './qwen.constants';
2 | export * from './qwen.service';
3 | export * from './qwen.input';
4 | export * from './qwen-stream.input';
5 | export * from './qwen.enum';
6 |
--------------------------------------------------------------------------------
/api/src/services/auth/verify-token.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 |
3 | @ObjectType()
4 | export class VerifyTokenOutput {
5 | accessToken?: boolean;
6 | refreshToken?: boolean;
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/language/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Language } from './language.model';
3 |
4 | @ObjectType()
5 | export class LanguageSelectOutput extends Language {}
6 |
--------------------------------------------------------------------------------
/api/src/services/role/permission.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Permission } from '../permission';
3 |
4 | @ObjectType()
5 | export class RolePermissionOutput extends Permission {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/prompt.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Prompt } from './prompt.model';
3 |
4 | export class PromptPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/schema.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Schema } from './schema.model';
3 |
4 | export class SchemaPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/create.input.ts:
--------------------------------------------------------------------------------
1 | export class VariableCategoryCreateInput {
2 | name!: string;
3 | code?: string;
4 | sort?: number;
5 | description?: string;
6 | resourceId!: string;
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/core/decorators/file.decorator.ts:
--------------------------------------------------------------------------------
1 | import { SetMetadata } from '@nestjs/common';
2 |
3 | export const FILE_METADATA = 'file';
4 | export const FileControl = (...keys: string[]) => SetMetadata(FILE_METADATA, keys);
5 |
--------------------------------------------------------------------------------
/api/src/services/aigc/qianfan/qianfan.constants.ts:
--------------------------------------------------------------------------------
1 | import { QianFanModel } from './qianfan.enum';
2 |
3 | export const QIANFAN_URL = 'https://aip.baidubce.com';
4 | export const QIANFAN_MODELS = Object.values(QianFanModel);
5 |
--------------------------------------------------------------------------------
/api/src/services/catalogue/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Catalogue } from './catalogue.model';
3 |
4 | @ObjectType()
5 | export class CatalogueSelectOutput extends Catalogue {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class DictionaryOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | code?: SortOrder;
6 | sort?: SortOrder;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/model.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseModel } from '@ui/core';
2 |
3 | export class Model extends BaseModel {
4 | name!: string;
5 | code!: string;
6 | platform!: string;
7 | description?: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/update.input.ts:
--------------------------------------------------------------------------------
1 | export class PermissionUpdateInput {
2 | id!: string;
3 | name?: string;
4 | code?: string;
5 | sort?: number;
6 | description?: string;
7 | resourceId?: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/update.input.ts:
--------------------------------------------------------------------------------
1 | import { JsonValue } from '@ui/core';
2 |
3 | export class SchemaDataUpdateInput {
4 | id!: string;
5 | data?: JsonValue;
6 | schemaId?: string;
7 | formId?: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/subject.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Subject } from './subject.model';
3 |
4 | export class SubjectPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/api/src/core/decorators/files.decorator.ts:
--------------------------------------------------------------------------------
1 | import { SetMetadata } from '@nestjs/common';
2 |
3 | export const FILES_METADATA = 'files';
4 | export const FilesControl = (...keys: string[]) => SetMetadata(FILES_METADATA, keys);
5 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/model.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModelIdIsNotEmpty": "模型编码 不能为空",
3 | "ModelIdIsNotExist": "模型编码 不存在",
4 | "NameIsNotEmpty": "模型名称 不能为空",
5 | "CodeIsNotEmpty": "模型代码 不能为空",
6 | "PlatformIsNotEmpty": "平台 不能为空"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/subject.json:
--------------------------------------------------------------------------------
1 | {
2 | "SubjectIdIsNotEmpty": "资源分类编码不能为空",
3 | "NameIsNotEmpty": "资源分类名称不能为空",
4 | "NameIsExist": "资源分类名称已经存在",
5 | "CodeIsNotEmpty": "资源分类编码不能为空",
6 | "CodeIsExist": "资源分类编码已经存在"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/aigc/gemini/index.ts:
--------------------------------------------------------------------------------
1 | export * from './gemini.constants';
2 | export * from './gemini.service';
3 | export * from './gemini.input';
4 | export * from './gemini.enum';
5 | export * from './gemini-stream.input';
6 |
--------------------------------------------------------------------------------
/api/src/services/dictionary/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Dictionary } from './dictionary.model';
3 |
4 | @ObjectType()
5 | export class DictionarySelectOutput extends Dictionary {}
6 |
--------------------------------------------------------------------------------
/api/src/services/permission/select.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { Permission } from './permission.model';
3 |
4 | @ObjectType()
5 | export class PermissionSelectOutput extends Permission {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/language.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit } from '@ui/core';
2 |
3 | export class Language extends BaseAudit {
4 | id!: string;
5 | key!: string;
6 | value?: string;
7 | languageCode!: string;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/language.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Language } from './language.model';
3 |
4 | export class LanguagePaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class LanguageOrderInput extends BaseOrder {
4 | key?: SortOrder;
5 | value?: SortOrder;
6 | languageCode?: SortOrder;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class PermissionWhereInput extends BaseWhereInput {
4 | resourceId?: string | StringFilter;
5 | }
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/resource.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Resource } from './resource.model';
3 |
4 | export class ResourcePaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class SubjectOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | code?: SortOrder;
6 | description?: SortOrder;
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/variable.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Variable } from './variable.model';
3 |
4 | export class VariablePaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/index.ts:
--------------------------------------------------------------------------------
1 | export * from './json-schema.type';
2 | export * from './json-schema.component';
3 | export * from './json-schema.function';
4 | export * from './json-dialog/json-dialog.component';
5 |
--------------------------------------------------------------------------------
/ui/src/app/pages/aigc/aigc-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { AigcComponent } from './aigc.component';
3 |
4 | export const AigcRoutes: Routes = [{ path: '', component: AigcComponent }];
5 |
--------------------------------------------------------------------------------
/ui/src/app/pages/cache/cache.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .roles {
3 | display: inline-flex;
4 | flex-direction: column;
5 | x-tag:not(:first-child) {
6 | margin-top: 0.125rem;
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/pages/json/json-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { JsonComponent } from './json.component';
3 |
4 | export const JsonRoutes: Routes = [{ path: '', component: JsonComponent }];
5 |
--------------------------------------------------------------------------------
/ui/src/app/pages/user/user.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .roles {
3 | display: inline-flex;
4 | flex-direction: column;
5 | x-tag:not(:first-child) {
6 | margin-top: 0.125rem;
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/api/src/services/aigc/qianfan/index.ts:
--------------------------------------------------------------------------------
1 | export * from './qianfan.constants';
2 | export * from './qianfan.service';
3 | export * from './qianfan.input';
4 | export * from './qianfan.enum';
5 | export * from './qianfan-stream.input';
6 |
--------------------------------------------------------------------------------
/ui/src/app/pages/code-generate/catalogue/catalogue.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .app-dialog-form {
3 | .item {
4 | x-input,
5 | x-tree-select {
6 | width: 16rem;
7 | }
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/pages/login/login-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { LoginComponent } from './login.component';
3 |
4 | export const LoginRoutes: Routes = [{ path: '', component: LoginComponent }];
5 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/prompt.json:
--------------------------------------------------------------------------------
1 | {
2 | "PromptIdIsNotEmpty": "提示词编码不能为空",
3 | "NameIsNotEmpty": "名称 不能为空",
4 | "UserIsNotEmpty": "用户 不能为空",
5 | "ModelIdIsNotEmpty": "使用模型Id 不能为空",
6 | "ModelTypeIsNotEmpty": "使用模型Type 不能为空"
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/catalogue.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Catalogue } from './catalogue.model';
3 |
4 | export class CataloguePaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/dictionary.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Dictionary } from './dictionary.model';
3 |
4 | export class DictionaryPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/permission.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { Permission } from './permission.model';
3 |
4 | export class PermissionPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/schema-data.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { SchemaData } from './schema-data.model';
3 |
4 | export class SchemaDataPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class UserOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | account?: SortOrder;
6 | email?: SortOrder;
7 | phone?: SortOrder;
8 | }
9 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/aigc.json:
--------------------------------------------------------------------------------
1 | {
2 | "TypeIsNotEmpty": "类型不能为空",
3 | "TypeIsIn": "类型必须在指定的列表中",
4 | "ModelIsNotEmpty": "模型不能为空",
5 | "ModelIsIn": "模型必须在指定的列表中",
6 | "PromptIsNotEmpty": "指令不能为空",
7 | "MessagesIsNotEmpty": "消息不能为空"
8 | }
9 |
--------------------------------------------------------------------------------
/api/test/jest-e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "moduleFileExtensions": ["js", "json", "ts"],
3 | "rootDir": ".",
4 | "testEnvironment": "node",
5 | "testRegex": ".e2e-spec.ts$",
6 | "transform": {
7 | "^.+\\.(t|j)s$": "ts-jest"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/cache/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cache.service';
2 | export * from './cache.model';
3 | export * from './cache-group.model';
4 | export * from './cache.enum';
5 | export * from './cache-keys.input';
6 | export * from './update.input';
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class ModelOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | code?: SortOrder;
6 | platform?: SortOrder;
7 | description?: SortOrder;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class RoleWhereInput extends BaseWhereInput {
4 | name?: string | StringFilter;
5 | description?: string | StringFilter;
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/editor/editor.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | width: 100%;
4 | height: 100%;
5 |
6 | ::ng-deep .monaco-editor .margin {
7 | background-color: var(--x-background-a100);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/pages/overview/overview-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { OverviewComponent } from './overview.component';
3 |
4 | export const OverviewRoutes: Routes = [{ path: '', component: OverviewComponent }];
5 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250608042330_catalogue_add_file_type/migration.sql:
--------------------------------------------------------------------------------
1 | -- CreateEnum
2 | CREATE TYPE "CatalogueFileType" AS ENUM ('Media', 'Text');
3 |
4 | -- AlterTable
5 | ALTER TABLE "sys-catalogue" ADD COLUMN "fileType" "CatalogueFileType";
6 |
--------------------------------------------------------------------------------
/api/src/services/cache/index.ts:
--------------------------------------------------------------------------------
1 | export * from './cache.service';
2 | export * from './cache.model';
3 | export * from './cache-group.model';
4 | export * from './cache.enum';
5 | export * from './cache-keys.input';
6 | export * from './update.input';
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/create.input.ts:
--------------------------------------------------------------------------------
1 | export class PromptCreateInput {
2 | name!: string;
3 | prompt!: string;
4 | system?: string;
5 | code!: string;
6 | platform!: string;
7 | promptVars?: any[];
8 | description?: string;
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/update.input.ts:
--------------------------------------------------------------------------------
1 | export class PromptUpdateInput {
2 | name?: string;
3 | prompt?: string;
4 | system?: string;
5 | code?: string;
6 | platform?: string;
7 | promptVars?: any[];
8 | description?: string;
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class SchemaOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | description?: SortOrder;
6 | code?: SortOrder;
7 | version?: SortOrder;
8 | }
9 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250702125741_update_variable/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-variable" ADD COLUMN "sort" INTEGER DEFAULT 0;
3 |
4 | -- AlterTable
5 | ALTER TABLE "sys-variable-category" ADD COLUMN "sort" INTEGER DEFAULT 0;
6 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/variable-category.json:
--------------------------------------------------------------------------------
1 | {
2 | "VariableCategoryIdIsNotEmpty": "变量分类编码不能为空",
3 | "NameIsNotEmpty": "变量分类名称不能为空",
4 | "CodeIsNotEmpty": "变量分类标识不能为空",
5 | "ResourceIdIsNotEmpty": "资源编码不能为空",
6 | "ResourceIdIsNotExist": "资源编码不存在"
7 | }
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class PermissionOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | code?: SortOrder;
6 | sort?: SortOrder;
7 | description?: SortOrder;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema/schema-detail/schema-detail.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .content {
3 | display: grid;
4 | grid-template-columns: 1fr 1fr 1fr;
5 |
6 | x-input,
7 | x-textarea {
8 | flex: 1;
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/language.json:
--------------------------------------------------------------------------------
1 | {
2 | "LanguageIdIsNotEmpty": "语言编码不能为空",
3 | "KeyIsNotEmpty": "语言标识不能为空",
4 | "KeyIsExist": "语言标识已经存在",
5 | "ValueIsNotEmpty": "语言值不能为空",
6 | "ValueIsExist": "语言值已经存在",
7 | "LanguageCodeIsNotEmpty": "关联语言不能为空"
8 | }
9 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "SchemaIdIsNotEmpty": "数据结构编码不能为空",
3 | "NameIsNotEmpty": "数据结构名称不能为空",
4 | "NameIsExist": "数据结构名称已经存在",
5 | "CodeIsNotEmpty": "数据结构编码不能为空",
6 | "CodeIsExist": "数据结构编码已经存在",
7 | "JsonIsNotEmpty": "数据结构内容不能为空"
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/pages/overview/overview.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-overview',
5 | standalone: true,
6 | templateUrl: './overview.component.html'
7 | })
8 | export class OverviewComponent {}
9 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/schema-data.json:
--------------------------------------------------------------------------------
1 | {
2 | "SchemaDataIdIsNotEmpty": "id should not be empty",
3 | "DataIsNotEmpty": "name should not be empty",
4 | "SchemaIdIsNotEmpty": "schemaId should not be empty",
5 | "SchemaIdIsNotExist": "schemaId is not exist"
6 | }
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { RoleWhereInput } from './where';
3 | import { RoleOrderInput } from './order';
4 |
5 | export class RoleSelectInput extends BaseSelectInput(RoleWhereInput, RoleOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { UserWhereInput } from './where';
3 | import { UserOrderInput } from './order';
4 |
5 | export class UserSelectInput extends BaseSelectInput(UserWhereInput, UserOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class VariableCategoryOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | code?: SortOrder;
6 | sort?: SortOrder;
7 | resourceId?: SortOrder;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/pages/role/role-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { RoleComponent } from './role.component';
3 |
4 | export const RoleRoutes: Routes = [
5 | {
6 | path: '',
7 | component: RoleComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/ui/src/app/pages/user/user-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { UserComponent } from './user.component';
3 |
4 | export const UserRoutes: Routes = [
5 | {
6 | path: '',
7 | component: UserComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { ModelWhereInput } from './where';
3 | import { ModelOrderInput } from './order';
4 |
5 | export class ModelSelectInput extends BaseSelectInput(ModelWhereInput, ModelOrderInput) {}
6 |
--------------------------------------------------------------------------------
/api/src/services/role/role.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Role } from './role.model';
4 |
5 | @ObjectType()
6 | export class RolePaginationOutput extends BasePaginationOutput(Role) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/user/user.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { User } from './user.model';
4 |
5 | @ObjectType()
6 | export class UserPaginationOutput extends BasePaginationOutput(User) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/pages/cache/cache-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { CacheComponent } from './cache.component';
3 |
4 | export const CacheRoutes: Routes = [
5 | {
6 | path: '',
7 | component: CacheComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/ui/src/app/pages/code-generate/code-generate-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { CodeGenerateComponent } from './code-generate.component';
3 |
4 | export const CodeGenerateRoutes: Routes = [{ path: '', component: CodeGenerateComponent }];
5 |
--------------------------------------------------------------------------------
/ui/src/app/pages/model/model-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { ModelComponent } from './model.component';
3 |
4 | export const ModelRoutes: Routes = [
5 | {
6 | path: '',
7 | component: ModelComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/api/src/core/decorators/current-user.decorator.ts:
--------------------------------------------------------------------------------
1 | import { createParamDecorator, ExecutionContext } from '@nestjs/common';
2 |
3 | export const CurrentUser = createParamDecorator((_data: unknown, ctx: ExecutionContext) => {
4 | return ctx.switchToHttp().getRequest().user;
5 | });
6 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/subject.json:
--------------------------------------------------------------------------------
1 | {
2 | "SubjectIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "NameIsExist": "name already exist",
5 | "CodeIsNotEmpty": "code should not be empty",
6 | "CodeIsExist": "code already exist"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/model/model.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Model } from './model.model';
4 |
5 | @ObjectType()
6 | export class ModelPaginationOutput extends BasePaginationOutput(Model) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { PromptWhereInput } from './where';
3 | import { PromptOrderInput } from './order';
4 |
5 | export class PromptSelectInput extends BaseSelectInput(PromptWhereInput, PromptOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { RoleWhereInput } from './where';
3 | import { RoleOrderInput } from './order';
4 |
5 | export class RolePaginationInput extends BasePaginationInput(RoleWhereInput, RoleOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/select.input.ts:
--------------------------------------------------------------------------------
1 | import { SchemaWhereInput } from './where';
2 | import { SchemaOrderInput } from './order';
3 | import { BaseSelectInput } from '@ui/core';
4 |
5 | export class SchemaSelectInput extends BaseSelectInput(SchemaWhereInput, SchemaOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { UserWhereInput } from './where';
3 | import { UserOrderInput } from './order';
4 |
5 | export class UserPaginationInput extends BasePaginationInput(UserWhereInput, UserOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/variable-category.output.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationOutput } from '@ui/core';
2 | import { VariableCategory } from './variable-category.model';
3 |
4 | export class VariableCategoryPaginationOutput extends BasePaginationOutput {}
5 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/worker/json-schema.worker.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import { XTreeDataToJsonSchema } from '../json-schema.function';
4 |
5 | addEventListener('message', ({ data }) => {
6 | postMessage(XTreeDataToJsonSchema(data));
7 | });
8 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/worker/tree-data.worker.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
3 | import { XJsonSchemaToTreeData } from '../json-schema.function';
4 |
5 | addEventListener('message', ({ data }) => {
6 | postMessage(XJsonSchemaToTreeData(data));
7 | });
8 |
--------------------------------------------------------------------------------
/ui/src/app/pages/prompt/prompt-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { PromptComponent } from './prompt.component';
3 |
4 | export const PromptRoutes: Routes = [
5 | {
6 | path: '',
7 | component: PromptComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema/schema-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { SchemaComponent } from './schema.component';
3 |
4 | export const SchemaRoutes: Routes = [
5 | {
6 | path: '',
7 | component: SchemaComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/api/src/services/prompt/prompt.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Prompt } from './prompt.model';
4 |
5 | @ObjectType()
6 | export class PromptPaginationOutput extends BasePaginationOutput(Prompt) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/schema/schema.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Schema } from './schema.model';
4 |
5 | @ObjectType()
6 | export class SchemaPaginationOutput extends BasePaginationOutput(Schema) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/logs/logs.output.ts:
--------------------------------------------------------------------------------
1 | import { LogsFile } from './logs-file.model';
2 |
3 | export class LogsOutput {
4 | error?: LogsFile[];
5 | http?: LogsFile[];
6 | info?: LogsFile[];
7 | cache?: LogsFile[];
8 | prisma?: LogsFile[];
9 | warn?: LogsFile[];
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/schema.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit, JsonValue } from '@ui/core';
2 |
3 | export class Schema extends BaseAudit {
4 | id!: string;
5 | name!: string;
6 | code!: string;
7 | description?: string;
8 | version?: string;
9 | json!: JsonValue;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { SubjectWhereInput } from './where';
3 | import { SubjectOrderInput } from './order';
4 |
5 | export class SubjectSelectInput extends BaseSelectInput(SubjectWhereInput, SubjectOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/pages/subject/subject-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { SubjectComponent } from './subject.component';
3 |
4 | export const SubjectRoutes: Routes = [
5 | {
6 | path: '',
7 | component: SubjectComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/api/src/core/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './prisma.service';
2 | export * from './encrypt.service';
3 | export * from './redis.service';
4 | export * from './cos.service';
5 | export * from './i18n.service';
6 | export * from './handlebars.service';
7 | export * from './global.module';
8 |
--------------------------------------------------------------------------------
/api/src/services/subject/subject.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Subject } from './subject.model';
4 |
5 | @ObjectType()
6 | export class SubjectPaginationOutput extends BasePaginationOutput(Subject) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { LanguageWhereInput } from './where';
3 | import { LanguageOrderInput } from './order';
4 |
5 | export class LanguageSelectInput extends BaseSelectInput(LanguageWhereInput, LanguageOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { ModelWhereInput } from './where';
3 | import { ModelOrderInput } from './order';
4 |
5 | export class ModelPaginationInput extends BasePaginationInput(ModelWhereInput, ModelOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class ModelWhereInput extends BaseWhereInput {
4 | name?: StringFilter;
5 | code?: StringFilter;
6 | platform?: StringFilter;
7 | description?: StringFilter;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/permission.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit } from '@ui/core';
2 |
3 | export class Permission extends BaseAudit {
4 | id!: string;
5 | name!: string;
6 | code!: string;
7 | sort!: number;
8 | description?: string;
9 | resourceId?: string;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { VariableWhereInput } from './where';
3 | import { VariableOrderInput } from './order';
4 |
5 | export class VariableSelectInput extends BaseSelectInput(VariableWhereInput, VariableOrderInput) {}
6 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/variable.json:
--------------------------------------------------------------------------------
1 | {
2 | "VariableIdIsNotEmpty": "变量编码不能为空",
3 | "CodeIsNotEmpty": "变量标识不能为空",
4 | "ResourceIdIsNotEmpty": "资源编码不能为空",
5 | "ResourceIdIsNotExist": "资源编码不存在",
6 | "VariableCategoryIdIsNotEmpty": "变量分类不能为空",
7 | "VariableCategoryIdIsNotExist": "变量分类不存在"
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { PromptWhereInput } from './where';
3 | import { PromptOrderInput } from './order';
4 |
5 | export class PromptPaginationInput extends BasePaginationInput(PromptWhereInput, PromptOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/update.input.ts:
--------------------------------------------------------------------------------
1 | import { JsonValue } from '@ui/core';
2 |
3 | export class VariableUpdateInput {
4 | id!: string;
5 | code!: string;
6 | type?: string;
7 | value?: JsonValue;
8 | source?: string;
9 | sort?: number;
10 | description?: string;
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterOutlet } from '@angular/router';
3 |
4 | @Component({
5 | selector: 'app-root',
6 | imports: [RouterOutlet],
7 | templateUrl: './app.component.html'
8 | })
9 | export class AppComponent {}
10 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/model.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModelIdIsNotEmpty": "id should not be empty",
3 | "ModelIdIsNotExist": "id should not exist",
4 | "NameIsNotEmpty": "name should not be empty",
5 | "CodeIsNotEmpty": "code should not be empty",
6 | "PlatformIsNotEmpty": "platform should not be empty"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/aigc/dashscope/qwen-stream.input.ts:
--------------------------------------------------------------------------------
1 | import { QwenModel, QwenRole } from './qwen.enum';
2 |
3 | export class QwenStreamInput {
4 | model: QwenModel;
5 | messages: QwenMessage[];
6 | }
7 |
8 | export class QwenMessage {
9 | role: QwenRole;
10 | content: string;
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/services/aigc/dashscope/qwen.constants.ts:
--------------------------------------------------------------------------------
1 | import { QwenModel } from './qwen.enum';
2 |
3 | export const DASHSCOPE_URL = 'https://dashscope.aliyuncs.com';
4 | export const DASHSCOPE_OPENAI_URL = `${DASHSCOPE_URL}/compatible-mode/v1`;
5 |
6 | export const QWEN_MODELS = Object.values(QwenModel);
7 |
--------------------------------------------------------------------------------
/api/src/services/auth/auth.constants.ts:
--------------------------------------------------------------------------------
1 | export const JWT_CONSTANTS = {
2 | secret: '5r7rnnhKY4UmfUP9',
3 | expiresIn: '1d',
4 |
5 | refreshSecret: '5r7rnnhKY4UmfUP9',
6 | refreshExpiresIn: '30d',
7 | };
8 |
9 | export const CAPTCHA = 'Captcha';
10 |
11 | export const AUTH = 'Auth';
12 |
--------------------------------------------------------------------------------
/api/src/services/language/language.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Language } from './language.model';
4 |
5 | @ObjectType()
6 | export class LanguagePaginationOutput extends BasePaginationOutput(Language) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/resource/resource.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Resource } from './resource.model';
4 |
5 | @ObjectType()
6 | export class ResourcePaginationOutput extends BasePaginationOutput(Resource) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/variable/variable.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Variable } from './variable.model';
4 |
5 | @ObjectType()
6 | export class VariablePaginationOutput extends BasePaginationOutput(Variable) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/catalogue/catalogue.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Catalogue } from './catalogue.model';
4 |
5 | @ObjectType()
6 | export class CataloguePaginationOutput extends BasePaginationOutput(Catalogue) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/prompt.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseModel } from '@ui/core';
2 |
3 | export class Prompt extends BaseModel {
4 | name!: string;
5 | prompt!: string;
6 | system?: string;
7 | code!: string;
8 | platform!: string;
9 | promptVars?: any[];
10 | description?: string;
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class ResourceOrderInput extends BaseOrder {
4 | type?: SortOrder;
5 | icon?: SortOrder;
6 | name?: SortOrder;
7 | code?: SortOrder;
8 | sort?: SortOrder;
9 | subjectId?: SortOrder;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/select.input.ts:
--------------------------------------------------------------------------------
1 | import { SchemaDataWhereInput } from './where';
2 | import { SchemaDataOrderInput } from './order';
3 | import { BaseSelectInput } from '@ui/core';
4 |
5 | export class SchemaDataSelectInput extends BaseSelectInput(SchemaDataWhereInput, SchemaDataOrderInput) {}
6 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema-data/schema-data-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { SchemaDataComponent } from './schema-data.component';
3 |
4 | export const SchemaDataRoutes: Routes = [
5 | {
6 | path: '',
7 | component: SchemaDataComponent
8 | }
9 | ];
10 |
--------------------------------------------------------------------------------
/ui/src/main.server.ts:
--------------------------------------------------------------------------------
1 | import { bootstrapApplication } from '@angular/platform-browser';
2 | import { AppComponent } from './app/app.component';
3 | import { config } from './app/app.config.server';
4 |
5 | const bootstrap = () => bootstrapApplication(AppComponent, config);
6 |
7 | export default bootstrap;
8 |
--------------------------------------------------------------------------------
/api/src/services/aigc/gemini/gemini.constants.ts:
--------------------------------------------------------------------------------
1 | import { GeminiModel } from './gemini.enum';
2 |
3 | export const GEMINI_URL = 'https://generativelanguage.googleapis.com';
4 | export const GEMINI_GENERATION_URL = `${GEMINI_URL}/v1beta/models`;
5 |
6 | export const GEMINI_MODELS = Object.values(GeminiModel);
7 |
--------------------------------------------------------------------------------
/api/src/services/dictionary/dictionary.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Dictionary } from './dictionary.model';
4 |
5 | @ObjectType()
6 | export class DictionaryPaginationOutput extends BasePaginationOutput(Dictionary) {}
7 |
--------------------------------------------------------------------------------
/api/src/services/permission/permission.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { Permission } from './permission.model';
4 |
5 | @ObjectType()
6 | export class PermissionPaginationOutput extends BasePaginationOutput(Permission) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class LanguageWhere {
4 | key?: StringFilter;
5 | value?: StringFilter;
6 | languageCode?: StringFilter;
7 | }
8 |
9 | export class LanguageWhereInput extends BaseWhereInput {}
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class PromptOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | prompt?: SortOrder;
6 | system?: SortOrder;
7 | code?: SortOrder;
8 | platform?: SortOrder;
9 | description?: SortOrder;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { SchemaWhereInput } from './where';
2 | import { SchemaOrderInput } from './order';
3 | import { BasePaginationInput } from '@ui/core';
4 |
5 | export class SchemaPaginationInput extends BasePaginationInput(
6 | SchemaWhereInput,
7 | SchemaOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
--------------------------------------------------------------------------------
/api/src/core/index.ts:
--------------------------------------------------------------------------------
1 | export * from './services';
2 | export * from './filters';
3 | export * from './interceptor';
4 | export * from './middlewares';
5 | export * from './common';
6 | export * from './decorators';
7 | export * from './config';
8 | export * from './functions';
9 | export * from './adapters';
10 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/prompt.json:
--------------------------------------------------------------------------------
1 | {
2 | "PromptIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "UserIsNotEmpty": "user should not be empty",
5 | "ModelIdIsNotEmpty": "modelId should not be empty",
6 | "ModelTypeIsNotEmpty": "modelType should not be empty"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/schema-data/schema-data.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { SchemaData } from './schema-data.model';
4 |
5 | @ObjectType()
6 | export class SchemaDataPaginationOutput extends BasePaginationOutput(SchemaData) {}
7 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class CatalogueOrderInput extends BaseOrder {
4 | name?: SortOrder;
5 | type?: SortOrder;
6 | sort?: SortOrder;
7 | many?: SortOrder;
8 | resourceId?: SortOrder;
9 | variableId?: SortOrder;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { CatalogueWhereInput } from './where';
3 | import { CatalogueOrderInput } from './order';
4 |
5 | export class CatalogueSelectInput extends BaseSelectInput(
6 | CatalogueWhereInput,
7 | CatalogueOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { DictionaryWhereInput } from './where';
3 | import { DictionaryOrderInput } from './order';
4 |
5 | export class DictionarySelectInput extends BaseSelectInput(
6 | DictionaryWhereInput,
7 | DictionaryOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/select.input.ts:
--------------------------------------------------------------------------------
1 | import { PermissionWhereInput } from './where';
2 | import { PermissionOrderInput } from './order';
3 | import { BaseSelectInput } from '@ui/core';
4 |
5 | export class PermissionSelectInput extends BaseSelectInput(
6 | PermissionWhereInput,
7 | PermissionOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { SubjectWhereInput } from './where';
3 | import { SubjectOrderInput } from './order';
4 |
5 | export class SubjectPaginationInput extends BasePaginationInput(
6 | SubjectWhereInput,
7 | SubjectOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/api/src/modules/file/file.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { AuthModule } from '../auth';
3 | import { FileService } from '@api/services';
4 |
5 | @Module({
6 | imports: [AuthModule],
7 | providers: [FileService],
8 | exports: [FileService],
9 | })
10 | export class FileModule {}
11 |
--------------------------------------------------------------------------------
/api/src/services/aigc/qianfan/qianfan-stream.input.ts:
--------------------------------------------------------------------------------
1 | import { QianFanModel, QianFanRole } from './qianfan.enum';
2 |
3 | export class QianFanStreamInput {
4 | model: QianFanModel;
5 | messages: QianFanMessage[];
6 | }
7 |
8 | export class QianFanMessage {
9 | role: QianFanRole;
10 | content: string;
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { LanguageWhereInput } from './where';
2 | import { LanguageOrderInput } from './order';
3 | import { BasePaginationInput } from '@ui/core';
4 |
5 | export class LanguagePaginationInput extends BasePaginationInput(
6 | LanguageWhereInput,
7 | LanguageOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { ResourceWhereInput } from './where';
3 | import { ResourceOrderInput } from './order';
4 |
5 | export class ResourcePaginationInput extends BasePaginationInput(
6 | ResourceWhereInput,
7 | ResourceOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class SchemaWhereInput extends BaseWhereInput {
4 | name?: string | StringFilter;
5 | code?: string | StringFilter;
6 | description?: string | StringFilter;
7 | version?: string | StringFilter;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class SubjectWhereInput extends BaseWhereInput {
4 | id?: string | StringFilter;
5 | name?: string | StringFilter;
6 | code?: string | StringFilter;
7 | description?: string | StringFilter;
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@ui/core';
2 |
3 | export class VariableOrderInput extends BaseOrder {
4 | code?: SortOrder;
5 | type?: SortOrder;
6 | sort?: SortOrder;
7 | source?: SortOrder;
8 | resourceId?: SortOrder;
9 | variableCategoryId?: SortOrder;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { VariableWhereInput } from './where';
3 | import { VariableOrderInput } from './order';
4 |
5 | export class VariablePaginationInput extends BasePaginationInput(
6 | VariableWhereInput,
7 | VariableOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250908121731_update_prompt/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - Added the required column `modelType` to the `sys-prompt` table without a default value. This is not possible if the table is not empty.
5 |
6 | */
7 | -- AlterTable
8 | ALTER TABLE "sys-prompt" ADD COLUMN "modelType" TEXT NOT NULL;
9 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "SchemaIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "NameIsExist": "name already exist",
5 | "CodeIsNotEmpty": "code should not be empty",
6 | "CodeIsExist": "code already exist",
7 | "JsonIsNotEmpty": "json should not be empty"
8 | }
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { CatalogueWhereInput } from './where';
3 | import { CatalogueOrderInput } from './order';
4 |
5 | export class CataloguePaginationInput extends BasePaginationInput(
6 | CatalogueWhereInput,
7 | CatalogueOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/include.ts:
--------------------------------------------------------------------------------
1 | import { PermissionOrderInput, PermissionWhereInput } from '../permission';
2 |
3 | class PermissionsInclude {
4 | where?: PermissionWhereInput;
5 | orderBy?: PermissionOrderInput[];
6 | }
7 |
8 | export class ResourceIncludeInput {
9 | permissions?: PermissionsInclude;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/schema-data.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit, JsonValue } from '@ui/core';
2 | import { Schema } from '../schema/schema.model';
3 |
4 | export class SchemaData extends BaseAudit {
5 | id!: string;
6 | data!: JsonValue;
7 | schemaId!: string;
8 | schema!: Schema;
9 | formId?: string;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/index.ts:
--------------------------------------------------------------------------------
1 | export * from './editor/editor.component';
2 | export * from './json-schema';
3 | export * from './schema-form/schema-form.component';
4 | export * from './theme/theme.component';
5 | export * from './ai-dialog/ai-dialog.component';
6 | export * from './ai-conversation/ai-conversation.component';
7 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/variable-category.json:
--------------------------------------------------------------------------------
1 | {
2 | "VariableCategoryIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "CodeIsNotEmpty": "code should not be empty",
5 | "ResourceIdIsNotEmpty": "resourceId should not be empty",
6 | "ResourceIdIsNotExist": "resourceId is not exist"
7 | }
8 |
--------------------------------------------------------------------------------
/api/src/services/role/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { RoleWhereInput } from './where';
3 | import { RoleOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class RoleSelectInput extends BaseSelectInput(RoleWhereInput, RoleOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/user/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { UserWhereInput } from './where';
3 | import { UserOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class UserSelectInput extends BaseSelectInput(UserWhereInput, UserOrderInput) {}
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { DictionaryWhereInput } from './where';
2 | import { DictionaryOrderInput } from './order';
3 | import { BasePaginationInput } from '@ui/core';
4 |
5 | export class DictionaryPaginationInput extends BasePaginationInput(
6 | DictionaryWhereInput,
7 | DictionaryOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/model.enum.ts:
--------------------------------------------------------------------------------
1 | export enum ModelDescription {
2 | Model = '',
3 |
4 | Name = '模型名称',
5 | Code = '模型代码',
6 | Platform = '平台',
7 | Description = '模型描述'
8 | }
9 |
10 | export enum ModelMessage {
11 | CreatedSuccess = '新增成功',
12 | UpdatedSuccess = '更新成功',
13 | DeletedSuccess = '删除成功'
14 | }
15 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { PermissionWhereInput } from './where';
3 | import { PermissionOrderInput } from './order';
4 |
5 | export class PermissionPaginationInput extends BasePaginationInput(
6 | PermissionWhereInput,
7 | PermissionOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/create.input.ts:
--------------------------------------------------------------------------------
1 | import { ResourceCode } from './resource.model';
2 |
3 | export class ResourceCreateInput {
4 | type?: string;
5 | icon?: string;
6 | name!: string;
7 | code!: ResourceCode;
8 | sort!: number;
9 | description?: string;
10 | subjectId!: string;
11 | pid?: string;
12 | }
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/role.enum.ts:
--------------------------------------------------------------------------------
1 | export enum RoleDescription {
2 | Role = '角色',
3 |
4 | Name = '角色名称',
5 | Description = '角色描述'
6 | }
7 |
8 | export enum RoleMessage {
9 | CreatedSuccess = '新增角色成功',
10 | UpdatedSuccess = '更新角色成功',
11 | DeletedSuccess = '删除角色成功',
12 | UpdatedPermissionsSuccess = '更新角色权限成功'
13 | }
14 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { SchemaDataWhereInput } from './where';
2 | import { SchemaDataOrderInput } from './order';
3 | import { BasePaginationInput } from '@ui/core';
4 |
5 | export class SchemaDataPaginationInput extends BasePaginationInput(
6 | SchemaDataWhereInput,
7 | SchemaDataOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
5 | NG-NEST-ADMIN
6 |
7 |
8 | 新版本后端 `nestjs` 将使用 GraphQL + Prisma 来开发,目前处于开发中。
9 |
10 | 之前的版本可以切换分支到 `16.0.x` 中查看 [Demo 地址](http://adminui.ngnest.com)
11 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/dictionary.json:
--------------------------------------------------------------------------------
1 | {
2 | "DictionaryIdIsNotEmpty": "字典编码不能为空",
3 | "PidIsNotExist": "字典父节点编码不存在",
4 | "NameIsNotEmpty": "字典名称不能为空",
5 | "NameIsExist": "字典名称已经存在",
6 | "CodeIsNotEmpty": "字典编码不能为空",
7 | "CodeIsExist": "字典编码已经存在",
8 | "SortIsNotEmpty": "字典排序不能为空",
9 | "SortIsNotNumber": "字典排序应为数字"
10 | }
11 |
--------------------------------------------------------------------------------
/api/src/services/auth/auth.metadata.ts:
--------------------------------------------------------------------------------
1 | import { SetMetadata } from '@nestjs/common';
2 |
3 | export const PERMISSION_KEY = 'routes';
4 | export const Authorization = (...routes: string[]) => SetMetadata(PERMISSION_KEY, routes);
5 |
6 | export const IS_PUBLIC_KEY = 'isPublic';
7 | export const Public = () => SetMetadata(IS_PUBLIC_KEY, true);
8 |
--------------------------------------------------------------------------------
/api/src/services/model/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { ModelWhereInput } from './where';
3 | import { ModelOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class ModelSelectInput extends BaseSelectInput(ModelWhereInput, ModelOrderInput) {}
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/dictionary.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit } from '@ui/core';
2 |
3 | export class Dictionary extends BaseAudit {
4 | id!: string;
5 | pid?: string;
6 | parent?: Dictionary;
7 | children?: Dictionary[];
8 | name!: string;
9 | code!: string;
10 | sort!: number;
11 | description?: string;
12 | }
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/create.input.ts:
--------------------------------------------------------------------------------
1 | import { JsonValue } from '@ui/core';
2 |
3 | export class VariableCreateInput {
4 | code!: string;
5 | type?: string;
6 | value?: JsonValue;
7 | source?: string;
8 | sort?: number;
9 | description?: string;
10 | resourceId!: string;
11 | variableCategoryId!: string;
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/aigc/gemini/gemini.enum.ts:
--------------------------------------------------------------------------------
1 | export const GEMINI_I18N = 'gemini';
2 |
3 | export enum GeminiDescription {
4 | Model = 'Model',
5 | Prompt = 'Prompt',
6 | }
7 |
8 | export enum GeminiRole {
9 | User = 'user',
10 | Model = 'model',
11 | }
12 |
13 | export enum GeminiModel {
14 | GeminiPro = 'gemini-pro',
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/services/prompt/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { PromptWhereInput } from './where';
3 | import { PromptOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class PromptSelectInput extends BaseSelectInput(PromptWhereInput, PromptOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/schema/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { SchemaWhereInput } from './where';
3 | import { SchemaOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class SchemaSelectInput extends BaseSelectInput(SchemaWhereInput, SchemaOrderInput) {}
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/create.input.ts:
--------------------------------------------------------------------------------
1 | import { CatalogueType } from './catalogue.enum';
2 |
3 | export class CatalogueCreateInput {
4 | name!: string;
5 | type!: CatalogueType;
6 | sort!: number;
7 | many?: boolean;
8 | description?: string;
9 | resourceId!: string;
10 | variableId?: string;
11 | pid?: string;
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/aigc/aigc.output.ts:
--------------------------------------------------------------------------------
1 | export class AigcOutput {
2 | text?: string;
3 | inputTokens?: number;
4 | outputTokens?: number;
5 | totalTokens?: number;
6 | requestId?: string;
7 | status?: number;
8 | finished?: boolean;
9 | index?: number;
10 | code?: string;
11 | error?: boolean;
12 | message?: string;
13 | }
14 |
--------------------------------------------------------------------------------
/api/src/services/role/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { RoleWhereInput } from './where';
4 | import { RoleOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class RolePaginationInput extends BasePaginationInput(RoleWhereInput, RoleOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/subject/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { SubjectWhereInput } from './where';
3 | import { SubjectOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class SubjectSelectInput extends BaseSelectInput(SubjectWhereInput, SubjectOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/user/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { UserWhereInput } from './where';
4 | import { UserOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class UserPaginationInput extends BasePaginationInput(UserWhereInput, UserOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/variable-category/variable-category.output.ts:
--------------------------------------------------------------------------------
1 | import { ObjectType } from '@nestjs/graphql';
2 | import { BasePaginationOutput } from '@api/core';
3 | import { VariableCategory } from './variable-category.model';
4 |
5 | @ObjectType()
6 | export class VariableCategoryPaginationOutput extends BasePaginationOutput(VariableCategory) {}
7 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/aigc.json:
--------------------------------------------------------------------------------
1 | {
2 | "TypeIsNotEmpty": "Type cannot be empty",
3 | "TypeIsIn": "Type must be specified in the list",
4 | "ModelIsNotEmpty": "Model cannot be empty",
5 | "ModelIsIn": "Model must be specified in the list",
6 | "PromptIsNotEmpty": "Prompt cannot be empty",
7 | "MessagesIsNotEmpty": "The message cannot be empty"
8 | }
9 |
--------------------------------------------------------------------------------
/api/src/services/language/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { LanguageWhereInput } from './where';
3 | import { LanguageOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class LanguageSelectInput extends BaseSelectInput(LanguageWhereInput, LanguageOrderInput) {}
8 |
--------------------------------------------------------------------------------
/api/src/services/model/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { ModelWhereInput } from './where';
4 | import { ModelOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class ModelPaginationInput extends BasePaginationInput(ModelWhereInput, ModelOrderInput) {}
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/update.input.ts:
--------------------------------------------------------------------------------
1 | import { ResourceCode } from './resource.model';
2 |
3 | export class ResourceUpdateInput {
4 | id!: string;
5 | type?: string;
6 | icon?: string;
7 | name!: string;
8 | code!: ResourceCode;
9 | sort!: number;
10 | description?: string;
11 | subjectId!: string;
12 | pid?: string;
13 | }
14 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { VariableCategoryWhereInput } from './where';
3 | import { VariableCategoryOrderInput } from './order';
4 |
5 | export class VariableCategorySelectInput extends BaseSelectInput(
6 | VariableCategoryWhereInput,
7 | VariableCategoryOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/index-routing.module.ts:
--------------------------------------------------------------------------------
1 | import { Routes } from '@angular/router';
2 | import { IndexComponent } from './index.component';
3 | import { AppRoutes } from 'src/app/app-routes';
4 |
5 | export const IndexRoutes: Routes = [
6 | {
7 | path: '',
8 | component: IndexComponent,
9 | children: AppRoutes
10 | }
11 | ];
12 |
--------------------------------------------------------------------------------
/api/prisma/models/model.prisma:
--------------------------------------------------------------------------------
1 | model Model {
2 | id String @id @default(uuid())
3 | name String
4 | code String @unique
5 | description String?
6 | platform String
7 | createdAt DateTime @default(now())
8 | updatedAt DateTime @updatedAt
9 | prompts Prompt[]
10 |
11 | @@map("sys-model")
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/prompt/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { PromptWhereInput } from './where';
4 | import { PromptOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class PromptPaginationInput extends BasePaginationInput(PromptWhereInput, PromptOrderInput) {}
8 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/content/content.component.scss:
--------------------------------------------------------------------------------
1 | @use '../../../../../node_modules/@ng-nest/ui/style/params/index.scss' as *;
2 |
3 | :host {
4 | min-height: 100vh;
5 | background-color: $x-background-a100;
6 | width: 100%;
7 | padding-top: 2.25rem;
8 | padding-left: 15rem;
9 | transition: padding 0.3s;
10 | display: block;
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/app/pages/cache/cache-group/cache-group.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .attrs {
3 | .item {
4 | align-items: center;
5 | label {
6 | width: initial;
7 | }
8 | }
9 | }
10 | .app-table {
11 | padding: 0;
12 | margin: 0;
13 |
14 | tr td {
15 | padding: 0.5rem 0.75rem;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ui/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "include": [
11 | "src/**/*.spec.ts",
12 | "src/**/*.d.ts"
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/api/src/modules/openai/openai.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { OpenAIController } from './openai.controller';
3 | import { DashscopeService, OpenAIService } from '@api/services';
4 |
5 | @Module({
6 | controllers: [OpenAIController],
7 | providers: [OpenAIService, DashscopeService],
8 | })
9 | export class OpenAIModule {}
10 |
--------------------------------------------------------------------------------
/api/src/services/aigc/aigc.constants.ts:
--------------------------------------------------------------------------------
1 | import { AigcType } from './aigc.enum';
2 | import { QWEN_MODELS } from './dashscope';
3 | import { GEMINI_MODELS } from './gemini';
4 | import { QIANFAN_MODELS } from './qianfan';
5 |
6 | export const AIGC_TYPES = Object.values(AigcType);
7 | export const AIGC_MODELS = [...QWEN_MODELS, ...GEMINI_MODELS, ...QIANFAN_MODELS];
8 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/subject.enum.ts:
--------------------------------------------------------------------------------
1 | export enum SubjectDescription {
2 | Subject = '资源分类',
3 |
4 | Id = '资源分类编码',
5 | Name = '资源分类名称',
6 | Code = '资源分类标识',
7 | Description = '资源分类描述'
8 | }
9 |
10 | export enum SubjectMessage {
11 | CreatedSuccess = '新增资源分类成功',
12 | UpdatedSuccess = '更新资源分类成功',
13 | DeletedSuccess = '删除资源分类成功'
14 | }
15 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "UserIdIsNotEmpty": "用户编码不能为空",
3 | "NameIsNotEmpty": "用户名称不能为空",
4 | "NameIsExist": "用户名称已存在",
5 | "AccountIsNotEmpty": "用户账号不能为空",
6 | "AccountIsExist": "用户账号已存在",
7 | "PasswordIsNotEmpty": "用户密码不能为空",
8 | "EmailIsNotEmpty": "用户邮箱不能为空",
9 | "EmailIsExist": "用户邮箱已存在",
10 | "PhoneIsExist": "用户手机号已存在"
11 | }
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, DateTimeFilter, StringFilter } from '@ui/core';
2 |
3 | export class UserWhereInput extends BaseWhereInput {
4 | name?: StringFilter;
5 | account?: StringFilter;
6 | email?: StringFilter;
7 | phone?: StringFilter;
8 | createdAt?: DateTimeFilter;
9 | updatedAt?: DateTimeFilter;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@ui/core';
2 | import { VariableCategoryWhereInput } from './where';
3 | import { VariableCategoryOrderInput } from './order';
4 |
5 | export class VariableCategoryPaginationInput extends BasePaginationInput(
6 | VariableCategoryWhereInput,
7 | VariableCategoryOrderInput
8 | ) {}
9 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/content/content.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterOutlet } from '@angular/router';
3 |
4 | @Component({
5 | selector: 'app-content',
6 | imports: [RouterOutlet],
7 | templateUrl: './content.component.html',
8 | styleUrls: ['./content.component.scss']
9 | })
10 | export class ContentComponent {}
11 |
--------------------------------------------------------------------------------
/ui/src/main.ts:
--------------------------------------------------------------------------------
1 | import { bootstrapApplication } from '@angular/platform-browser';
2 | import { appConfig } from './app/app.config';
3 | import { AppComponent } from './app/app.component';
4 | import { CreateMonacoConfig } from './app/monaco-editor.config';
5 |
6 | CreateMonacoConfig();
7 |
8 | bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));
9 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250608055148_catalogue_update_file_type/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - The `fileType` column on the `sys-catalogue` table would be dropped and recreated. This will lead to data loss if there is data in the column.
5 |
6 | */
7 | -- AlterTable
8 | ALTER TABLE "sys-catalogue" DROP COLUMN "fileType",
9 | ADD COLUMN "fileType" TEXT;
10 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/ai-dialog/ai-dialog.component.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/api/src/services/variable/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { VariableWhereInput } from './where';
3 | import { VariableOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class VariableSelectInput extends BaseSelectInput(
8 | VariableWhereInput,
9 | VariableOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/cache/cache.enum.ts:
--------------------------------------------------------------------------------
1 | export enum CacheDescription {
2 | Cache = 'Cache',
3 |
4 | Key = 'CacheKey',
5 | Value = 'Value',
6 | Expiretime = 'Expiretime',
7 |
8 | Type = '分类',
9 | Keys = '查询条件'
10 | }
11 |
12 | export enum CacheMessage {
13 | UpdatedSuccess = '更新缓存成功',
14 | DeletedSuccess = '删除缓存成功',
15 | DeletedAllSuccess = '删除所有缓存成功'
16 | }
17 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/prompt.enum.ts:
--------------------------------------------------------------------------------
1 | export enum PromptDescription {
2 | Prompt = '提示词',
3 |
4 | Name = '名称',
5 | System = '系统',
6 | Code = '模型',
7 | Platform = '平台',
8 | PromptVars = '提示词变量',
9 | Description = '描述'
10 | }
11 |
12 | export enum PromptMessage {
13 | CreatedSuccess = '新增成功',
14 | UpdatedSuccess = '更新成功',
15 | DeletedSuccess = '删除成功'
16 | }
17 |
--------------------------------------------------------------------------------
/ui/src/app/pages/json/json.component.html:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
--------------------------------------------------------------------------------
/api/prisma.config.ts:
--------------------------------------------------------------------------------
1 | import path from 'node:path';
2 | import type { PrismaConfig } from 'prisma';
3 | import { config } from 'dotenv';
4 |
5 | config({ path: path.resolve(process.cwd(), '.env') });
6 |
7 | type Env = {
8 | DATABASE_URL: string;
9 | };
10 |
11 | export default {
12 | earlyAccess: true,
13 | schema: path.join('prisma'),
14 | } satisfies PrismaConfig;
15 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/language.json:
--------------------------------------------------------------------------------
1 | {
2 | "LanguageIdIsNotEmpty": "Language code cannot be empty",
3 | "KeyIsNotEmpty": "Language key cannot be empty",
4 | "KeyIsExist": "Language key already exists",
5 | "ValueIsNotEmpty": "Language value cannot be empty",
6 | "ValueIsExist": "Language value already exists",
7 | "LanguageCodeIsNotEmpty": "Associated language cannot be empty"
8 | }
9 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/permission.json:
--------------------------------------------------------------------------------
1 | {
2 | "PermissionIdIsNotEmpty": "许可编码不能为空",
3 | "NameIsNotEmpty": "许可名称不能为空",
4 | "NameIsExist": "许可名称已经存在",
5 | "CodeIsNotEmpty": "许可编码不能为空",
6 | "CodeIsExist": "许可编码已经存在",
7 | "SortIsNotEmpty": "许可排序不能为空",
8 | "SortIsNotNumber": "许可排序应为数字",
9 | "ResourceIdIsNotEmpty": "资源编码不能为空",
10 | "ResourceIdIsNotExist": "资源编码不存在"
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/services/aigc/dashscope/qwen.enum.ts:
--------------------------------------------------------------------------------
1 | export const QWEN_I18N = 'qwen';
2 |
3 | export enum QwenDescription {
4 | Model = 'Model',
5 | Prompt = 'Prompt',
6 | }
7 |
8 | export enum QwenRole {
9 | System = 'system',
10 | User = 'user',
11 | Assistant = 'assistant',
12 | }
13 |
14 | export enum QwenModel {
15 | Qwen18BChat = 'qwen3-235b-a22b-instruct-2507',
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/services/aigc/index.ts:
--------------------------------------------------------------------------------
1 | export * from './aigc.constants';
2 | export * from './aigc.enum';
3 | export * from './aigc.input';
4 | export * from './aigc.output';
5 | export * from './aigc-stream.output';
6 | export * from './aigc-stream.input';
7 | export * from './aigc.service';
8 | export * from './dashscope';
9 | export * from './gemini';
10 | export * from './qianfan';
11 |
--------------------------------------------------------------------------------
/api/src/services/schema/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { SchemaWhereInput } from './where';
4 | import { SchemaOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class SchemaPaginationInput extends BasePaginationInput(
8 | SchemaWhereInput,
9 | SchemaOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/update.input.ts:
--------------------------------------------------------------------------------
1 | import { CatalogueType } from './catalogue.enum';
2 |
3 | export class CatalogueUpdateInput {
4 | id!: string;
5 | name?: string;
6 | type?: CatalogueType;
7 | sort?: number;
8 | many?: boolean;
9 | description?: string;
10 | content?: string;
11 | resourceId?: string;
12 | variableId?: string;
13 | pid?: string;
14 | }
15 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, NumberFilter, StringFilter } from '@ui/core';
2 |
3 | export class DictionaryWhere {
4 | name?: StringFilter;
5 | code?: StringFilter;
6 | sort?: NumberFilter;
7 | description?: StringFilter;
8 | pid?: StringFilter;
9 | }
10 |
11 | export class DictionaryWhereInput extends BaseWhereInput {}
12 |
--------------------------------------------------------------------------------
/api/src/core/decorators/gql-current-user.decorator.ts:
--------------------------------------------------------------------------------
1 | import { createParamDecorator, ExecutionContext } from '@nestjs/common';
2 | import { GqlExecutionContext } from '@nestjs/graphql';
3 |
4 | export const GqlCurrentUser = createParamDecorator((_data: unknown, context: ExecutionContext) => {
5 | const ctx = GqlExecutionContext.create(context);
6 | return ctx.getContext().req.user;
7 | });
8 |
--------------------------------------------------------------------------------
/api/src/services/aigc/qianfan/qianfan.enum.ts:
--------------------------------------------------------------------------------
1 | export const QIAN_FAN_I18N = 'qianfan';
2 |
3 | export enum QianFanDescription {
4 | Model = 'Model',
5 | Prompt = 'Prompt',
6 | }
7 |
8 | export enum QianFanRole {
9 | Function = 'function',
10 | User = 'user',
11 | Assistant = 'assistant',
12 | }
13 |
14 | export enum QianFanModel {
15 | ERNIE358k = 'ERNIE-3.5-8K',
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/services/catalogue/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { CatalogueWhereInput } from './where';
3 | import { CatalogueOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class CatalogueSelectInput extends BaseSelectInput(
8 | CatalogueWhereInput,
9 | CatalogueOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/subject/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { SubjectWhereInput } from './where';
4 | import { SubjectOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class SubjectPaginationInput extends BasePaginationInput(
8 | SubjectWhereInput,
9 | SubjectOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, StringFilter } from '@ui/core';
2 |
3 | export class PromptWhereInput extends BaseWhereInput {
4 | name?: StringFilter;
5 | prompt?: StringFilter;
6 | system?: StringFilter;
7 | code?: StringFilter;
8 | platform?: StringFilter;
9 | promptVars?: StringFilter;
10 | description?: StringFilter;
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/catalogue.json:
--------------------------------------------------------------------------------
1 | {
2 | "CatalogueIdIsNotEmpty": "节点编码不能为空",
3 | "PidIsNotExist": "节点父节点编码不存在",
4 | "NameIsNotEmpty": "节点名称不能为空",
5 | "TypeIsNotEmpty": "节点类型不能为空",
6 | "SortIsNotEmpty": "节点排序不能为空",
7 | "SortIsNotNumber": "节点排序应为数字",
8 | "ResourceIdIsNotEmpty": "资源编码不能为空",
9 | "ResourceIdIsNotExist": "资源编码不存在",
10 | "VariableIdIsNotExist": "变量编码不存在"
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/services/dictionary/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { DictionaryWhereInput } from './where';
3 | import { DictionaryOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class DictionarySelectInput extends BaseSelectInput(
8 | DictionaryWhereInput,
9 | DictionaryOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/language/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { LanguageWhereInput } from './where';
4 | import { LanguageOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class LanguagePaginationInput extends BasePaginationInput(
8 | LanguageWhereInput,
9 | LanguageOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/permission/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { PermissionWhereInput } from './where';
3 | import { PermissionOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class PermissionSelectInput extends BaseSelectInput(
8 | PermissionWhereInput,
9 | PermissionOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/resource/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { ResourceWhereInput } from './where';
4 | import { ResourceOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class ResourcePaginationInput extends BasePaginationInput(
8 | ResourceWhereInput,
9 | ResourceOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/schema-data/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { SchemaDataWhereInput } from './where';
3 | import { SchemaDataOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class SchemaDataSelectInput extends BaseSelectInput(
8 | SchemaDataWhereInput,
9 | SchemaDataOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/variable/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { VariableWhereInput } from './where';
4 | import { VariableOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class VariablePaginationInput extends BasePaginationInput(
8 | VariableWhereInput,
9 | VariableOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/index.ts:
--------------------------------------------------------------------------------
1 | export * from './language.enum';
2 | export * from './language.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './language.output';
9 | export * from './select.output';
10 | export * from './language.service';
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/select.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseSelectInput } from '@ui/core';
2 | import { ResourceWhereInput } from './where';
3 | import { ResourceOrderInput } from './order';
4 | import { ResourceIncludeInput } from './include';
5 |
6 | export class ResourceSelectInput extends BaseSelectInput(
7 | ResourceWhereInput,
8 | ResourceOrderInput,
9 | ResourceIncludeInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, JsonFilter, StringFilter } from '@ui/core';
2 | import { SchemaWhereInput } from '../schema/where';
3 |
4 | export class SchemaDataWhereInput extends BaseWhereInput {
5 | data?: JsonFilter;
6 | schemaId?: string | StringFilter;
7 | formId?: string | StringFilter;
8 | schema?: SchemaWhereInput;
9 | }
10 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/user.enum.ts:
--------------------------------------------------------------------------------
1 | export enum UserDescription {
2 | User = '用户',
3 |
4 | Name = '用户名称',
5 | Account = '用户账号',
6 | Password = '用户密码',
7 | Email = '用户邮箱',
8 | Phone = '用户手机号'
9 | }
10 |
11 | export enum UserMessage {
12 | CreatedSuccess = '新增用户成功',
13 | UpdatedSuccess = '更新用户成功',
14 | DeletedSuccess = '删除用户成功',
15 | PasswordResetSuccess = '重置用户密码成功'
16 | }
17 |
--------------------------------------------------------------------------------
/ui/src/app/app.config.server.ts:
--------------------------------------------------------------------------------
1 | import { provideServerRendering } from '@angular/ssr';
2 | import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
3 | import { appConfig } from './app.config';
4 |
5 | const serverConfig: ApplicationConfig = {
6 | providers: [provideServerRendering()]
7 | };
8 |
9 | export const config = mergeApplicationConfig(appConfig, serverConfig);
10 |
--------------------------------------------------------------------------------
/ui/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Angular
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/ui/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": [
9 | "src/main.ts",
10 | "src/main.server.ts",
11 | "server.ts"
12 | ],
13 | "include": [
14 | "src/**/*.d.ts"
15 | ]
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/file.json:
--------------------------------------------------------------------------------
1 | {
2 | "UidIsNotEmpty": "Uid 不能为空",
3 | "NameIsNotEmpty": "名称不能为空",
4 | "ActualnameIsNotEmpty": "实际名称不能为空",
5 | "StatusIsNotEmpty": "状态不能为空",
6 | "StatusIsIn": "状态必须在指定的列表中",
7 | "SizeIsNotEmpty": "文件大小不能为空",
8 | "MimetypeIsNotEmpty": "文件类型不能为空",
9 | "KeyIsNotEmpty": "文件路径不能为空",
10 | "KeyIsExist": "文件路径已经存在",
11 | "UrlIsNotEmpty": "文件地址不能为空"
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/cache/cache-keys.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType, Field } from '@nestjs/graphql';
2 | import { IsOptional } from 'class-validator';
3 | import { CacheDescription } from './cache.enum';
4 |
5 | @ArgsType()
6 | export class CacheKeysInput {
7 | @Field(() => String, { description: CacheDescription.Key, defaultValue: '*', nullable: true })
8 | @IsOptional()
9 | key?: string;
10 | }
11 |
--------------------------------------------------------------------------------
/ui/src/app/pages/role/role-permission/role-permission.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | x-table {
3 | ::ng-deep {
4 | .x-checkbox-row-list {
5 | flex-wrap: wrap;
6 | }
7 | .x-checkbox-row-item {
8 | margin-top: 0.5rem;
9 | }
10 | }
11 | }
12 | .permissions,
13 | .name {
14 | margin-top: -0.5rem;
15 | display: inline-flex;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/api/src/services/catalogue/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { CatalogueWhereInput } from './where';
4 | import { CatalogueOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class CataloguePaginationInput extends BasePaginationInput(
8 | CatalogueWhereInput,
9 | CatalogueOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/user.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit, BaseModel } from '@ui/core';
2 | import { Role } from '../role/role.model';
3 |
4 | export class User extends BaseModel {
5 | name!: string;
6 | account!: string;
7 | email!: string;
8 | phone?: string;
9 | roles?: UserRole[];
10 | }
11 |
12 | export class UserRole extends BaseAudit {
13 | roleId?: string;
14 | role?: Role;
15 | }
16 |
--------------------------------------------------------------------------------
/ui/src/app/core/services/index.ts:
--------------------------------------------------------------------------------
1 | export * from './app-initalizer';
2 | export * from './auth.service';
3 | export * from './auth-guard';
4 | export * from './http.interceptor';
5 | export * from './config.service';
6 | export * from './prism.service';
7 | export * from './form.service';
8 | export * from './locale.service';
9 | export * from './icon.service';
10 | export * from './theme.service';
11 |
--------------------------------------------------------------------------------
/api/src/services/dictionary/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { DictionaryWhereInput } from './where';
4 | import { DictionaryOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class DictionaryPaginationInput extends BasePaginationInput(
8 | DictionaryWhereInput,
9 | DictionaryOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/permission/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { PermissionWhereInput } from './where';
4 | import { PermissionOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class PermissionPaginationInput extends BasePaginationInput(
8 | PermissionWhereInput,
9 | PermissionOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/schema-data/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { SchemaDataWhereInput } from './where';
4 | import { SchemaDataOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class SchemaDataPaginationInput extends BasePaginationInput(
8 | SchemaDataWhereInput,
9 | SchemaDataOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/variable.json:
--------------------------------------------------------------------------------
1 | {
2 | "VariableIdIsNotEmpty": "id should not be empty",
3 | "CodeIsNotEmpty": "code should not be empty",
4 | "ResourceIdIsNotEmpty": "resourceId should not be empty",
5 | "ResourceIdIsNotExist": "resourceId is not exist",
6 | "VariableCategoryIdIsNotEmpty": "variableCategoryId should not be empty",
7 | "VariableCategoryIdIsNotExist": "variableCategoryId is not exist"
8 | }
9 |
--------------------------------------------------------------------------------
/api/src/services/file/file.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { FileCreateInput } from './create.input';
3 | import { PrismaService } from '@api/core';
4 |
5 | @Injectable()
6 | export class FileService {
7 | constructor(private prisma: PrismaService) {}
8 |
9 | async create(data: FileCreateInput) {
10 | return await this.prisma.file.create({ data });
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/model/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./model.enum";
2 | export * from "./model.model";
3 | export * from "./create.input";
4 | export * from "./update.input";
5 | export * from "./order";
6 | export * from "./pagination.input";
7 | export * from "./where";
8 | export * from "./model.output";
9 | export * from "./select.input";
10 | export * from "./select.output";
11 | export * from "./model.service";
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/model/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./model.enum";
2 | export * from "./model.model";
3 | export * from "./create.input";
4 | export * from "./update.input";
5 | export * from "./order";
6 | export * from "./pagination.input";
7 | export * from "./where";
8 | export * from "./model.output";
9 | export * from "./select.input";
10 | export * from "./select.output";
11 | export * from "./model.service";
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/variable.enum.ts:
--------------------------------------------------------------------------------
1 | export enum VariableDescription {
2 | Variable = '节点',
3 |
4 | Id = '变量编码',
5 | Code = '变量标识',
6 | Type = '变量类型',
7 | Value = '变量值',
8 | Source = '变量值来源',
9 | Sort = '排序',
10 | Description = '变量描述'
11 | }
12 |
13 | export enum VariableMessage {
14 | CreatedSuccess = '新增变量成功',
15 | UpdatedSuccess = '更新变量成功',
16 | DeletedSuccess = '删除变量成功'
17 | }
18 |
--------------------------------------------------------------------------------
/ui/src/app/core/functions/parse-gitignore.ts:
--------------------------------------------------------------------------------
1 | import ignore from 'ignore';
2 |
3 | export function AppParseGitignore(gitignoreContent: string, allPaths: string[]) {
4 | const ig = ignore();
5 | ig.add(gitignoreContent);
6 |
7 | const ignored = new Set();
8 | for (const path of allPaths) {
9 | if (ig.ignores(path)) {
10 | ignored.add(path);
11 | }
12 | }
13 | return ignored;
14 | }
15 |
--------------------------------------------------------------------------------
/api/src/i18n/zh-cn/resource.json:
--------------------------------------------------------------------------------
1 | {
2 | "ResourceIdIsNotEmpty": "资源编码不能为空",
3 | "PidIsNotExist": "资源父节点编码不存在",
4 | "NameIsNotEmpty": "资源名称不能为空",
5 | "NameIsExist": "资源名称已经存在",
6 | "CodeIsNotEmpty": "资源编码不能为空",
7 | "CodeIsExist": "资源编码已经存在",
8 | "SortIsNotEmpty": "资源排序不能为空",
9 | "SortIsNotNumber": "资源排序应为数字",
10 | "SubjectIdIsNotEmpty": "资源分类编码不能为空",
11 | "SubjectIdIsNotExist": "资源分类编码不存在"
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/prompt/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./prompt.enum";
2 | export * from "./prompt.model";
3 | export * from "./create.input";
4 | export * from "./update.input";
5 | export * from "./order";
6 | export * from "./pagination.input";
7 | export * from "./where";
8 | export * from "./prompt.output";
9 | export * from "./select.input";
10 | export * from "./select.output";
11 | export * from "./prompt.service";
12 |
--------------------------------------------------------------------------------
/api/src/services/schema/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema.enum';
2 | export * from './schema.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './schema.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './schema.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/prompt/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./prompt.enum";
2 | export * from "./prompt.model";
3 | export * from "./create.input";
4 | export * from "./update.input";
5 | export * from "./order";
6 | export * from "./pagination.input";
7 | export * from "./where";
8 | export * from "./prompt.output";
9 | export * from "./select.input";
10 | export * from "./select.output";
11 | export * from "./prompt.service";
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema.enum';
2 | export * from './schema.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './schema.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './schema.service';
12 |
--------------------------------------------------------------------------------
/ui/tsconfig.worker.json:
--------------------------------------------------------------------------------
1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/worker",
6 | "lib": [
7 | "es2022",
8 | "webworker"
9 | ],
10 | "types": []
11 | },
12 | "include": [
13 | "src/**/*.worker.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/modules/aigc/aigc.controller.ts:
--------------------------------------------------------------------------------
1 | import { AigcInput, AigcService } from '@api/services';
2 | import { Body, Controller, Post } from '@nestjs/common';
3 |
4 | @Controller('aigc')
5 | export class AigcController {
6 | constructor(private readonly aigcService: AigcService) {}
7 |
8 | @Post()
9 | textGeneration(@Body() input: AigcInput) {
10 | return this.aigcService.textGeneration(input);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/subject/index.ts:
--------------------------------------------------------------------------------
1 | export * from './subject.enum';
2 | export * from './subject.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './subject.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './subject.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/subject/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './select.input';
7 | export * from './select.output';
8 | export * from './subject.enum';
9 | export * from './subject.model';
10 | export * from './subject.output';
11 | export * from './subject.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/variable-category.enum.ts:
--------------------------------------------------------------------------------
1 | export enum VariableCategoryDescription {
2 | VariableCategory = '变量分类',
3 |
4 | Id = '变量分类编码',
5 | Name = '变量分类名称',
6 | Code = '变量分类标识',
7 | Sort = '排序',
8 | Description = '变量描述'
9 | }
10 |
11 | export enum VariableCategoryMessage {
12 | CreatedSuccess = '新增变量分类成功',
13 | UpdatedSuccess = '更新变量分类成功',
14 | DeletedSuccess = '删除变量分类成功'
15 | }
16 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/variable-category.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseModel } from '@ui/core';
2 |
3 | export class VariableCategory extends BaseModel {
4 | name!: string;
5 | code!: string;
6 | description?: string;
7 | sort?: number;
8 | resource!: VariableCategoryResource;
9 | resourceId!: string;
10 | }
11 |
12 | export class VariableCategoryResource {
13 | id!: string;
14 | name!: string;
15 | }
16 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250420035010_update_catalogue/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - Added the required column `type` to the `sys-catalogue` table without a default value. This is not possible if the table is not empty.
5 |
6 | */
7 | -- CreateEnum
8 | CREATE TYPE "CatalogueType" AS ENUM ('Folder', 'File');
9 |
10 | -- AlterTable
11 | ALTER TABLE "sys-catalogue" ADD COLUMN "type" "CatalogueType" NOT NULL;
12 |
--------------------------------------------------------------------------------
/api/src/services/language/index.ts:
--------------------------------------------------------------------------------
1 | export * from './language.enum';
2 | export * from './language.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './language.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './language.service';
12 |
--------------------------------------------------------------------------------
/api/src/services/variable-category/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { VariableCategoryWhereInput } from './where';
3 | import { VariableCategoryOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 |
6 | @ArgsType()
7 | export class VariableCategorySelectInput extends BaseSelectInput(
8 | VariableCategoryWhereInput,
9 | VariableCategoryOrderInput,
10 | ) {}
11 |
--------------------------------------------------------------------------------
/api/src/services/catalogue/index.ts:
--------------------------------------------------------------------------------
1 | export * from './catalogue.enum';
2 | export * from './catalogue.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './catalogue.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './catalogue.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/catalogue/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './select.input';
7 | export * from './select.output';
8 | export * from './catalogue.enum';
9 | export * from './catalogue.model';
10 | export * from './catalogue.output';
11 | export * from './catalogue.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/create.input.ts:
--------------------------------------------------------------------------------
1 | import { BaseCreateWithoutInput } from '@ui/core';
2 |
3 | export class UserCreateInput {
4 | name!: string;
5 | account!: string;
6 | password!: string;
7 | email!: string;
8 | phone?: string;
9 | roles?: CreateUserRole;
10 | }
11 |
12 | export class CreateUserRole extends BaseCreateWithoutInput {}
13 |
14 | export class CreateRole {
15 | roleId!: string;
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/dictionary.json:
--------------------------------------------------------------------------------
1 | {
2 | "DictionaryIdIsNotEmpty": "id should not be empty",
3 | "PidIsNotExist": "pid is not exist",
4 | "NameIsNotEmpty": "name should not be empty",
5 | "NameIsExist": "name already exist",
6 | "CodeIsNotEmpty": "code should not be empty",
7 | "CodeIsExist": "code already exist",
8 | "SortIsNotEmpty": "sort should not be empty",
9 | "SortIsNotNumber": "sort should be number"
10 | }
11 |
--------------------------------------------------------------------------------
/api/src/services/dictionary/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dictionary.enum';
2 | export * from './dictionary.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './dictionary.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './dictionary.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/dictionary/index.ts:
--------------------------------------------------------------------------------
1 | export * from './dictionary.enum';
2 | export * from './dictionary.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './dictionary.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './dictionary.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/core/services/auth-guard.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { CanActivateFn } from '@angular/router';
3 | import { AppAuthService } from './auth.service';
4 |
5 | export const AppCanActivate: CanActivateFn = (route) => {
6 | return inject(AppAuthService).canActivate(route);
7 | };
8 |
9 | export const AppCanLoad: CanActivateFn = (route) => {
10 | return inject(AppAuthService).canLoad(route);
11 | };
12 |
--------------------------------------------------------------------------------
/api/src/core/decorators/cache.decorator.ts:
--------------------------------------------------------------------------------
1 | import { SetMetadata } from '@nestjs/common';
2 |
3 | export const CACHE_PREFIX = 'Cache';
4 |
5 | export const CACHE_CONTROL_METADATA = 'cache_control';
6 | export const CacheControl = (key: string) => SetMetadata(CACHE_CONTROL_METADATA, key);
7 |
8 | export const CACHE_CLEAR_METADATA = 'cache_clear';
9 | export const CacheClear = (...keys: string[]) => SetMetadata(CACHE_CLEAR_METADATA, keys);
10 |
--------------------------------------------------------------------------------
/api/src/services/schema-data/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema-data.enum';
2 | export * from './schema-data.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './schema-data.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './schema-data.service';
12 |
--------------------------------------------------------------------------------
/api/src/services/upload/upload.enum.ts:
--------------------------------------------------------------------------------
1 | export const UPLOAD_I18N = 'upload';
2 |
3 | export enum UploadAuth {}
4 |
5 | export enum UploadDescription {
6 | Upload = 'Upload',
7 |
8 | Id = 'UploadId',
9 | Uid = 'Uid',
10 | Name = 'Name',
11 | Actualname = 'Actualname',
12 | Status = 'Status',
13 | Size = 'Size',
14 | Mimetype = 'Mimetype',
15 | Key = 'Key',
16 | Url = 'Url',
17 |
18 | Filepath = 'Filepath',
19 | }
20 |
--------------------------------------------------------------------------------
/api/src/services/variable-category/pagination.input.ts:
--------------------------------------------------------------------------------
1 | import { BasePaginationInput } from '@api/core';
2 | import { ArgsType } from '@nestjs/graphql';
3 | import { VariableCategoryWhereInput } from './where';
4 | import { VariableCategoryOrderInput } from './order';
5 |
6 | @ArgsType()
7 | export class VariableCategoryPaginationInput extends BasePaginationInput(
8 | VariableCategoryWhereInput,
9 | VariableCategoryOrderInput
10 | ) {}
11 |
--------------------------------------------------------------------------------
/ui/proxy.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "/graphql": {
3 | "target": "http://127.0.0.1:3000",
4 | "logLevel": "debug",
5 | "ws": true,
6 | "changeOrigin": true,
7 | "secure": false
8 | },
9 | "/api": {
10 | "target": "http://127.0.0.1:3000",
11 | "logLevel": "debug",
12 | "ws": true,
13 | "changeOrigin": true,
14 | "secure": false,
15 | "pathRewrite": {
16 | "^/api": ""
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/index.ts:
--------------------------------------------------------------------------------
1 | export * from './schema-data.enum';
2 | export * from './schema-data.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './schema-data.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './schema-data.service';
12 |
--------------------------------------------------------------------------------
/api/src/services/role/index.ts:
--------------------------------------------------------------------------------
1 | export * from './role.enum';
2 | export * from './role.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './role.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './permission.output';
12 | export * from './role.service';
13 |
--------------------------------------------------------------------------------
/api/src/services/user/index.ts:
--------------------------------------------------------------------------------
1 | export * from './user.enum';
2 | export * from './user.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './reset-password.input';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './order';
9 | export * from './user.output';
10 | export * from './select.input';
11 | export * from './select.output';
12 | export * from './user.service';
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/user/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './reset-password.input';
4 | export * from './pagination.input';
5 | export * from './where';
6 | export * from './order';
7 | export * from './select.input';
8 | export * from './select.output';
9 | export * from './user.enum';
10 | export * from './user.model';
11 | export * from './user.output';
12 | export * from './user.service';
13 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250617133650_variable_category_add_time/migration.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Warnings:
3 |
4 | - Added the required column `updatedAt` to the `sys-variable-category` table without a default value. This is not possible if the table is not empty.
5 |
6 | */
7 | -- AlterTable
8 | ALTER TABLE "sys-variable-category" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
9 | ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL;
10 |
--------------------------------------------------------------------------------
/api/src/modules/logs/logs.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { LogsController } from './logs.controller';
3 | import { AuthModule } from '../auth/auth.module';
4 | import { LogsResolver } from './logs.resolver';
5 | import { LogsService } from '@api/services';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [LogsController],
10 | providers: [LogsResolver, LogsService],
11 | })
12 | export class LogsModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/role/role.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { RoleResolver } from './role.resolver';
3 | import { RoleController } from './role.controller';
4 | import { RoleService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [RoleController],
10 | providers: [RoleResolver, RoleService],
11 | })
12 | export class RoleModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/user/user.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { UserResolver } from './user.resolver';
3 | import { UserController } from './user.controller';
4 | import { UserService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [UserController],
10 | providers: [UserResolver, UserService],
11 | })
12 | export class UserModule {}
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './include';
7 | export * from './select.input';
8 | export * from './select.output';
9 | export * from './resource.enum';
10 | export * from './resource.model';
11 | export * from './resource.output';
12 | export * from './resource.service';
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './select.input';
7 | export * from './select.output';
8 | export * from './role.enum';
9 | export * from './role.model';
10 | export * from './role.output';
11 | export * from './role.service';
12 | export * from './role-permissions.output';
13 |
--------------------------------------------------------------------------------
/api/src/services/auth/auth.model.ts:
--------------------------------------------------------------------------------
1 | import { Field, ObjectType } from '@nestjs/graphql';
2 | import { GraphQLJWT } from 'graphql-scalars';
3 | import { AuthDescription } from './auth.enum';
4 |
5 | @ObjectType()
6 | export class Auth {
7 | @Field(() => GraphQLJWT, { description: AuthDescription.AccessToken })
8 | accessToken: string;
9 |
10 | @Field(() => GraphQLJWT, { description: AuthDescription.RefreshToken })
11 | refreshToken: string;
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/resource/index.ts:
--------------------------------------------------------------------------------
1 | export * from './resource.enum';
2 | export * from './resource.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './include';
9 | export * from './resource.output';
10 | export * from './select.input';
11 | export * from './select.output';
12 | export * from './resource.service';
13 |
--------------------------------------------------------------------------------
/api/src/services/resource/select.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType } from '@nestjs/graphql';
2 | import { ResourceWhereInput } from './where';
3 | import { ResourceOrderInput } from './order';
4 | import { BaseSelectInput } from '@api/core';
5 | import { ResourceIncludeInput } from './include';
6 |
7 | @ArgsType()
8 | export class ResourceSelectInput extends BaseSelectInput(
9 | ResourceWhereInput,
10 | ResourceOrderInput,
11 | ResourceIncludeInput,
12 | ) {}
13 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250626130650_update_resource/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-catalogue" ADD COLUMN "many" BOOLEAN,
3 | ADD COLUMN "variableId" TEXT;
4 |
5 | -- AlterTable
6 | ALTER TABLE "sys-resource" ADD COLUMN "icon" TEXT;
7 |
8 | -- AddForeignKey
9 | ALTER TABLE "sys-catalogue" ADD CONSTRAINT "sys-catalogue_variableId_fkey" FOREIGN KEY ("variableId") REFERENCES "sys-variable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
10 |
--------------------------------------------------------------------------------
/api/prisma/models/prompt.prisma:
--------------------------------------------------------------------------------
1 | model Prompt {
2 | id String @id @default(uuid())
3 | name String
4 | prompt String
5 | system String?
6 | platform String
7 | code String
8 | promptVars Json?
9 | description String?
10 |
11 | createdAt DateTime @default(now())
12 | updatedAt DateTime @updatedAt
13 |
14 | model Model @relation(fields: [code], references: [code])
15 |
16 | @@map("sys-prompt")
17 | }
18 |
--------------------------------------------------------------------------------
/api/src/services/permission/save-many.input.ts:
--------------------------------------------------------------------------------
1 | import { Field, InputType } from '@nestjs/graphql';
2 | import { Permission } from './permission.model';
3 | import { PermissionDescription } from './permission.enum';
4 |
5 | @InputType()
6 | export class PermissionSaveManyInput {
7 | @Field({ description: PermissionDescription.Many })
8 | many: Permission[];
9 |
10 | @Field({ description: PermissionDescription.ResourceId })
11 | resourceId: string;
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/core/decorators/index.ts:
--------------------------------------------------------------------------------
1 | export * from './prisma-select.decorator';
2 | export * from './is-exist.decorator';
3 | export * from './is-not-exist.decorator';
4 | export * from './cache.decorator';
5 | export * from './current-user.decorator';
6 | export * from './gql-current-user.decorator';
7 | export * from './file.decorator';
8 | export * from './files.decorator';
9 | export * from './upload-body.decorator';
10 | export * from './upload-formdata.decorator';
11 |
--------------------------------------------------------------------------------
/api/src/modules/model/model.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { ModelResolver } from './model.resolver';
3 | import { ModelController } from './model.controller';
4 | import { ModelService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [ModelController],
10 | providers: [ModelResolver, ModelService],
11 | })
12 | export class ModelModule {}
13 |
--------------------------------------------------------------------------------
/api/src/services/aigc/gemini/gemini-stream.input.ts:
--------------------------------------------------------------------------------
1 | import { GeminiRole } from './gemini.enum';
2 |
3 | export class GeminiStreamInput {
4 | contents: GeminiMessage[];
5 | }
6 |
7 | export class GeminiMessage {
8 | role: GeminiRole;
9 | parts: GeminiPart[];
10 | }
11 |
12 | export class GeminiPart {
13 | text?: string;
14 | inlineData?: GeminiInlineData;
15 | }
16 |
17 | export class GeminiInlineData {
18 | mimeType: string;
19 | data: string;
20 | }
21 |
--------------------------------------------------------------------------------
/api/src/services/variable-category/index.ts:
--------------------------------------------------------------------------------
1 | export * from './variable-category.enum';
2 | export * from './variable-category.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './variable-category.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './variable-category.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './select.input';
7 | export * from './select.output';
8 | export * from './variable-category.enum';
9 | export * from './variable-category.model';
10 | export * from './variable-category.output';
11 | export * from './variable-category.service';
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable/index.ts:
--------------------------------------------------------------------------------
1 | export * from './create.input';
2 | export * from './update.input';
3 | export * from './pagination.input';
4 | export * from './where';
5 | export * from './order';
6 | export * from './select.input';
7 | export * from './select.output';
8 | export * from './variable.enum';
9 | export * from './variable.model';
10 | export * from './variable.output';
11 | export * from './variable.service';
12 | export * from './variable-type.input';
13 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/setting/array/array.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .group {
3 | display: grid;
4 | grid-template-columns: 1fr 1fr;
5 | gap: 1rem;
6 | &.one {
7 | grid-template-columns: 1fr;
8 | }
9 | .item {
10 | display: flex;
11 | flex-direction: column;
12 | label {
13 | margin-bottom: 0.125rem;
14 | text-align: left;
15 | width: 100%;
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/api/src/services/auth/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth.enum';
2 | export * from './auth.model';
3 | export * from './auth-payload';
4 | export * from './login.input';
5 | export * from './login-no-code.input';
6 | export * from './refresh-token.input';
7 | export * from './verify-token.input';
8 | export * from './auth.constants';
9 | export * from './jwt-auth.guard';
10 | export * from './auth.guard';
11 | export * from './auth.metadata';
12 | export * from './auth.service';
13 |
--------------------------------------------------------------------------------
/api/src/services/permission/index.ts:
--------------------------------------------------------------------------------
1 | export * from './permission.enum';
2 | export * from './permission.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './permission.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './permission.service';
12 | export * from './save-many.input';
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/permission/index.ts:
--------------------------------------------------------------------------------
1 | export * from './permission.enum';
2 | export * from './permission.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './permission.output';
9 | export * from './select.input';
10 | export * from './select.output';
11 | export * from './permission.service';
12 | export * from './save-many.input';
13 |
--------------------------------------------------------------------------------
/api/src/modules/prompt/prompt.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { PromptResolver } from './prompt.resolver';
3 | import { PromptController } from './prompt.controller';
4 | import { PromptService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [PromptController],
10 | providers: [PromptResolver, PromptService],
11 | })
12 | export class PromptModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/schema/schema.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SchemaResolver } from './schema.resolver';
3 | import { SchemaController } from './schema.controller';
4 | import { SchemaService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [SchemaController],
10 | providers: [SchemaResolver, SchemaService],
11 | })
12 | export class SchemaModule {}
13 |
--------------------------------------------------------------------------------
/api/src/services/cache/cache-group.model.ts:
--------------------------------------------------------------------------------
1 | import { Field, ObjectType } from '@nestjs/graphql';
2 | import { CacheDescription } from './cache.enum';
3 |
4 | @ObjectType()
5 | export class CacheGroup {
6 | @Field(() => String, { description: CacheDescription.Id })
7 | id: string;
8 |
9 | @Field(() => String, { description: CacheDescription.Type })
10 | type: string;
11 |
12 | @Field(() => [String], { description: CacheDescription.Keys })
13 | keys: string[];
14 | }
15 |
--------------------------------------------------------------------------------
/api/prisma/migrations/20250623135501_update_schema/migration.sql:
--------------------------------------------------------------------------------
1 | -- AlterTable
2 | ALTER TABLE "sys-schema" ADD COLUMN "description" TEXT;
3 |
4 | -- CreateTable
5 | CREATE TABLE "sys-schema-data" (
6 | "id" TEXT NOT NULL,
7 | "jsonSchema" JSONB NOT NULL,
8 | "data" JSONB NOT NULL,
9 | "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
10 | "updatedAt" TIMESTAMP(3) NOT NULL,
11 |
12 | CONSTRAINT "sys-schema-data_pkey" PRIMARY KEY ("id")
13 | );
14 |
--------------------------------------------------------------------------------
/ui/src/app/api/resource/resource.enum.ts:
--------------------------------------------------------------------------------
1 | export enum ResourceDescription {
2 | Resource = '资源',
3 |
4 | Id = '资源编码',
5 | Pid = '父节点编码',
6 | Type = '资源类型',
7 | Icon = '资源图标',
8 | Name = '资源名称',
9 | Code = '资源标识',
10 | Sort = '资源排序',
11 | Description = '资源描述',
12 |
13 | Parent = '父资源',
14 | Children = '子资源集合'
15 | }
16 |
17 | export enum ResourceMessage {
18 | CreatedSuccess = '新增资源成功',
19 | UpdatedSuccess = '更新资源成功',
20 | DeletedSuccess = '删除资源成功'
21 | }
22 |
--------------------------------------------------------------------------------
/api/nest-cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/nest-cli",
3 | "collection": "@nestjs/schematics",
4 | "sourceRoot": "src",
5 | "compilerOptions": {
6 | "deleteOutDir": true,
7 | "plugins": [
8 | {
9 | "name": "@nestjs/graphql",
10 | "options": {
11 | "introspectComments": true
12 | }
13 | }
14 | ],
15 | "assets": [{ "include": "i18n/**/*", "outDir": "dist/src", "watchAssets": true }]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/ui/src/app/core/common/base.output.ts:
--------------------------------------------------------------------------------
1 | export interface BasePagination {
2 | data: Array;
3 | count?: number;
4 | }
5 |
6 | export class BasePaginationOutput implements BasePagination {
7 | data!: Array;
8 | count?: number;
9 | }
10 |
11 | export type JsonValue = string | number | boolean | JsonObject | JsonArray | null;
12 |
13 | export type JsonObject = {
14 | [Key in string]?: JsonValue;
15 | };
16 |
17 | export interface JsonArray extends Array {}
18 |
--------------------------------------------------------------------------------
/ui/src/app/graphql.config.ts:
--------------------------------------------------------------------------------
1 | import { ApolloClientOptions, InMemoryCache } from '@apollo/client/core';
2 | import { HttpLink } from 'apollo-angular/http';
3 |
4 | const uri = '/graphql';
5 | export function CreateApollo(httpLink: HttpLink): ApolloClientOptions {
6 | return {
7 | defaultOptions: {
8 | watchQuery: {
9 | fetchPolicy: 'network-only'
10 | }
11 | },
12 | link: httpLink.create({ uri }),
13 | cache: new InMemoryCache()
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "UserIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "NameIsExist": "name already exist",
5 | "AccountIsNotEmpty": "account should not be empty",
6 | "AccountIsExist": "account already exist",
7 | "PasswordIsNotEmpty": "password should not be empty",
8 | "EmailIsNotEmpty": "email should not be empty",
9 | "EmailIsExist": "email already exist",
10 | "PhoneIsExist": "phone already exist"
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/services/cache/cache.model.ts:
--------------------------------------------------------------------------------
1 | import { Field, ObjectType } from '@nestjs/graphql';
2 | import { CacheDescription } from './cache.enum';
3 |
4 | @ObjectType()
5 | export class Cache {
6 | @Field(() => String, { description: CacheDescription.Key })
7 | key: string;
8 |
9 | @Field(() => String, { description: CacheDescription.Value })
10 | value: string;
11 |
12 | @Field(() => String, { description: CacheDescription.Expiretime })
13 | expiretime: string;
14 | }
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/aside/aside.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
16 |
--------------------------------------------------------------------------------
/api/src/modules/language/language.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { LanguageResolver } from './language.resolver';
3 | import { LanguageController } from './language.controller';
4 | import { AuthModule } from '../auth/auth.module';
5 | import { LanguageService } from '@api/services';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [LanguageController],
10 | providers: [LanguageResolver, LanguageService],
11 | })
12 | export class LanguageModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/resource/resource.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { ResourceResolver } from './resource.resolver';
3 | import { ResourceController } from './resource.controller';
4 | import { ResourceService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [ResourceController],
10 | providers: [ResourceResolver, ResourceService],
11 | })
12 | export class ResourceModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/variable/variable.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { VariableResolver } from './variable.resolver';
3 | import { VariableController } from './variable.controller';
4 | import { VariableService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [VariableController],
10 | providers: [VariableResolver, VariableService],
11 | })
12 | export class VariableModule {}
13 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/aside/aside.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, inject, signal } from '@angular/core';
2 | import { XMenuComponent } from '@ng-nest/ui/menu';
3 | import { AppConfigService } from '@ui/core';
4 | @Component({
5 | selector: 'app-aside',
6 | imports: [XMenuComponent],
7 | templateUrl: './aside.component.html',
8 | styleUrls: ['./aside.component.scss']
9 | })
10 | export class AsideComponent {
11 | config = inject(AppConfigService);
12 | collapsed = signal(false);
13 | }
14 |
--------------------------------------------------------------------------------
/api/src/core/middlewares/gql-date.middleware.ts:
--------------------------------------------------------------------------------
1 | import { FieldMiddleware, MiddlewareContext, NextFn } from '@nestjs/graphql';
2 | import { isNotEmpty, isString } from 'class-validator';
3 |
4 | export const GqlDateMiddleware: FieldMiddleware = async (_ctx: MiddlewareContext, next: NextFn) => {
5 | const value = await next();
6 | if (isNotEmpty(value) && isString(value)) {
7 | try {
8 | const date = new Date(value);
9 | return date;
10 | } catch {}
11 | }
12 | return value;
13 | };
14 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/permission.json:
--------------------------------------------------------------------------------
1 | {
2 | "PermissionIdIsNotEmpty": "id should not be empty",
3 | "NameIsNotEmpty": "name should not be empty",
4 | "NameIsExist": "name already exist",
5 | "CodeIsNotEmpty": "code should not be empty",
6 | "CodeIsExist": "code already exist",
7 | "SortIsNotEmpty": "sort should not be empty",
8 | "SortIsNotNumber": "sort should be number",
9 | "ResourceIdIsNotEmpty": "resourceId should not be empty",
10 | "ResourceIdIsNotExist": "resourceId is not exist"
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/services/variable/index.ts:
--------------------------------------------------------------------------------
1 | export * from './variable.enum';
2 | export * from './variable.model';
3 | export * from './create.input';
4 | export * from './update.input';
5 | export * from './order';
6 | export * from './pagination.input';
7 | export * from './where';
8 | export * from './variable.output';
9 | export * from './save-many.input';
10 | export * from './select.input';
11 | export * from './select.output';
12 | export * from './variable.service';
13 | export * from './variable-type.input';
14 |
--------------------------------------------------------------------------------
/ui/src/app/api/variable-category/where.ts:
--------------------------------------------------------------------------------
1 | import { BaseWhereInput, NumberFilter, StringFilter } from '@ui/core';
2 | import { ResourceWhereInput } from '../resource/where';
3 |
4 | export class VariableCategoryWhereInput extends BaseWhereInput {
5 | name?: string | StringFilter;
6 | code?: string | StringFilter;
7 | sort?: number | NumberFilter;
8 | description?: string | StringFilter;
9 | resourceId?: string | StringFilter;
10 | resource?: ResourceWhereInput;
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/modules/subject/subject.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SubjectResolver } from './subject.resolver';
3 | import { SubjectService } from '../../services/subject/subject.service';
4 | import { SubjectController } from './subject.controller';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [SubjectController],
10 | providers: [SubjectResolver, SubjectService],
11 | })
12 | export class SubjectModule {}
13 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/setting/object/object.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .group {
3 | display: grid;
4 | grid-template-columns: 1fr 1fr;
5 | gap: 1rem;
6 | .item {
7 | display: flex;
8 | flex-direction: column;
9 | label {
10 | margin-bottom: 0.125rem;
11 | text-align: left;
12 | width: 100%;
13 | }
14 | x-input,
15 | x-select,
16 | x-input-number {
17 | width: 100%;
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/api/src/services/logs/logs-file.model.ts:
--------------------------------------------------------------------------------
1 | import { Field, ObjectType } from '@nestjs/graphql';
2 | import { LogsDescription } from './logs.enum';
3 |
4 | @ObjectType()
5 | export class LogsFile {
6 | @Field(() => String, { description: LogsDescription.Name, nullable: true })
7 | name?: string;
8 | @Field(() => String, { description: LogsDescription.Type, nullable: true })
9 | type?: string;
10 | @Field(() => String, { description: LogsDescription.Extension, nullable: true })
11 | extension?: string;
12 | }
13 |
--------------------------------------------------------------------------------
/ui/src/app/api/role/role.model.ts:
--------------------------------------------------------------------------------
1 | import { BaseAudit, BaseModel } from '@ui/core';
2 | import { User } from '../user';
3 | import { Permission } from '../permission';
4 |
5 | export class RolePermission {
6 | permissionId?: string;
7 | permission?: Permission;
8 | }
9 |
10 | export class Role extends BaseModel {
11 | name!: string;
12 | description?: string;
13 | permissions?: RolePermission[];
14 | }
15 |
16 | export class RoleUser extends BaseAudit {
17 | userId?: string;
18 | user?: User;
19 | }
20 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/setting/boolean/boolean.component.html:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/ui/src/app/core/services/icon.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable, inject } from '@angular/core';
2 | import { XIconService } from '@ng-nest/ui/icon';
3 | import { of } from 'rxjs';
4 | import { IconConfig } from 'src/app/icon.config';
5 |
6 | @Injectable({ providedIn: 'root' })
7 | export class AppIconService {
8 | icon = inject(XIconService);
9 |
10 | init() {
11 | for (let ext in IconConfig) {
12 | this.icon.register(`admin:${ext}`, IconConfig[ext]);
13 | }
14 | return of(true);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/catalogue.json:
--------------------------------------------------------------------------------
1 | {
2 | "CatalogueIdIsNotEmpty": "id should not be empty",
3 | "PidIsNotExist": "pid is not exist",
4 | "NameIsNotEmpty": "name should not be empty",
5 | "TypeIsNotEmpty": "type should not be empty",
6 | "SortIsNotEmpty": "sort should not be empty",
7 | "SortIsNotNumber": "sort should be number",
8 | "ResourceIdIsNotEmpty": "resourceId should not be empty",
9 | "ResourceIdIsNotExist": "resourceId is not exist",
10 | "VariableIdIsNotExist": "variableId is not exist"
11 | }
12 |
--------------------------------------------------------------------------------
/api/src/modules/dictionary/dictionary.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { DictionaryResolver } from './dictionary.resolver';
3 | import { DictionaryController } from './dictionary.controller';
4 | import { DictionaryService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [DictionaryController],
10 | providers: [DictionaryResolver, DictionaryService],
11 | })
12 | export class DictionaryModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/permission/permission.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { PermissionResolver } from './permission.resolver';
3 | import { PermissionController } from './permission.controller';
4 | import { PermissionService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [PermissionController],
10 | providers: [PermissionResolver, PermissionService],
11 | })
12 | export class PermissionModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/schema-data/schema-data.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { SchemaDataResolver } from './schema-data.resolver';
3 | import { SchemaDataController } from './schema-data.controller';
4 | import { SchemaDataService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [SchemaDataController],
10 | providers: [SchemaDataResolver, SchemaDataService],
11 | })
12 | export class SchemaDataModule {}
13 |
--------------------------------------------------------------------------------
/ui/src/app/layout/index/index.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { AsideComponent } from './aside/aside.component';
3 | import { ContentComponent } from './content/content.component';
4 | import { TabsComponent } from './tabs/tabs.component';
5 |
6 | @Component({
7 | selector: 'app-index',
8 | imports: [AsideComponent, ContentComponent, TabsComponent],
9 | templateUrl: './index.component.html',
10 | styleUrls: ['./index.component.scss']
11 | })
12 | export class IndexComponent {}
13 |
--------------------------------------------------------------------------------
/ui/src/app/pages/role/role.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { Role, RoleService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const RolesResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(RoleService).roles({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/ui/src/app/pages/user/user.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { User, UserService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const UsersResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(UserService).users({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/ui/src/app/pages/model/model.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { Model, ModelService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const ModelsResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(ModelService).models({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/ui/src/app/api/language/language.enum.ts:
--------------------------------------------------------------------------------
1 | export enum LanguageAuth {
2 | LanguageCreate = 'language-create',
3 | LanguageUpdate = 'language-update',
4 | LanguageDelete = 'language-delete'
5 | }
6 |
7 | export enum LanguageDescription {
8 | Language = 'Language',
9 |
10 | Id = 'LanguageId',
11 | Key = 'Key',
12 | Value = 'Value',
13 | LanguageCode = 'LanguageCode'
14 | }
15 |
16 | export enum LanguageMessage {
17 | CreatedSuccess = '新增本地化语言成功',
18 | UpdatedSuccess = '更新本地化语言成功',
19 | DeletedSuccess = '删除本地化语言成功'
20 | }
21 |
--------------------------------------------------------------------------------
/ui/src/app/core/pipes/zero-prefix.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'appZeroPrefix'
5 | })
6 | export class AppZeroPrefixPipe implements PipeTransform {
7 | transform(value: any, ...args: any[]): any {
8 | if ([null, undefined].includes(value)) return '';
9 | const val = Number(value);
10 | const len = args[0] || 2;
11 | if (Number(len) < String(value).length) {
12 | return val;
13 | }
14 | return (Array(len).join('0') + val).slice(-len);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ui/src/app/pages/prompt/prompt.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { Prompt, PromptService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const PromptsResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(PromptService).prompts({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema/schema.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { Schema, SchemaService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const SchemasResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(SchemaService).schemas({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/resource.json:
--------------------------------------------------------------------------------
1 | {
2 | "ResourceIdIsNotEmpty": "id should not be empty",
3 | "PidIsNotExist": "pid is not exist",
4 | "NameIsNotEmpty": "name should not be empty",
5 | "NameIsExist": "name already exist",
6 | "CodeIsNotEmpty": "code should not be empty",
7 | "CodeIsExist": "code already exist",
8 | "SortIsNotEmpty": "sort should not be empty",
9 | "SortIsNotNumber": "sort should be number",
10 | "SubjectIdIsNotEmpty": "subjectId should not be empty",
11 | "SubjectIdIsNotExist": "subjectId is not exist"
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/services/user/reset-password.input.ts:
--------------------------------------------------------------------------------
1 | import { Field, InputType } from '@nestjs/graphql';
2 | import { IsNotEmpty } from 'class-validator';
3 | import { ValidatorDescription, I18N } from '@api/core';
4 | import { UserDescription, USER_I18N } from './user.enum';
5 |
6 | @InputType()
7 | export class UserResetPasswordInput {
8 | @Field({ description: UserDescription.Password })
9 | @IsNotEmpty({
10 | message: I18N(`${USER_I18N}.${UserDescription.Password}${ValidatorDescription.IsNotEmpty}`),
11 | })
12 | password: string;
13 | }
14 |
--------------------------------------------------------------------------------
/ui/src/app/ng-nest.config.ts:
--------------------------------------------------------------------------------
1 | import { XConfig } from '@ng-nest/ui/core';
2 |
3 | export const NgNestConfig: XConfig = {
4 | components: {
5 | pagination: {
6 | space: '0.8rem'
7 | },
8 | table: {
9 | rowHeight: 38
10 | },
11 | dialog: {
12 | width: '40rem'
13 | },
14 | switch: {
15 | size: 'small'
16 | }
17 | },
18 | theme: {
19 | colors: { primary: '#4096ff' },
20 | vars: {
21 | borderRadius: '0.25rem',
22 | borderSmallRadius: '0.125rem'
23 | }
24 | }
25 | };
26 |
--------------------------------------------------------------------------------
/api/src/core/services/encrypt.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@nestjs/common';
2 | import { genSaltSync, hashSync, compareSync } from 'bcryptjs';
3 |
4 | @Injectable()
5 | export class EncryptService {
6 | static saltRounds = 11;
7 |
8 | constructor() {}
9 |
10 | genSalt() {
11 | return genSaltSync(EncryptService.saltRounds);
12 | }
13 |
14 | hash(data: string) {
15 | return hashSync(data, this.genSalt());
16 | }
17 |
18 | compare(data: string, hash: string) {
19 | return compareSync(data, hash);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ui/src/app/pages/subject/subject.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { Subject, SubjectService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const SubjectsResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(SubjectService).subjects({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/api/src/services/variable/save-many.input.ts:
--------------------------------------------------------------------------------
1 | import { Field, InputType } from '@nestjs/graphql';
2 | import { Variable } from './variable.model';
3 | import { VariableDescription } from './variable.enum';
4 |
5 | @InputType()
6 | export class VariableSaveManyInput {
7 | @Field({ description: VariableDescription.Many })
8 | many: Variable[];
9 |
10 | @Field({ description: VariableDescription.ResourceId })
11 | resourceId: string;
12 |
13 | @Field({ description: VariableDescription.VariableCategoryId })
14 | variableCategoryId: string;
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/modules/catalogue/catalogue.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { CatalogueResolver } from './catalogue.resolver';
3 | import { CatalogueController } from './catalogue.controller';
4 | import { CatalogueService, FileService, UploadService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [CatalogueController],
10 | providers: [UploadService, FileService, CatalogueResolver, CatalogueService],
11 | })
12 | export class CatalogueModule {}
13 |
--------------------------------------------------------------------------------
/api/src/modules/aigc/aigc.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { AigcController } from './aigc.controller';
3 | import { AigcGateway } from './aigc.gateway';
4 | import { AuthModule } from '../auth/auth.module';
5 | import { AigcService, GeminiService, QianFanService, QwenService } from '@api/services';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [AigcController],
10 | providers: [AigcGateway, AigcService, QwenService, GeminiService, QianFanService],
11 | exports: [AigcGateway],
12 | })
13 | export class AigcModule {}
14 |
--------------------------------------------------------------------------------
/ui/src/app/pages/schema-data/schema-data.resover.ts:
--------------------------------------------------------------------------------
1 | import { inject } from '@angular/core';
2 | import { ActivatedRouteSnapshot, ResolveFn, RouterStateSnapshot } from '@angular/router';
3 | import { SchemaData, SchemaDataService } from '@ui/api';
4 | import { BASE_SKIP, BASE_TAKE, BasePagination } from '@ui/core';
5 |
6 | export const SchemaDatasResolver: ResolveFn> = (
7 | _route: ActivatedRouteSnapshot,
8 | _state: RouterStateSnapshot
9 | ) => {
10 | return inject(SchemaDataService).schemaDatas({ skip: BASE_SKIP, take: BASE_TAKE });
11 | };
12 |
--------------------------------------------------------------------------------
/api/src/modules/upload/upload.controller.ts:
--------------------------------------------------------------------------------
1 | import { FileControl } from '@api/core';
2 | import { UploadInput, UploadService } from '@api/services';
3 | import { Body, Post, Controller, UploadedFile } from '@nestjs/common';
4 |
5 | @Controller('upload')
6 | export class UploadController {
7 | constructor(private readonly uploadService: UploadService) {}
8 |
9 | @Post()
10 | @FileControl('file')
11 | async upload(@UploadedFile() file: Express.Multer.File, @Body() body: UploadInput): Promise {
12 | return this.uploadService.cosExpress(file, body);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/api/src/services/variable/variable-type.input.ts:
--------------------------------------------------------------------------------
1 | import { ArgsType, Field } from '@nestjs/graphql';
2 | import { ResourceDescription } from '../resource';
3 | import { VariableDescription } from './variable.enum';
4 |
5 | @ArgsType()
6 | export class VariableTypeInput {
7 | @Field({ description: ResourceDescription.Id, nullable: true })
8 | resourceId?: string;
9 |
10 | @Field({ description: VariableDescription.Type, nullable: true })
11 | type?: string;
12 |
13 | @Field({ description: VariableDescription.SchemaType, nullable: true })
14 | schemaType?: string;
15 | }
16 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema-data/schema-data.enum.ts:
--------------------------------------------------------------------------------
1 | export const SchemaDataI18n = 'schema-data';
2 |
3 | export enum SchemaDataAuth {
4 | SchemaDataCreate = 'schema-data-create',
5 | SchemaDataUpdate = 'schema-data-update',
6 | SchemaDataDelete = 'schema-data-delete'
7 | }
8 |
9 | export enum SchemaDataDescription {
10 | SchemaData = 'SchemaData',
11 |
12 | Id = 'SchemaDataId',
13 | formId = '业务表单',
14 | data = '数据'
15 | }
16 |
17 | export enum SchemaDataMessage {
18 | CreatedSuccess = '新增数据成功',
19 | UpdatedSuccess = '更新数据成功',
20 | DeletedSuccess = '删除数据成功'
21 | }
22 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/setting/boolean/boolean.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .group {
3 | display: grid;
4 | grid-template-columns: 1fr 1fr;
5 | gap: 1rem;
6 | &.one {
7 | grid-template-columns: 1fr;
8 | }
9 | .item {
10 | display: flex;
11 | flex-direction: column;
12 | label {
13 | margin-bottom: 0.125rem;
14 | text-align: left;
15 | width: 100%;
16 | }
17 | x-input,
18 | x-select,
19 | x-input-number {
20 | width: 100%;
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/core/common/base.output.ts:
--------------------------------------------------------------------------------
1 | import { Type } from '@nestjs/common';
2 | import { Field, Int, ObjectType } from '@nestjs/graphql';
3 | import { PaginationDescription as PDes } from './base.enum';
4 |
5 | export function BasePaginationOutput(TClass: Type) {
6 | @ObjectType({ isAbstract: true })
7 | abstract class Output {
8 | @Field(() => [TClass], { description: PDes.Data })
9 | data: Array;
10 |
11 | @Field(() => Int, { description: PDes.Count, nullable: true, defaultValue: 0 })
12 | count?: number;
13 | }
14 | return Output;
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/i18n/en-us/file.json:
--------------------------------------------------------------------------------
1 | {
2 | "UidIsNotEmpty": "Uid cannot be empty",
3 | "NameIsNotEmpty": "The name cannot be empty",
4 | "ActualnameIsNotEmpty": "The actual name cannot be empty",
5 | "StatusIsNotEmpty": "State cannot be empty",
6 | "StatusIsIn": "State must be in the specified list",
7 | "SizeIsNotEmpty": "The file size can't be empty",
8 | "MimetypeIsNotEmpty": "The file type can't be empty",
9 | "KeyIsNotEmpty": "The file path cannot be empty",
10 | "KeyIsExist": "The file path already exist",
11 | "UrlIsNotEmpty": "The file address cannot be empty"
12 | }
13 |
--------------------------------------------------------------------------------
/api/src/modules/auth/auth.resolver.ts:
--------------------------------------------------------------------------------
1 | import { Query, Resolver } from '@nestjs/graphql';
2 | import { BaseSelect, GqlCurrentUser, PrismaSelect } from '@api/core';
3 | import { Auth, AuthResolverName, AuthService, User } from '@api/services';
4 |
5 | @Resolver(() => Auth)
6 | export class AuthResolver {
7 | constructor(private auth: AuthService) { }
8 |
9 | @Query(() => User, { description: AuthResolverName.User })
10 | async userInfo(@GqlCurrentUser() user: User, @PrismaSelect() select: BaseSelect) {
11 | return await this.auth.getUserById(user.id, select);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ui/src/app/api/index.ts:
--------------------------------------------------------------------------------
1 | export * from './auth';
2 | export * from './cache';
3 | export * from './dictionary';
4 | export * from './language';
5 | export * from './logs';
6 | export * from './permission';
7 | export * from './resource';
8 | export * from './role';
9 | export * from './schema';
10 | export * from './subject';
11 | export * from './user';
12 | export * from './catalogue';
13 | export * from './variable';
14 | export * from './variable-category';
15 | export * from './schema-data';
16 | export * from './model';
17 | export * from './prompt';
18 | export * from './openai';
19 |
--------------------------------------------------------------------------------
/ui/src/app/api/schema/schema.enum.ts:
--------------------------------------------------------------------------------
1 | export const SchemaI18n = 'schema';
2 |
3 | export enum SchemaAuth {
4 | SchemaCreate = 'schema-create',
5 | SchemaUpdate = 'schema-update',
6 | SchemaDelete = 'schema-delete'
7 | }
8 |
9 | export enum SchemaDescription {
10 | Schema = 'Schema',
11 |
12 | Id = 'SchemaId',
13 | Name = '名称',
14 | Code = '编码',
15 | Description = '描述',
16 | Version = '版本',
17 | Json = '模型数据'
18 | }
19 |
20 | export enum SchemaMessage {
21 | CreatedSuccess = '新增数据模型成功',
22 | UpdatedSuccess = '更新数据模型成功',
23 | DeletedSuccess = '删除数据模型成功'
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/modules/variable-category/variable-category.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { VariableCategoryResolver } from './variable-category.resolver';
3 | import { VariableCategoryController } from './variable-category.controller';
4 | import { VariableCategoryService } from '@api/services';
5 | import { AuthModule } from '../auth/auth.module';
6 |
7 | @Module({
8 | imports: [AuthModule],
9 | controllers: [VariableCategoryController],
10 | providers: [VariableCategoryResolver, VariableCategoryService],
11 | })
12 | export class VariableCategoryModule {}
13 |
--------------------------------------------------------------------------------
/api/src/core/common/base.model.ts:
--------------------------------------------------------------------------------
1 | import { Field, ObjectType } from '@nestjs/graphql';
2 | import { BaseDescription } from './base.enum';
3 | import { GqlDateMiddleware } from '../middlewares';
4 |
5 | @ObjectType({ isAbstract: true })
6 | export class BaseAudit {
7 | @Field({
8 | description: BaseDescription.CreatedAt,
9 | nullable: true,
10 | middleware: [GqlDateMiddleware],
11 | })
12 | createdAt?: Date;
13 | @Field({
14 | description: BaseDescription.UpdatedAt,
15 | nullable: true,
16 | middleware: [GqlDateMiddleware],
17 | })
18 | updatedAt?: Date;
19 | }
20 |
--------------------------------------------------------------------------------
/api/src/services/role/order.ts:
--------------------------------------------------------------------------------
1 | import { BaseOrder, SortOrder } from '@api/core';
2 | import { InputType, Field } from '@nestjs/graphql';
3 | import { IsOptional } from 'class-validator';
4 | import { RoleDescription } from './role.enum';
5 |
6 | @InputType()
7 | export class RoleOrderInput extends BaseOrder {
8 | @Field(() => SortOrder, { description: RoleDescription.Name, nullable: true })
9 | @IsOptional()
10 | name?: SortOrder;
11 |
12 | @Field(() => SortOrder, { description: RoleDescription.Description, nullable: true })
13 | @IsOptional()
14 | description?: SortOrder;
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/modules/logs/logs.resolver.ts:
--------------------------------------------------------------------------------
1 | import { Resolver, Query } from '@nestjs/graphql';
2 | import { LogsFile, LogsOutput, LogsResolverName, LogsService } from '@api/services';
3 | import { BaseSelect, PrismaSelect } from '@api/core';
4 |
5 | @Resolver(() => LogsFile)
6 | export class LogsResolver {
7 | constructor(private readonly logsService: LogsService) {}
8 |
9 | @Query(() => LogsOutput, {
10 | description: LogsResolverName.Logs,
11 | })
12 | async logs(@PrismaSelect() select: BaseSelect): Promise {
13 | return await this.logsService.logs(select);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/api/src/modules/upload/upload.module.ts:
--------------------------------------------------------------------------------
1 | import { Module } from '@nestjs/common';
2 | import { UploadController } from './upload.controller';
3 | import { UploadService } from '@api/services';
4 | import { AuthModule } from '../auth';
5 | import { APP_INTERCEPTOR } from '@nestjs/core';
6 | import { FileInterceptor } from '@api/core';
7 | import { FileModule } from '../file';
8 |
9 | @Module({
10 | imports: [AuthModule, FileModule],
11 | controllers: [UploadController],
12 | providers: [UploadService, { provide: APP_INTERCEPTOR, useClass: FileInterceptor }],
13 | })
14 | export class UploadModule {}
15 |
--------------------------------------------------------------------------------
/ui/src/app/pages/json/json.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, signal } from '@angular/core';
2 | import { AiConversationComponent } from '@ui/core';
3 |
4 | @Component({
5 | selector: 'app-json',
6 | templateUrl: './json.component.html',
7 | styleUrls: ['./json.component.scss'],
8 | imports: [AiConversationComponent]
9 | })
10 | export class JsonComponent {
11 | platform = signal('dashscope');
12 | model = signal('qwen3-235b-a22b-instruct-2507');
13 | system = signal(
14 | '你是一个 AI 助手,请按照要求回答问题,使用markdown的格式逐条输出,带上 emoji 符号,控制在100字以内。'
15 | );
16 | prompt = signal('人工智能到底是什么?');
17 | }
18 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/json-schema/json-schema.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | display: block;
3 | width: 100%;
4 | border: var(--x-border-width) var(--x-border-style) var(--x-border);
5 | border-radius: var(--x-border-radius);
6 |
7 | .json-schema {
8 | border-top: var(--x-border-width) var(--x-border-style) var(--x-border);
9 | padding: 1rem;
10 | min-height: 20rem;
11 | }
12 |
13 | ::ng-deep {
14 | x-select {
15 | .x-input-active {
16 | .x-input-frame {
17 | background-color: var(--x-primary-800);
18 | }
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ui/src/app/core/pipes/base64-to-string.pipe.ts:
--------------------------------------------------------------------------------
1 | import { Pipe, PipeTransform } from '@angular/core';
2 |
3 | @Pipe({
4 | name: 'appBase64ToString'
5 | })
6 | export class AppBase64ToStringPipe implements PipeTransform {
7 | transform(value: string, ..._args: any[]): any {
8 | try {
9 | return decodeURIComponent(
10 | atob(value)
11 | .split('')
12 | .map(function (c) {
13 | return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
14 | })
15 | .join('')
16 | );
17 | } catch (e) {
18 | return value;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/ui/src/app/api/logs/logs.enum.ts:
--------------------------------------------------------------------------------
1 | export const LogsI18n = 'logs';
2 |
3 | export enum LogsAuth {
4 | LogsCreate = 'logs-create',
5 | LogsUpdate = 'logs-update',
6 | LogsDelete = 'logs-delete',
7 | LogsDeleteAll = 'logs-delete-all'
8 | }
9 |
10 | export enum LogsDescription {
11 | Logs = 'Logs',
12 |
13 | Error = 'Error',
14 | Http = 'Http',
15 | Info = 'Info',
16 | Cache = 'Cache',
17 | Prisma = 'Prisma',
18 | Warn = 'Warn',
19 |
20 | Name = 'Name',
21 | Type = 'Type',
22 | Extension = 'Extension'
23 | }
24 |
25 | export type LogsType = 'error' | 'http' | 'info' | 'cache' | 'prisma' | 'warn';
26 |
--------------------------------------------------------------------------------
/ui/src/app/core/functions/file-reader.ts:
--------------------------------------------------------------------------------
1 | import { Observable } from 'rxjs';
2 |
3 | export function AppFileReader(file: File): Observable {
4 | return new Observable((observer) => {
5 | const reader = new FileReader();
6 |
7 | // 成功读取
8 | reader.onload = () => {
9 | observer.next(reader.result as string);
10 | observer.complete();
11 | };
12 |
13 | // 错误处理
14 | reader.onerror = () => {
15 | observer.error(reader.error);
16 | };
17 |
18 | // 开始读取文件
19 | reader.readAsText(file);
20 |
21 | // 可选:支持取消订阅时中止读取
22 | return () => reader.abort();
23 | });
24 | }
25 |
--------------------------------------------------------------------------------
/api/src/core/decorators/prisma-select.decorator.ts:
--------------------------------------------------------------------------------
1 | import { ExecutionContext, createParamDecorator } from '@nestjs/common';
2 | import { GqlExecutionContext } from '@nestjs/graphql';
3 | import { PrismaSelect as PalJSPrismaSelect } from '@paljs/plugins';
4 |
5 | export const PrismaSelect = createParamDecorator((property: string, context: ExecutionContext) => {
6 | const gqlContext = GqlExecutionContext.create(context);
7 | const info = gqlContext.getInfo();
8 | const art = new PalJSPrismaSelect(info);
9 |
10 | if (property) {
11 | return art.valueOf(property);
12 | } else {
13 | return art.value;
14 | }
15 | });
16 |
--------------------------------------------------------------------------------
/ui/src/app/core/components/ai-dialog/ai-dialog.component.scss:
--------------------------------------------------------------------------------
1 | :host {
2 | .title {
3 | display: flex;
4 | align-items: center;
5 | font-weight: 500;
6 | span {
7 | font-weight: 600;
8 | }
9 | x-select {
10 | margin-left: 1rem;
11 | }
12 | }
13 | .content {
14 | display: flex;
15 | flex-direction: column;
16 | align-items: flex-start;
17 | max-height: calc(100vh - 3rem) !important;
18 | height: calc(100vh - 3rem) !important;
19 | position: relative;
20 | }
21 |
22 | .footer {
23 | width: 100%;
24 | bottom: 2rem;
25 | margin: 0 auto;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/api/src/services/aigc/aigc.enum.ts:
--------------------------------------------------------------------------------
1 | import { QwenMessage, QwenModel } from './dashscope';
2 | import { GeminiModel } from './gemini';
3 | import { QianFanMessage, QianFanModel } from './qianfan';
4 |
5 | export const AIGC_I18N = 'aigc';
6 |
7 | export enum AigcDescription {
8 | Type = 'Type',
9 | Model = 'Model',
10 | Prompt = 'Prompt',
11 | Messages = 'Messages',
12 | }
13 |
14 | export enum AigcType {
15 | Qwen = 'qwen',
16 | Gemini = 'gemini',
17 | QianFan = 'qianfan',
18 | }
19 |
20 | export type AigcModel = QwenModel | GeminiModel | QianFanModel;
21 |
22 | export type AigcMessageInput = QwenMessage | QianFanMessage;
23 |
--------------------------------------------------------------------------------