@saihu/common 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare class PaginationQueryDto {
|
|
2
|
-
|
|
3
|
-
* Page number for pagination (starts from 1)
|
|
4
|
-
* @example 1
|
|
5
|
-
*/
|
|
6
|
-
page_no?: number;
|
|
2
|
+
page_no: number;
|
|
7
3
|
/**
|
|
8
4
|
* Number of items per page (max 100)
|
|
9
5
|
* @example 10
|
|
10
6
|
*/
|
|
11
|
-
page_size
|
|
7
|
+
page_size: number;
|
|
12
8
|
}
|
|
13
|
-
export
|
|
9
|
+
export declare class PaginationResponseDto {
|
|
14
10
|
total: number;
|
|
15
11
|
page_total: number;
|
|
16
12
|
current_page: number;
|
|
17
13
|
page_size: number;
|
|
18
14
|
}
|
|
15
|
+
export declare class PaginatedResponseDto<T> {
|
|
16
|
+
pagination: PaginationResponseDto;
|
|
17
|
+
data: T;
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=pagination.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.dto.d.ts","sourceRoot":"","sources":["../../src/dto/pagination.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"pagination.dto.d.ts","sourceRoot":"","sources":["../../src/dto/pagination.dto.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAkB;IAK7B,OAAO,EAAE,MAAM,CAAK;IAEpB;;;OAGG;IAMH,SAAS,EAAE,MAAM,CAAM;CACxB;AAED,qBAAa,qBAAqB;IAChC,KAAK,EAAG,MAAM,CAAC;IACf,UAAU,EAAG,MAAM,CAAC;IACpB,YAAY,EAAG,MAAM,CAAC;IACtB,SAAS,EAAG,MAAM,CAAC;CACpB;AAED,qBAAa,oBAAoB,CAAC,CAAC;IACjC,UAAU,EAAG,qBAAqB,CAAC;IACnC,IAAI,EAAG,CAAC,CAAC;CACV"}
|
|
@@ -9,10 +9,18 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PaginationQueryDto = void 0;
|
|
12
|
+
exports.PaginatedResponseDto = exports.PaginationResponseDto = exports.PaginationQueryDto = void 0;
|
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
|
14
14
|
const class_validator_1 = require("class-validator");
|
|
15
15
|
class PaginationQueryDto {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.page_no = 1;
|
|
18
|
+
/**
|
|
19
|
+
* Number of items per page (max 100)
|
|
20
|
+
* @example 10
|
|
21
|
+
*/
|
|
22
|
+
this.page_size = 10;
|
|
23
|
+
}
|
|
16
24
|
}
|
|
17
25
|
exports.PaginationQueryDto = PaginationQueryDto;
|
|
18
26
|
__decorate([
|
|
@@ -30,3 +38,9 @@ __decorate([
|
|
|
30
38
|
(0, class_validator_1.Max)(100, { message: 'page_size cannot exceed 100' }),
|
|
31
39
|
__metadata("design:type", Number)
|
|
32
40
|
], PaginationQueryDto.prototype, "page_size", void 0);
|
|
41
|
+
class PaginationResponseDto {
|
|
42
|
+
}
|
|
43
|
+
exports.PaginationResponseDto = PaginationResponseDto;
|
|
44
|
+
class PaginatedResponseDto {
|
|
45
|
+
}
|
|
46
|
+
exports.PaginatedResponseDto = PaginatedResponseDto;
|
package/dist/util/times.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function getCurrentDate(): string;
|
|
2
2
|
export declare function getTomorrowDate(): string;
|
|
3
|
+
export declare function convertUtcToChinaTime(utcTimeString: string): string;
|
|
4
|
+
export declare function convertUtcToChinaTimeFormatted(utcTimeString: string, format?: string): string;
|
|
3
5
|
//# sourceMappingURL=times.d.ts.map
|
package/dist/util/times.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../src/util/times.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"times.d.ts","sourceRoot":"","sources":["../../src/util/times.ts"],"names":[],"mappings":"AAQA,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,eAAe,WAE9B;AAED,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,wBAAgB,8BAA8B,CAC5C,aAAa,EAAE,MAAM,EACrB,MAAM,GAAE,MAA8B,GACrC,MAAM,CAER"}
|
package/dist/util/times.js
CHANGED
|
@@ -5,10 +5,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getCurrentDate = getCurrentDate;
|
|
7
7
|
exports.getTomorrowDate = getTomorrowDate;
|
|
8
|
+
exports.convertUtcToChinaTime = convertUtcToChinaTime;
|
|
9
|
+
exports.convertUtcToChinaTimeFormatted = convertUtcToChinaTimeFormatted;
|
|
8
10
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
11
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
12
|
+
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
13
|
+
// Enable timezone support
|
|
14
|
+
dayjs_1.default.extend(utc_1.default);
|
|
15
|
+
dayjs_1.default.extend(timezone_1.default);
|
|
9
16
|
function getCurrentDate() {
|
|
10
17
|
return (0, dayjs_1.default)().format('YYYY-MM-DD');
|
|
11
18
|
}
|
|
12
19
|
function getTomorrowDate() {
|
|
13
20
|
return (0, dayjs_1.default)().add(1, 'day').format('YYYY-MM-DD');
|
|
14
21
|
}
|
|
22
|
+
function convertUtcToChinaTime(utcTimeString) {
|
|
23
|
+
return dayjs_1.default.utc(utcTimeString).tz('Asia/Shanghai').format();
|
|
24
|
+
}
|
|
25
|
+
function convertUtcToChinaTimeFormatted(utcTimeString, format = 'YYYY-MM-DD HH:mm:ss') {
|
|
26
|
+
return dayjs_1.default.utc(utcTimeString).tz('Asia/Shanghai').format(format);
|
|
27
|
+
}
|