-
Notifications
You must be signed in to change notification settings - Fork 26
refactor: v1 regression #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
GaoNeng-wWw
merged 29 commits into
opentiny:refactor/next-nest-js-backend
from
GaoNeng-wWw:feat/regression
Jul 23, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
af75cf7
fix(menu): remove menu
GaoNeng-wWw fe9daf8
fix(menu): update menu
GaoNeng-wWw cfcaac8
fix(role): permission update
GaoNeng-wWw e1f81ac
style(role): remove console.log
GaoNeng-wWw 6ef889d
feat(role): remove role will check user
GaoNeng-wWw b723010
fix(permission): allow empty description
GaoNeng-wWw 9404770
fix: collection<UserRole> not not initialized
GaoNeng-wWw c52e0f8
feat(user): add `PasswordNotMatch` error
GaoNeng-wWw 999bcd1
fix(user): transform array-string to array
GaoNeng-wWw d542f54
fix(i18): remove batch-remove-i18.dto
GaoNeng-wWw accd787
feat(role): better role cache
GaoNeng-wWw 3ff798e
fix: prevent user create if user exists
GaoNeng-wWw 62702e1
fix: token flush fail
GaoNeng-wWw c603040
feat: winston nest logger
GaoNeng-wWw d53b436
feat(mock): endpoint
GaoNeng-wWw 713f0ed
feat(v1/application): application endpoint
GaoNeng-wWw fb0e9c4
feat: remove debugger
GaoNeng-wWw ef77b4d
revert: vite.config.dev.ts
GaoNeng-wWw 5399626
fix: typo
GaoNeng-wWw 9ccef7c
fix(tinyvue): review suggestion
GaoNeng-wWw b06dc02
fix: compare confirmPassword and oldPassword
GaoNeng-wWw c13729b
fix: transactional
GaoNeng-wWw 9d49254
feat: add cn i18n record
GaoNeng-wWw 18cd3bb
fix: can not get accept-language
GaoNeng-wWw 2fed476
fix: remove cache
GaoNeng-wWw 5b594ae
feat: singleton refresh
GaoNeng-wWw 53eb4e2
feat(tinyvue): name will be fallback in add-role select component
GaoNeng-wWw a83a476
fix: remove ParseIntPipe
GaoNeng-wWw 6fc35c6
chore: merge upstream refactor branch, keep dev version for deps
GaoNeng-wWw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "Lua.runtime.version": "Lua 5.1", | ||
| "Lua.diagnostics.globals": [ | ||
| "redis", | ||
| "KEYS", | ||
| "ARGV" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export const roleTotal = () => `tinypro:v1:role:total`; | ||
| export const roleTotal = (condition?: string) => | ||
| condition ? `tinypro:v1:role:total:${condition}` : `tinypro:v1:role:total`; | ||
| export const userTotal = (condition?: string) => | ||
| condition ? `tinypro:v1:user:total:${condition}` : `tinypro:v1:user:total`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| import type { EntityManager } from '@mikro-orm/core'; | ||
| import { Seeder } from '@mikro-orm/seeder'; | ||
| import { Application } from '../src/application'; | ||
| import { log } from './utils/log'; | ||
|
|
||
| const applicationData = [ | ||
| { | ||
| name: 'Tiny Design 设计体系', | ||
| description: | ||
| '华为云产品和服务的规范体系,包括交互视觉设计、业务流程、国际化、术语词条。', | ||
| tag: '[{ "type": "", "value": "机会点定义" }, { "type": "danger", "value": "交互设计" }]', | ||
| classify: 'design', | ||
| icon: 'card-list-application-default.png', | ||
| }, | ||
| { | ||
| name: 'Tiny DesignLink 设计流水线工具', | ||
| description: | ||
| '设计+协同+资源管理,一个工具就够了,在线原型设计、设计过程融入DevOps流程。', | ||
| tag: '[{ "type": "error", "value": "交互设计" }, { "type": "warning", "value": "视觉设计" }]', | ||
| classify: 'design', | ||
| icon: 'card-list-application-default.png', | ||
| }, | ||
| { | ||
| name: 'TinyUI3.0 开发工具 ', | ||
| description: 'Cloud Design System 提供了丰富的规范文档及开发组件。', | ||
| tag: '[{ "type": "success", "value": "开发" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-application-default.png', | ||
| }, | ||
| { | ||
| name: 'TinyPlus3.0 开发工具', | ||
| description: | ||
| 'TinyPlus3.0 是基于Angular + Typescript的Web前端云业务组件库。', | ||
| tag: '[{ "type": "success", "value": "开发" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-tiny-plus.png', | ||
| }, | ||
| { | ||
| name: 'Tiny Stage 工程工具 ', | ||
| description: | ||
| '一个跨平台的前端工程化cli工具,为开发提供一系列开发套件和工程插件', | ||
| tag: '[{ "type": "success", "value": "开发" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-console-framework.png', | ||
| }, | ||
| { | ||
| name: 'Tiny Flow 接口编排工具 ', | ||
| description: | ||
| '端到端的API编排解决方案,通过可视化编程的方式快速生成、发布、调试的API编排。', | ||
| tag: '[{ "type": "success", "value": "开发" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-console-framework.png', | ||
| }, | ||
| { | ||
| name: 'Tiny Gate 门禁系统', | ||
| description: | ||
| '门禁系统,通过卡点方式集成到伏羲流水线,在服务发布时生成预览页面。', | ||
| tag: '[{ "type": "info", "value": "测试验证" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-console-framework.png', | ||
| }, | ||
| { | ||
| name: 'Console Framework 控制台框架', | ||
| description: '华为云各服务快速构建管理控制台的平台。', | ||
| tag: '[{ "type": "success", "value": "开发" },{ "type": "info", "value": "测试验证" },{ "type": "warning", "value": "上线" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-console-framework.png', | ||
| }, | ||
| { | ||
| name: 'Nodejs Framework Nodejs应用', | ||
| description: | ||
| '基于egg的定制化web服务框架,让你快速上手Nodejs做BFF意见微服务。', | ||
| tag: '[{ "type": "success", "value": "开发" },{ "type": "info", "value": "测试验证" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-console-framework.png', | ||
| }, | ||
| { | ||
| name: 'Furion 前端体验监控', | ||
| description: | ||
| '提供端到端前端用户体验度量,让产品用户体验可度量、可监控、可优化。', | ||
| tag: '[{ "type": "", "value": "机会点定义" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-furion.png', | ||
| }, | ||
| { | ||
| name: 'Tiny Mock API 管理', | ||
| description: | ||
| '功能强大的API管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。', | ||
| tag: '[{ "type": "success", "value": "开发" },{ "type": "warning", "value": "视觉设计" }]', | ||
| classify: 'dev', | ||
| icon: 'card-list-application-default.png', | ||
| }, | ||
| ]; | ||
|
|
||
| export class ApplicationSeeder extends Seeder { | ||
| async run(em: EntityManager): Promise<void> { | ||
| for (const app of applicationData) { | ||
| const existsData = await em.findOne(Application, { | ||
| name: app.name, | ||
| }); | ||
| if (existsData) { | ||
| log.info(`Application ${app.name} already exists`); | ||
| continue; | ||
| } | ||
| const application = em.create(Application, { | ||
| name: app.name, | ||
| description: app.description, | ||
| icon: app.icon, | ||
| tag: app.tag, | ||
| classify: app.classify, | ||
| }); | ||
| em.persist(application); | ||
| } | ||
| await em.flush(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
template/nest-next/src/application/application.controller.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { Controller, Get, Query } from '@nestjs/common'; | ||
| import { ApplicationService } from './application.service'; | ||
| import { | ||
| FindApplicationEntity, | ||
| FindApplicationsRequest, | ||
| } from './dto/find-applications'; | ||
| import { ApiOkResponse, ApiOperation } from '@nestjs/swagger'; | ||
|
|
||
| @Controller('application') | ||
| export class ApplicationController { | ||
| constructor(private readonly applicationService: ApplicationService) {} | ||
|
|
||
| @ApiOperation({ summary: '获取应用' }) | ||
| @ApiOkResponse({ | ||
| type: FindApplicationEntity, | ||
| }) | ||
| @Get() | ||
| async getAllApplication(@Query() searchInfo: FindApplicationsRequest) { | ||
| return this.applicationService.findAllAplication(searchInfo); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { type Opt } from '@mikro-orm/core'; | ||
| import { Entity, PrimaryKey, Property } from '@mikro-orm/decorators/legacy'; | ||
| import { v7 } from 'uuid'; | ||
|
|
||
| export enum TagEnum { | ||
| DEFAULT = '', | ||
| SUCCESS = 'success', | ||
| INFO = 'info', | ||
| DANGER = 'danger', | ||
| WARNING = 'warning', | ||
| } | ||
|
|
||
| export type ApplicationId = string & { readonly __brand: unique symbol }; | ||
| export const createApplicationId = () => v7() as ApplicationId; | ||
| export const toApplicationId = (val: string) => val as ApplicationId; | ||
|
|
||
| @Entity({ tableName: 'application' }) | ||
| export class Application { | ||
| @PrimaryKey({ type: 'uuid' }) | ||
| id: Opt<ApplicationId> = createApplicationId(); | ||
| @Property({ type: 'text' }) | ||
| name: string; | ||
| @Property({ type: 'text' }) | ||
| description: string; | ||
| @Property({ type: 'text' }) | ||
| icon: string; | ||
| @Property({ type: 'text' }) | ||
| tag: string; | ||
| @Property({ type: 'text' }) | ||
| classify: string; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { Module } from '@nestjs/common'; | ||
| import { ApplicationService } from './application.service'; | ||
| import { ApplicationController } from './application.controller'; | ||
| import { MikroOrmModule } from '@mikro-orm/nestjs'; | ||
| import { Application } from './application.entity'; | ||
|
|
||
| @Module({ | ||
| imports: [MikroOrmModule.forFeature([Application])], | ||
| controllers: [ApplicationController], | ||
| providers: [ApplicationService], | ||
| }) | ||
| export class ApplicationModule {} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.