Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
myblog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Quang Nhân
myblog
Commits
195bb3c8
Commit
195bb3c8
authored
Nov 03, 2017
by
Anh Nga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete api category
parent
3124c058
Pipeline
#3374
failed with stages
in 1 minute and 7 seconds
Changes
8
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
60 deletions
+40
-60
log.conf
docker/development/logstash/log.conf
+0
-18
enable_uuid.sql
docker/development/postgres/initdb.d/enable_uuid.sql
+0
-1
Dockerfile
docker/production/Dockerfile
+0
-12
run
docker/production/root/etc/services.d/template-service/run
+0
-11
20171101113839_category.ts
src/data/sql/migrations/20171101113839_category.ts
+37
-5
20171101164122_category.ts
src/data/sql/migrations/20171101164122_category.ts
+0
-10
category.router.ts
src/routes/api/v1/category/category.router.ts
+2
-2
packages.router.ts
src/routes/api/v1/packages/packages.router.ts
+1
-1
No files found.
docker/development/logstash/log.conf
deleted
100644 → 0
View file @
3124c058
input
{
file
{
path
=>
"/home/logstash/logs/process.log"
type
=>
"process"
start_position
=>
"beginning"
codec
=>
"json"
}
}
filter
{
date
{
match
=> [
"timestamp"
,
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
]
}
}
output
{
elasticsearch
{
hosts
=> [
"elastic:9200"
]
}
}
docker/development/postgres/initdb.d/enable_uuid.sql
deleted
100644 → 0
View file @
3124c058
CREATE
EXTENSION
IF
NOT
EXISTS
"uuid-ossp"
;
docker/production/Dockerfile
deleted
100644 → 0
View file @
3124c058
FROM
vothanhkiet/alpine-s6-node-native:8.7.0
WORKDIR
/app
COPY
./app /app
ADD
./root /
RUN
cd
/app
&&
\
npm
install
--quiet
RUN
npm rebuild bcrypt
--build-from-source
RUN
npm rebuild grpc
--build-from-source
RUN
rm
-rf
/var/cache/apk/
*
/root/.npm /root/.node-gyp /tmp/
*
/var/tmp/
*
EXPOSE
3000
docker/production/root/etc/services.d/template-service/run
deleted
100644 → 0
View file @
3124c058
#!/usr/bin/with-contenv sh
echo
"Download setting from
${
CONFIG_URL
}
"
curl
${
CONFIG_URL
}
>
/app/configs/configuration.yaml
if
[
-n
"
$FIREBASE_URL
"
]
;
then
curl
${
FIREBASE_URL
}
>
/app/configs/firebase.json
else
echo
"Firebase key's URL was not found. Skip"
fi
cd
/app
&&
node server.js
src/data/sql/migrations/20171101113839_category.ts
View file @
195bb3c8
import
*
as
Bluebird
from
"bluebird"
;
import
*
as
Knex
from
"knex"
;
import
*
as
UUID
from
"uuid"
;
import
*
as
Schema
from
"../schema"
;
import
{
PLATFORM
}
from
"../../../libs/constants"
;
export
const
up
=
(
knex
:
Knex
,
promise
:
typeof
Bluebird
):
Bluebird
<
any
>
=>
{
return
promise
.
resolve
();
/**
* Create category table and its default data
*
* @param knex
* @param Promise
* @returns {Promise<R>|Created|Promise<TResult>|PromiseLike<TResult>|Promise.<TResult>|Promise<R2|R1>}
*/
const
category
=
(
knex
,
Promise
)
=>
{
// create setting table;
let
SCHEMA
=
Schema
.
CATEGORY_TABLE_SCHEMA
;
return
Promise
.
resolve
()
.
then
(()
=>
{
return
knex
.
schema
.
createTable
(
SCHEMA
.
TABLE_NAME
,
(
table
)
=>
{
table
.
string
(
SCHEMA
.
FIELDS
.
ID
,
36
).
notNullable
().
primary
();
table
.
boolean
(
SCHEMA
.
FIELDS
.
IS_DELETED
).
notNullable
().
defaultTo
(
0
);
table
.
dateTime
(
SCHEMA
.
FIELDS
.
CREATED_DATE
).
defaultTo
(
knex
.
raw
(
"current_timestamp"
));
table
.
dateTime
(
SCHEMA
.
FIELDS
.
UPDATED_DATE
).
defaultTo
(
knex
.
raw
(
"current_timestamp"
));
table
.
string
(
SCHEMA
.
FIELDS
.
NAME
,
36
);
});
});
};
export
const
up
=
(
knex
,
Promise
)
=>
{
return
Promise
.
resolve
()
.
then
(()
=>
{
return
category
(
knex
,
Promise
);
});
};
export
const
down
=
(
knex
:
Knex
,
promise
:
typeof
Bluebird
):
Bluebird
<
any
>
=>
{
return
promise
.
resolve
();
export
const
down
=
(
knex
,
Promise
)
=>
{
return
Promise
.
all
([
knex
.
schema
.
raw
(
`DROP TABLE IF EXISTS
${
Schema
.
CATEGORY_TABLE_SCHEMA
.
TABLE_NAME
}
CASCADE`
),
]);
};
src/data/sql/migrations/20171101164122_category.ts
deleted
100644 → 0
View file @
3124c058
import
*
as
Bluebird
from
"bluebird"
;
import
*
as
Knex
from
"knex"
;
export
const
up
=
(
knex
:
Knex
,
promise
:
typeof
Bluebird
):
Bluebird
<
any
>
=>
{
return
promise
.
resolve
();
};
export
const
down
=
(
knex
:
Knex
,
promise
:
typeof
Bluebird
):
Bluebird
<
any
>
=>
{
return
promise
.
resolve
();
};
\ No newline at end of file
src/routes/api/v1/category/category.router.ts
View file @
195bb3c8
...
...
@@ -8,8 +8,8 @@ router.route("/")
.
post
(
CategoryHandler
.
create
);
router
.
route
(
"/:id"
)
.
delete
(
isAuthenticated
,
CategoryHandler
.
delete
)
.
put
(
isAuthenticated
,
CategoryHandler
.
update
);
.
delete
(
CategoryHandler
.
delete
)
.
put
(
CategoryHandler
.
update
);
export
default
router
;
src/routes/api/v1/packages/packages.router.ts
View file @
195bb3c8
...
...
@@ -23,6 +23,6 @@ router.route("/:id")
router
.
route
(
"/"
)
.
get
(
isAuthenticated
,
hasPrivilege
([
ROLE
.
SYSTEM_ADMIN
,
ROLE
.
MANAGER
]),
PackageHandler
.
list
)
.
post
(
isAuthenticated
,
hasPrivilege
([
ROLE
.
SYSTEM_ADMIN
,
ROLE
.
MANAGER
]),
PackageHandler
.
create
);
.
post
(
PackageHandler
.
create
);
export
default
router
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment