interface ResponseBase {
status: 'error' | 'success';
}
interface CustomResponse<T> extends ResponseBase {
statusCode?: number;
message?: T;
}
interface BuildInExceptionResponse extends ResponseBase {
error: string;
}
interface CustomExceptionResponse extends ResponseBase {
response: {
status: "error",
error: string;
},
message: string;
}
type Response<T> = CustomResponse<T> & BuildInExceptionResponse & CustomExceptionResponse;
interface Base {
createdAt: Date;
updatedAt: Date;
}
enum EChatRoomSocketEvent {
// chatroom settings
'CREATECHATROOM' = 'createchatroom',
'UPDATECHATROOM' = 'updatechatroom',
'DELETECHATROOM' = 'deletechatroom',
// participate
'UPDATEPARTICIPATE' = 'updateparticipate',
'DELETEPARTICIPATE' = 'deleteparticipate',
// message
'NEWCHATMESSAGE' = 'newchatmessage',
'UPDATESENDSTATUSMSG' = 'updatesendstatusmsg',
'UPDATEREADSTATUSMSG' = 'updatereadstatusmsg',
}
enum EChatRoomType {
'PUBLIC' = 'public',
'PRIVATE' = 'private',
'GROUP' = 'group',
}
enum EChatSendStatus {
'FAIL' = 'fail',
'SENDING' = 'sending',
'FINISH' = 'finish',
}
enum EChatStatus {
'READ' = 'read',
'UNREAD' = 'unread',
}
enum EUserRole {
'TRIAL' = 'trial',
'USER' = 'user',
'VIP1' = 'vip1',
'VIP2' = 'vip2',
'ADMIN' = 'admin',
}
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
interface ChatRoom extends Base {
id: string;
name: string;
type: EChatRoomType;
chatParticipate: ChatParticipate;
version: number;
}
interface ChatParticipate extends Base {
id: string;
chatRoom: ChatRoom;
chats: Chat[];
users: User[];
version: number;
}
interface Chat extends Base {
id: string;
message: string;
sendStatus: EChatSendStatus;
readStatus: EChatStatus;
chatParticipate: ChatParticipate;
version: number;
}
interface User extends Base {
id: string;
role: EUserRole;
expiredDate: Date;
diamondCoin: number; // default 0
goldCoin: number; // default 10
username: string;
email: string;
status: boolean; // default true
gender?: EUserGender
age?: number;
desc?: string;
profileImage?: string;
chatParticipates: ChatParticipates[];
followers: User[];
followings: User[];
blockLists: User[];
followerCount: number;
followingCount: number;
version: number;
}
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| name(Required) | Chatroom name | string | Body |
| type(Required) | Chatroom type EChatRoomType | enumerate | Body |
| welcomeMessage(Required) | Welcome Message when people enter chatroom | string | Body |
| requestUserId(Required) | Person who create the chatroom | string | Body |
| responseUserId(Required) | Person who get invited to the chatroom | string | Body |
enum EChatRoomType {
'PUBLIC' = 'public',
'PRIVATE' = 'private',
'GROUP' = 'group',
}
interface AuthHeader {
authorization: string;
}
interface CreateChatrooomDto {
name: string;
type: EChatRoomType; // default private
welcomeMessage: string;
requestUserId: string;
responseUserId: string;
}
type Request = CreateChatrooomDto & AuthHeader;
type Response<Chatroom>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| message(Required) | chat message | string | Body |
| chatParitcipateId(Required) | relations with chatParitcipate pk | string | Body |
| requestUserId(Required) | Person who create the chatroom | string | Body |
| responseUserId(Required) | Person who get invited to the chatroom | string | Body |
interface AuthHeader {
authorization: string;
}
interface CreatChatDto {
message: string;
chatParitcipateId: string;
requestUserId: string;
responseUserId: string;
}
type Request = CreatChatDto & AuthHeader;
type Response<Chat>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| id(Required) | post PK | string | Parameter |
interface AuthHeader {
authorization: string;
}
interface ChatBasicDto {
id: string;
}
type Request = ChatBasicDto & AuthHeader;
type Response<ChatRoom>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| id | 1d4118de-a928-4f8e-9333-c647ba52793f |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| take(Optional) | Page size in a scroll | number | Query |
| skip(Optional) | Page number for scroll | number | Query |
| keyword(Optional) | Keyword Search (This MVP doesn’t support) | string | Query |
| sort(Optional) | sort | ‘ASC’ or ‘DESC’ | Query |
interface AuthHeader {
authorization: string;
}
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
keyword?: string;
sort?: TSort;
[futureKey: string]: any;
}
type Request = ISearch & AuthHeader;
interface PagingResponse {
chatrooms: ChatRoom[];
take: number;
skip: number;
count: number;
}
type Response<PagingResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
interface SocketEventResponse {
type: EChatRoomSocketEvent.UPDATEREADSTATUSMSG;
data: ChatRoom;
}
type Response<SocketEventResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
interface SocketEventResponse {
type: EChatRoomSocketEvent.UPDATESENDSTATUSMSG;
data: ChatRoom;
}
type Response<SocketEventResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
interface SocketEventResponse {
type: EChatRoomSocketEvent.NEWCHATMESSAGE;
data: Chat;
}
type Response<SocketEventResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
interface SocketEventResponse {
type: EChatRoomSocketEvent.CREATECHATROOM;
data: ChatRoom;
}
type Response<SocketEventResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
interface SocketEventData {
readStatus: EChatStatus,
participateId: string;
requestUserId: string;
chatId: string;
}
interface SocketEvent {
type: "updatereadstatus",
data: SocketEventData
}
type Request = SocketEvent;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
interface SocketEventData {
sendStatus: EChatSendStatus,
participateId: string;
requestUserId: string;
chatId: string;
}
interface SocketEvent {
type: "updatesendstatus",
data: SocketEventData
}
type Request = SocketEvent;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat |
| Key | Value | Description |
|---|---|---|
| accessToken | {{token}} |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| requestUserId(Required) | Person who create the chatroom | string | Body |
| readStatus(Required) | Chat Status enumerate | Enumerate | Body |
interface AuthHeader {
authorization: string;
}
interface UpdateChatReadStatusDto {
requestUserId: string;
readStatus: EChatStatus;
}
type Request = UpdateChatReadStatusDto & AuthHeader;
type Response<Chat>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat | |
| Content-Type | application/json |
| Key | Value | Description |
|---|---|---|
| id | 42e5f423-0ed0-432a-831b-69c0042b6b23 |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| requestUserId(Required) | Person who create the chatroom | string | Body |
| sendStatus(Required) | Chat Status enumerate | Enumerate | Body |
interface AuthHeader {
authorization: string;
}
interface UpdateChatSendStatusDto {
requestUserId: string;
sendStatus: EChatSendStatus;
}
type Request = UpdateChatSendStatusDto & AuthHeader;
type Response<Chat>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-chat | |
| Content-Type | application/json |
| Key | Value | Description |
|---|---|---|
| id | 42e5f423-0ed0-432a-831b-69c0042b6b23 |
interface Base {
createdAt: Date;
updatedAt: Date;
}
enum ELocationType {
'COUNTRY' = 'country',
'CITY' = 'city',
'SCENE' = 'scene',
'PORT' = 'port',
'TURN' = 'turn',
}
enum EUserRole {
'TRIAL' = 'trial',
'USER' = 'user',
'VIP1' = 'vip1',
'VIP2' = 'vip2',
'ADMIN' = 'admin',
}
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
type Position = number[];
type GeoJsonTypes = |
"Point" |
"MultiPoint" |
"LineString" |
"MultiLineString" |
"Polygon" |
"MultiPolygon" |
"GeometryCollection";
type BBox = [number, number, number, number] | [number, number, number, number, number, number];
export type GeometryObject = Geometry;
interface GeoJsonObject {
type: GeoJsonTypes;
bbox?: BBox;
}
interface MultiLineString extends GeoJsonObject {
type: "MultiLineString";
coordinates: Position[][];
}
interface LineString extends GeoJsonObject {
type: "LineString";
coordinates: Position[];
}
interface Point extends GeoJsonObject {
type: "Point";
coordinates: Position;
}
interface Location extends Base {
id: string;
point: Point;
pointSrid: Point;
lat: number;
lon: number;
type: ELocationType;
locationName: string;
country?: Country;
startTrips?: Trip[];
endTrips?: Trip[];
version: number;
}
interface Country extends Base {
id: string;
name: string;
code: string;
}
interface Turn extends Base {
id: string;
name: string;
geom: LineString;
srid: LineString;
length?: number;
fromnode?: number;
tonode?: number;
version: number;
}
interface User extends Base {
id: string;
role: EUserRole;
expiredDate: Date;
diamondCoin: number; // default 0
goldCoin: number; // default 10
username: string;
email: string;
status: boolean; // default true
gender?: EUserGender
age?: number;
desc?: string;
profileImage?: string;
version: number;
}
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| id(Required) | location PK | string | Parameter |
interface AuthHeader {
authorization: string;
}
interface GetLocationById {
id: string;
}
type Request = GetLocationById & AuthHeader;
type Response<Location>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| id | 5f866e41-2ba1-47dc-899f-2e9f044d18e9 |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| startLocationName | ST. MARY'S (SCILLY ISL.) | |
| endLocationName | MILLHAVEN | |
| type | text |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| startLocationName | ST. MARY'S (SCILLY ISL.) | |
| endLocationName | MILLHAVEN |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| startNode | 3555 | fromNode |
| endNode | 26349 | toNode |
| type | text |
type HealthIndicatorStatus = 'up' | 'down';
type HealthCheckStatus = 'error' | 'ok' | 'shutting_down';
type HealthIndicatorResult = {
/**
* The key of the health indicator which should be uniqe
*/
[key: string]: {
/**
* The status if the given health indicator was successful or not
*/
status: HealthIndicatorStatus;
/**
* Optional settings of the health indicator result
*/
[optionalKeys: string]: any;
};
};
interface HealthCheckResult {
/**
* The overall status of the Health Check
*/
status: HealthCheckStatus;
/**
* The info object contains information of each health indicator
* which is of status "up"
*/
info?: HealthIndicatorResult;
/**
* The error object contains information of each health indicator
* which is of status "down"
*/
error?: HealthIndicatorResult;
/**
* The details object contains information of every health indicator.
*/
details: HealthIndicatorResult;
}
type Response<HealthCheckResult>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| take(Optional) | Page size in a scroll | number | Query |
| skip(Optional) | Page number | number | Query |
| lat(Required) | Port latitude | number | Query |
| lon(Required) | Port country name | number | Query |
| method(Required) | search method | ‘specific’ or ‘range’ | Query |
| range(Optional) | given range for search only when search method is range | number | Query |
enum ELocationCoordQueryMethod {
'SPECIFIC' = 'specific',
'RANGE' = 'range',
}
interface AuthHeader {
authorization: string;
}
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
lat: number;
lon: number;
method: ELocationCoordQueryMethod;
range?: number;
}
type Request = ISearch & AuthHeader;
interface PagingResponse {
locations: Location[];
take: number;
skip: number;
count: number;
}
type Response<PagingResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| lat | 44.35 | |
| lon | 143.35 | |
| method | range | |
| range | 2.2 |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| take(Optional) | Page size in a scroll | number | Query |
| skip(Optional) | Page number | number | Query |
| locationName(Optional) | Port name | string | Query |
| countryName(Optional) | Port country name | string | Query |
| sort(Optional) | sort | ‘ASC’ or ‘DESC’ | Query |
interface AuthHeader {
authorization: string;
}
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
keyword?: string;
sort?: TSort;
locationName?: string;
countryName?: string;
[futureKey: string]: any;
}
type Request = ISearch & AuthHeader;
interface PagingResponse {
locations: Location[];
take: number;
skip: number;
count: number;
}
type Response<PagingResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-location |
| Key | Value | Description |
|---|---|---|
| locationName | MOMBETSUsdfsdf | |
| take | 100 |
interface Base {
createdAt: Date;
updatedAt: Date;
}
enum ETripView {
'PUBLIC' = 'public',
'FRIEND' = 'friend',
'SELF' = 'self',
}
enum ELocationType {
'COUNTRY' = 'country',
'CITY' = 'city',
'SCENE' = 'scene',
'PORT' = 'port',
'TURN' = 'turn',
}
enum EUserRole {
'TRIAL' = 'trial',
'USER' = 'user',
'VIP1' = 'vip1',
'VIP2' = 'vip2',
'ADMIN' = 'admin',
}
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
interface Post extends Base {
id: string;
content: string;
images: string;
publicStatus: ETripView;
publisher: User;
likeUsers: User[];
trip: Trip;
version: number;
}
type Position = number[];
type GeoJsonTypes = |
"Point" |
"MultiPoint" |
"LineString" |
"MultiLineString" |
"Polygon" |
"MultiPolygon" |
"GeometryCollection";
type BBox = [number, number, number, number] | [number, number, number, number, number, number];
export type GeometryObject = Geometry;
interface GeoJsonObject {
type: GeoJsonTypes;
bbox?: BBox;
}
interface MultiLineString extends GeoJsonObject {
type: "MultiLineString";
coordinates: Position[][];
}
interface Point extends GeoJsonObject {
type: "Point";
coordinates: Position;
}
interface Trip extends Base {
id: string;
startDate: Date;
endDate: Date;
publicStatus: ETripView;
companyName?: string;
shipNumber?: string;
geom?: MultiLineString;
publisher: User;
viewers: User[];
startPoint: Location;
endPoint: Location;
version: number;
}
interface Location extends Base {
id: string;
point: Point;
pointSrid: Point;
lat: number;
lon: number;
type: ELocationType;
locationName: string;
country?: Country;
startTrips?: Trip[];
endTrips?: Trip[];
version: number;
}
interface Country extends Base {
id: string;
name: string;
code: string;
}
interface User extends Base {
id: string;
role: EUserRole;
expiredDate: Date;
diamondCoin: number; // default 0
goldCoin: number; // default 10
username: string;
email: string;
status: boolean; // default true
gender?: EUserGender
age?: number;
desc?: string;
profileImage?: string;
trips: Trip[];
views: Trip[];
posts: Post[];
likePosts: Post[];
followers: User[];
followings: User[];
blockLists: User[];
followerCount: number;
followingCount: number;
version: number;
}
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| content(Required) | Post content | string | Body |
| publicStatus(Required) | Status of the trip default with public | ‘public’ or ‘friend’ or ‘self’ | Body |
| tripId(Required) | Related to which trip | string | Body |
| publisherId(Required) | Who publish this trip | string | Body |
| files(Optional) | Post Images | ITrip.BufferedFile[] | Body |
enum ETripView {
'PUBLIC' = 'public',
'FRIEND' = 'friend',
'SELF' = 'self',
}
interface AuthHeader {
authorization: string;
}
interface BufferedFile {
fieldname: string;
originalname: string;
encoding: string;
mimetype: AppMimeType;
size: number;
buffer: Buffer | string;
}
interface CreatePostDto {
content: string;
publicStatus: ETripView;
tripId: string;
publisherId: string;
files: ITrip.BufferedFile[];
}
type Request = CreatePostDto & AuthHeader;
type Response<Post>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
| Key | Value | Description |
|---|---|---|
| files | ||
| content | lib test | |
| publicStatus | public | |
| tripId | 45311399-d318-4858-a960-2c9f549dc677 | |
| publisherId | 735ca6d1-7a2f-45b5-bce7-42706751d12e |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| id(Required) | post PK | string | Parameter |
interface AuthHeader {
authorization: string;
}
interface PostBasicDto {
id: string;
}
type Request = PostBasicDto & AuthHeader;
type Response<Post>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
| Key | Value | Description |
|---|---|---|
| postId | e76565bd-99f7-42d8-98c5-0dd173ef8e08 |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| take(Optional) | Page size in a scroll | number | Query |
| skip(Optional) | Page number for scroll | number | Query |
| keyword(Optional) | Keyword Search (This MVP doesn’t support) | string | Query |
| sort(Optional) | sort | ‘ASC’ or ‘DESC’ | Query |
interface AuthHeader {
authorization: string;
}
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
keyword?: string;
sort?: TSort;
[futureKey: string]: any;
}
type Request = ISearch & AuthHeader;
interface PagingResponse {
posts: Post[];
take: number;
skip: number;
count: number;
}
type Response<PagingResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
interface Base {
createdAt: Date;
updatedAt: Date;
}
enum ETripView {
'PUBLIC' = 'public',
'FRIEND' = 'friend',
'SELF' = 'self',
}
enum EUserRole {
'TRIAL' = 'trial',
'USER' = 'user',
'VIP1' = 'vip1',
'VIP2' = 'vip2',
'ADMIN' = 'admin',
}
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
interface User extends Base {
id: string;
role: EUserRole;
expiredDate: Date;
diamondCoin: number; // default 0
goldCoin: number; // default 10
username: string;
email: string;
status: boolean; // default true
gender?: EUserGender
age?: number;
desc?: string;
profileImage?: string;
trips: Trip[];
views: Trip[];
posts: Post[];
likePosts: Post[];
followers: User[];
followings: User[];
blockLists: User[];
followerCount: number;
followingCount: number;
version: number;
}
interface Trip extends Base {
id: string;
startDate: Date;
endDate: Date;
publicStatus: ETripView;
companyName?: string;
shipNumber?: string;
publisher: User;
viewers: User[];
version: number;
}
interface Post extends Base {
id: string;
content: string;
images: string;
publicStatus: ETripView;
publisher: User;
likeUsers: User[];
trip: Trip;
version: number;
}
| Parameter | Description | Type | In |
|---|---|---|---|
| key(Required) | verify key | string | body |
| password(Required) | user password | string | body |
interface FPStep3 {
key: string;
passowrd: string;
}
type Request = FPStep3;
export type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| email(Required) | user email | string | body |
interface FPStep1 {
email: string;
}
type Request = FPStep1;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| key(Required) | verify key | string | body |
interface FPStep2 {
key: string;
}
type Request = FPStep2;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
interface AuthHeader {
authorization: string;
}
type Request = AuthHeader;
interface IUserInfo {
id: string;
role: "trial" | "user" | "vip1" | "vip2" | "admin",
username: string;
licence: "onepiece",
email: string;
expiredDate: string;
}
interface UserInformation {
user: IUserInfo;
}
type Response<UserInformation>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| id(Required) | User PK | string | Parameter |
interface AuthHeader {
authorization: string;
}
interface UserIdDto {
id: string;
}
type Request = UserIdDto & AuthHeader;
type Response<User>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Key | Value | Description |
|---|---|---|
| id | 735ca6d1-7a2f-45b5-bce7-42706751d12e |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
interface ResponseBase {
statusCode: number;
status: 'error' | 'success';
message: any;
[futureKey: string]: any;
}
export type Response = ResponseBase;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| takes(Optional) | Offset (paginated) - where from entities should be taken. | number | Query |
| skip(Optional) | Limit (paginated) - max number of entities should be taken. | number | Query |
| keyword(Optional) | Keyword searching specifc with username only | string | Query |
| sort(Optional) | sort | ‘ASC’ or ‘DESC’ | Query |
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
keyword?: string;
sort?: TSort;
[futureKey: string]: any;
}
type Request = ISearch;
interface ResponseMessage {
user: User[];
take: number;
skip: number;
count: number;
}
type Response<ResponseMessage>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
interface FacebookCallbackInfo {
email: string;
username: string;
picture: string;
accessToken: string;
id: string;
}
interface UserInformation {
user: FacebookCallbackInfo;
}
type Response<UserInformation>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
interface GoogleCallbackInfo {
email: string;
username: string;
picture: string;
accessToken: string;
id: string;
}
interface UserInformation {
user: GoogleCallbackInfo;
}
type Response<UserInformation>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Parameter | Description | Type | In |
|---|---|---|---|
| email(Required) | email of the user | string | body |
| password(Required) | password of the user | string | body |
interface SignInDto {
email: string;
password: string;
}
type Request = SignInDto;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| username(Required) | name of the user | string | body |
| email(Required) | email of the user | string | body |
| password(Required) | password of the user | string | body |
interface SignUpDto {
username: string;
email: string;
password: string;
}
type Request = SignUpDto;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| id(Required) | Primary Key of the user | string | Param |
| authorization(Required) | JWT Token | string | Header |
interface AuthHeader {
authorization: string;
}
interface DeleteById {
id: string;
}
type Request = DeleteById & AuthHeader;
export type Response<unknown>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Key | Value | Description |
|---|---|---|
| id | 58c617e8-9ff7-467d-b311-90a32baa9722 |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| oldPassword(Required) . | old password | string | body |
| newPassword(Required) . | new password | string | body |
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
interface BufferedFile {
fieldname: string;
originalname: string;
encoding: string;
mimetype: AppMimeType;
size: number;
buffer: Buffer | string;
}
interface UpdateUserAdditionalInfoDto {
gender?: EUserGender;
age?: number;
desc?: number;
}
interface UpdateUserAdditionalInfoInServerDto extends UpdateUserAdditionalInfoDto {
files?: BufferedFile[];
}
type Request = UpdateUserAdditionalInfoInServerDto;
type Response<User>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
| Key | Value | Description |
|---|---|---|
| id | {{user_id}} |
| Key | Value | Description |
|---|---|---|
| gender | male |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| oldPassword(Required) . | old password | string | body |
| newPassword(Required) . | new password | string | body |
interface ResponseBase {
statusCode: number;
status: 'error' | 'success';
message: any;
[futureKey: string]: any;
}
export type Response = ResponseBase;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Key | Value | Description |
|---|---|---|
| id | c56df50b-2a37-4b7a-aab7-3443843c4a70 |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| oldPassword(Required) . | old password | string | body |
| newPassword(Required) . | new password | string | body |
interface AuthHeader {
authorization: string;
}
interface UpdatePassword {
oldPassword: string;
newPassword: string;
}
export type Request = UpdatePassword & AuthHeader;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user | |
| Content-Type | application/json |
| Key | Value | Description |
|---|---|---|
| id | {{user_id}} |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
interface AuthHeader {
authorization: string;
}
type Request = AuthHeader;
type Response<string>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-user |
interface Base {
createdAt: Date;
updatedAt: Date;
}
enum ETripView {
'PUBLIC' = 'public',
'FRIEND' = 'friend',
'SELF' = 'self',
}
enum ELocationType {
'COUNTRY' = 'country',
'CITY' = 'city',
'SCENE' = 'scene',
'PORT' = 'port',
'TURN' = 'turn',
}
enum EUserRole {
'TRIAL' = 'trial',
'USER' = 'user',
'VIP1' = 'vip1',
'VIP2' = 'vip2',
'ADMIN' = 'admin',
}
enum EUserGender {
'MALE' = 'male',
'FEMALE' = 'female',
}
interface Post extends Base {
id: string;
content: string;
images: string;
publicStatus: ETripView;
publisher: User;
likeUsers: User[];
trip: Trip;
version: number;
}
type Position = number[];
type GeoJsonTypes = |
"Point" |
"MultiPoint" |
"LineString" |
"MultiLineString" |
"Polygon" |
"MultiPolygon" |
"GeometryCollection";
type BBox = [number, number, number, number] | [number, number, number, number, number, number];
export type GeometryObject = Geometry;
interface GeoJsonObject {
type: GeoJsonTypes;
bbox?: BBox;
}
interface MultiLineString extends GeoJsonObject {
type: "MultiLineString";
coordinates: Position[][];
}
interface Point extends GeoJsonObject {
type: "Point";
coordinates: Position;
}
interface Trip extends Base {
id: string;
startDate: Date;
endDate: Date;
publicStatus: ETripView;
companyName?: string;
shipNumber?: string;
geom?: MultiLineString;
publisher: User;
viewers: User[];
startPoint: Location;
endPoint: Location;
version: number;
}
interface Location extends Base {
id: string;
point: Point;
pointSrid: Point;
lat: number;
lon: number;
type: ELocationType;
locationName: string;
country?: Country;
startTrips?: Trip[];
endTrips?: Trip[];
version: number;
}
interface Country extends Base {
id: string;
name: string;
code: string;
}
interface User extends Base {
id: string;
role: EUserRole;
expiredDate: Date;
diamondCoin: number; // default 0
goldCoin: number; // default 10
username: string;
email: string;
status: boolean; // default true
gender?: EUserGender
age?: number;
desc?: string;
profileImage?: string;
trips: Trip[];
views: Trip[];
posts: Post[];
likePosts: Post[];
followers: User[];
followings: User[];
blockLists: User[];
followerCount: number;
followingCount: number;
version: number;
}
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| startDate(Required) | When the trip start with ISO Format | string | Body |
| endDate(Required) | When the trip end with ISO Format | string | Body |
| publisherId(Required) | Who publish this trip | string | Body |
| startPointName(Required) | Which port starts | string | Body |
| endPointName(Required) | Which port ends | string | Body |
| publicStatus(Required) | Status of the trip default with public | ‘public’ or ‘friend’ or ‘self’ | Body |
| companyName(Optional) | Which company do they belongs to | string | Body |
| shipNumber(Optional) | What is the their ship number | string | Body |
interface AuthHeader {
authorization: string;
}
interface CreateTripDto {
startDate: string;
endDate: string;
publisherId: string;
startPointName: string;
endPointName: string;
publicStatus: ETripView;
companyName?: string;
shipNumber?: string;
}
type Request = CreateTripDto & AuthHeader;
type Response<Trip>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip | |
| Content-Type | application/json |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| id(Required) | trip PK | string | Parameter |
| publisherId(Required) | user PK | string | Parameter |
interface AuthHeader {
authorization: string;
}
interface TripBasicDto {
id: string;
}
interface GetTripByIdDto extends TripBasicDto {
publisherId: string;
}
type Request = GetTripByIdDto & AuthHeader;
type Response<Trip>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
| Key | Value | Description |
|---|---|---|
| id | 45311399-d318-4858-a960-2c9f549dc677 | |
| publisherId | 735ca6d1-7a2f-45b5-bce7-42706751d12e |
| Parameter | Description | Type | In |
|---|---|---|---|
| authorization(Required) | JWT Token | string | Header |
| take(Optional) | Page size in a scroll | number | Query |
| skip(Optional) | Page number for scroll | number | Query |
| publisherId(Optional) | User PK | number | Query |
| keyword(Optional) | Keyword Search (This MVP doesn’t support) | string | Query |
| sort(Optional) | sort | ‘ASC’ or ‘DESC’ | Query |
interface AuthHeader {
authorization: string;
}
interface IPage {
take?: number;
skip?: number;
}
interface ISearch extends IPage {
keyword?: string;
sort?: TSort;
[futureKey: string]: any;
}
interface GetTripByPagingDto extends ISearch {
publisherId: string;
}
type Request = GetTripByPagingDto & AuthHeader;
interface PagingResponse {
trips: Trip[],
take: number;
skip: number;
count: number;
}
type Response<PagingResponse>;
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |
| Key | Value | Description |
|---|---|---|
| publisherId | 735ca6d1-7a2f-45b5-bce7-42706751d12e |
| Key | Value | Description |
|---|---|---|
| service-name | one-piece-trip |