npm i -g @nestjs/cli
nest new tasks-api
npm run start:devnest g mo tasks| @IsString() | |
| @MinLength(6) | |
| @MaxLength(50) | |
| @Matches( | |
| /(?:(?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/, { | |
| message: 'The password must have a Uppercase, lowercase letter and a number' | |
| }) | |
| password: string; |
| # Install dependencies only when needed | |
| FROM node:18-alpine3.15 AS deps | |
| # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
| RUN apk add --no-cache libc6-compat | |
| WORKDIR /app | |
| COPY package.json yarn.lock ./ | |
| RUN yarn install --frozen-lockfile | |
| # Build the app with cache dependencies | |
| FROM node:18-alpine3.15 AS builder |
| { | |
| "firestore": { | |
| "rules": "firestore.rules", | |
| "indexes": "firestore.indexes.json" | |
| }, | |
| "emulators": { | |
| "firestore": { | |
| "port": 8080 | |
| } | |
| } |
| import 'dart:async'; | |
| import 'package:flutter/foundation.dart'; | |
| void main() { | |
| FutureOr<void> tryCatchLoop({ | |
| @required FutureOr<void> Function() code, | |
| @required FutureOr<void> Function(dynamic error) onError, | |
| Duration duration = const Duration(milliseconds: 200), int limitTimes = 5 | |
| }) async { | |
| int count = 0; |
| var engine_js = { | |
| "ErrorCode.-128": "Internal engine error", | |
| "ErrorCode.-1": "Unknown error", | |
| "ErrorCode.0": "Unknown error", | |
| "ErrorCode.1": "Some data is not correctly specified.", | |
| "ErrorCode.2": "The resource could not be found.", | |
| "ErrorCode.3": "Resource already exists.", | |
| "ErrorCode.4": "Invalid path", | |
| "ErrorCode.5": "Access is denied", | |
| "ErrorCode.6": "The system is out of memory.", |
| <?php | |
| //正数 客户端=警告,客户端展示错误信息但不重试请求、 负数 客户端=错误,客户端重试 | |
| //系统和公共错误 | |
| define('ERROR_PARAMETER', -1001); //参数错误 | |
| define('DB_EXEC_ERROR', -1002); //数据库执行失败 | |
| define('ERROR_APP_VERSION', -1003); //版本与服务器不一致 | |
| define('SERVER_MAINTENANCE', -1004); //服务器维护中 | |
| define('REDIS_KEY_NOT_IDENTIFY', -1005); //未定义的redis key | |
| define('SOCKET_TOKEN_WRONG', -1006); //错误的webSocket访问token |
| def localProperties = new Properties() | |
| def localPropertiesFile = rootProject.file('local.properties') | |
| if (localPropertiesFile.exists()) { | |
| localPropertiesFile.withReader('UTF-8') { reader -> | |
| localProperties.load(reader) | |
| } | |
| } | |
| def flutterRoot = localProperties.getProperty('flutter.sdk') | |
| if (flutterRoot == null) { |
| import 'package:flutter/material.dart'; | |
| import 'package:get/get.dart'; | |
| void main() { | |
| runApp(GetMaterialApp(home: Home())); | |
| } | |
| class Home extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { |
| CREATE TABLE tone_data_temp AS | |
| SELECT file_name, last_update, category, word_count, litigious, | |
| positive, uncertainty, negative, modal_strong, modal_weak | |
| FROM bgt.tone_data; | |
| DROP TABLE bgt.tone_data; | |
| ALTER TABLE tone_data_temp RENAME TO tone_data; | |
| ALTER TABLE tone_data SET SCHEMA bgt; |