From 93f17f90e007cb0f17ba46052f48a875103210e9 Mon Sep 17 00:00:00 2001 From: Wetiontop Date: Sun, 26 Dec 2021 18:15:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Duser-authenication=E6=A1=88?= =?UTF-8?q?=E4=BE=8BCurrentUser=E4=B8=8D=E5=9C=A8shared=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=A4=B9=E5=AF=BC=E8=87=B4=E5=89=8D=E7=AB=AFPtlLogin.ts?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/user-authentication/backend/src/models/UserUtil.ts | 2 +- .../backend/src/models/parseCurrentUser.ts | 2 +- .../backend/src/{ => shared}/models/CurrentUser.ts | 0 .../backend/src/shared/protocols/serviceProto.ts | 6 +++--- .../backend/src/shared/protocols/user/PtlLogin.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) rename examples/user-authentication/backend/src/{ => shared}/models/CurrentUser.ts (100%) diff --git a/examples/user-authentication/backend/src/models/UserUtil.ts b/examples/user-authentication/backend/src/models/UserUtil.ts index 6732ada..f7d1b1e 100644 --- a/examples/user-authentication/backend/src/models/UserUtil.ts +++ b/examples/user-authentication/backend/src/models/UserUtil.ts @@ -1,5 +1,5 @@ import * as uuid from "uuid"; -import { CurrentUser } from "./CurrentUser"; +import { CurrentUser } from "../shared/models/CurrentUser"; const SSO_VALID_TIME = 86400000 * 7; diff --git a/examples/user-authentication/backend/src/models/parseCurrentUser.ts b/examples/user-authentication/backend/src/models/parseCurrentUser.ts index b5f561e..72c9c2b 100644 --- a/examples/user-authentication/backend/src/models/parseCurrentUser.ts +++ b/examples/user-authentication/backend/src/models/parseCurrentUser.ts @@ -1,6 +1,6 @@ import { HttpServer } from "tsrpc"; import { BaseRequest } from "../shared/protocols/base"; -import { CurrentUser } from "./CurrentUser"; +import { CurrentUser } from "../shared/models/CurrentUser"; import { UserUtil } from "./UserUtil"; export function parseCurrentUser(server: HttpServer) { diff --git a/examples/user-authentication/backend/src/models/CurrentUser.ts b/examples/user-authentication/backend/src/shared/models/CurrentUser.ts similarity index 100% rename from examples/user-authentication/backend/src/models/CurrentUser.ts rename to examples/user-authentication/backend/src/shared/models/CurrentUser.ts diff --git a/examples/user-authentication/backend/src/shared/protocols/serviceProto.ts b/examples/user-authentication/backend/src/shared/protocols/serviceProto.ts index b522c5d..fe4cfc2 100644 --- a/examples/user-authentication/backend/src/shared/protocols/serviceProto.ts +++ b/examples/user-authentication/backend/src/shared/protocols/serviceProto.ts @@ -34,7 +34,7 @@ export interface ServiceType { } export const serviceProto: ServiceProto = { - "version": 3, + "version": 4, "services": [ { "id": 0, @@ -254,12 +254,12 @@ export const serviceProto: ServiceProto = { "name": "user", "type": { "type": "Reference", - "target": "../../models/CurrentUser/CurrentUser" + "target": "../models/CurrentUser/CurrentUser" } } ] }, - "../../models/CurrentUser/CurrentUser": { + "../models/CurrentUser/CurrentUser": { "type": "Interface", "properties": [ { diff --git a/examples/user-authentication/backend/src/shared/protocols/user/PtlLogin.ts b/examples/user-authentication/backend/src/shared/protocols/user/PtlLogin.ts index 753fe23..a1b53b2 100644 --- a/examples/user-authentication/backend/src/shared/protocols/user/PtlLogin.ts +++ b/examples/user-authentication/backend/src/shared/protocols/user/PtlLogin.ts @@ -1,4 +1,4 @@ -import { CurrentUser } from '../../../models/CurrentUser'; +import { CurrentUser } from '../../models/CurrentUser'; import { BaseConf, BaseRequest, BaseResponse } from '../base'; export interface ReqLogin extends BaseRequest {