Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
version: 10.22.0
run_install: false

- name: Get pnpm store directory
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Create base image with PNPM installed
###################

FROM node:18-alpine AS pnpm
FROM node:22-alpine3.21 AS base
ENV CI=1
RUN apk --no-cache add libc6-compat
RUN npm install -g pnpm
RUN npm install -g pnpm@10

###################
# Copy just my dependency files
###################

FROM pnpm AS deps
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml .env ./
COPY ssl ./ssl
Expand Down
26 changes: 22 additions & 4 deletions openapi.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"hash": "5d0e06635b84acee1346a8f5fae28c04229f650970293ab167f1d6dcbddb8b24",
"hash": "139fec2f3d22b1083b4bd083b1451f00e64c41705ab0a53056da6a19c6371562",
"openapi": "3.0.0",
"paths": {
"/hello": {
Expand Down Expand Up @@ -1822,7 +1822,9 @@
"key",
"-key",
"name",
"-name"
"-name",
"seq",
"-seq"
]
}
},
Expand Down Expand Up @@ -2009,7 +2011,9 @@
"key",
"-key",
"name",
"-name"
"-name",
"seq",
"-seq"
]
}
},
Expand Down Expand Up @@ -6544,6 +6548,10 @@
"exportable": {
"type": "boolean",
"description": "是否可导出"
},
"seq": {
"type": "number",
"description": "排序"
}
},
"required": [
Expand Down Expand Up @@ -6600,6 +6608,10 @@
"type": "boolean",
"description": "是否可导出"
},
"seq": {
"type": "number",
"description": "排序"
},
"id": {
"type": "string",
"description": "Entity id"
Expand Down Expand Up @@ -6669,6 +6681,10 @@
"exportable": {
"type": "boolean",
"description": "是否可导出"
},
"seq": {
"type": "number",
"description": "排序"
}
}
},
Expand Down Expand Up @@ -8002,7 +8018,9 @@
"key",
"-key",
"name",
"-name"
"-name",
"seq",
"-seq"
]
},
"name_like": {
Expand Down
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"github-secret": "ts-node scripts/github-action-secret.ts"
},
"dependencies": {
"@fastify/static": "8.2.0",
"@alicloud/sms-sdk": "^1.1.6",
"@fastify/static": "8.2.0",
"@nestjs/bull": "^11.0.2",
"@nestjs/cache-manager": "^3.0.1",
"@nestjs/common": "^11.1.6",
Expand Down Expand Up @@ -145,6 +145,18 @@
"pnpm": {
"overrides": {
"socks": "^2.7.4"
}
}
},
"onlyBuiltDependencies": [
"@nestjs/core",
"@scarf/scarf",
"core-js",
"mongodb-memory-server",
"msgpackr-extract"
]
},
"engines": {
"node": ">=22",
"pnpm": ">=10.4.1"
},
"packageManager": "pnpm@10.22.0"
}
14 changes: 12 additions & 2 deletions src/namespace/entities/namespace.entity.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { IntersectionType } from '@nestjs/swagger';
import { IsBoolean, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { Type } from 'class-transformer';
import { IsBoolean, IsNotEmpty, IsNumber, IsOptional, IsString } from 'class-validator';
import { Document } from 'mongoose';

import { IsNs } from 'src/common/validate';
import { SortFields } from 'src/lib/sort';
import { helper, MongoEntity } from 'src/mongo';

@Schema()
@SortFields(['key', 'name'])
@SortFields(['key', 'name', 'seq'])
export class NamespaceDoc {
/**
* 额外数据
Expand Down Expand Up @@ -91,6 +92,15 @@ export class NamespaceDoc {
@IsBoolean()
@Prop()
exportable?: boolean;

/**
* 排序
*/
@IsOptional()
@IsNumber()
@Type(() => Number)
@Prop()
seq?: number;
}

export const NamespaceSchema = helper(SchemaFactory.createForClass(NamespaceDoc));
Expand Down
2 changes: 1 addition & 1 deletion src/namespace/namespace.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class NamespaceService {
}

list(query: ListNamespacesQuery = {}): Promise<NamespaceDocument[]> {
const { limit = 10, sort, offset = 0, filter } = buildMongooseQuery(query);
const { limit = 10, sort = 'seq', offset = 0, filter } = buildMongooseQuery(query);
return this.namespaceModel.find(filter).sort(sort).skip(offset).limit(limit).exec();
}

Expand Down
Loading