Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
f6f77944
Commit
f6f77944
authored
Apr 27, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate
parent
d2c6ef19
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
34 deletions
+33
-34
.idea/workspace.xml
.idea/workspace.xml
+28
-28
src/routes/app.ts
src/routes/app.ts
+4
-5
test.ts
test.ts
+1
-1
No files found.
.idea/workspace.xml
View file @
f6f77944
...
@@ -2,9 +2,8 @@
...
@@ -2,9 +2,8 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"f0cbce64-0ebc-4f60-8c2d-2fe9e214a8c0"
name=
"Default"
comment=
""
>
<list
default=
"true"
id=
"f0cbce64-0ebc-4f60-8c2d-2fe9e214a8c0"
name=
"Default"
comment=
""
>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/src/routes/app.ts"
afterPath=
"$PROJECT_DIR$/src/routes/app.ts"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/package.json"
afterPath=
"$PROJECT_DIR$/package.json"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/test.ts"
afterPath=
"$PROJECT_DIR$/test.ts"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/yarn.lock"
afterPath=
"$PROJECT_DIR$/yarn.lock"
/>
</list>
</list>
<ignored
path=
"mycard-console-backend.iws"
/>
<ignored
path=
"mycard-console-backend.iws"
/>
<ignored
path=
".idea/workspace.xml"
/>
<ignored
path=
".idea/workspace.xml"
/>
...
@@ -37,11 +36,11 @@
...
@@ -37,11 +36,11 @@
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"app.ts"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
leaf-file-name=
"app.ts"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/src/routes/app.ts"
>
<entry
file=
"file://$PROJECT_DIR$/src/routes/app.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
-828
"
>
<state
relative-caret-position=
"
221
"
>
<caret
line=
"
9"
column=
"0"
lean-forward=
"false"
selection-start-line=
"9"
selection-start-column=
"0"
selection-end-line=
"10"
selection-end-column=
"0
"
/>
<caret
line=
"
64"
column=
"9"
lean-forward=
"true"
selection-start-line=
"64"
selection-start-column=
"9"
selection-end-line=
"64"
selection-end-column=
"9
"
/>
<folding>
<folding>
<element
signature=
"e#39#81#0"
expanded=
"true"
/>
<element
signature=
"e#39#81#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -82,11 +81,11 @@
...
@@ -82,11 +81,11 @@
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"test.ts"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
leaf-file-name=
"test.ts"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/test.ts"
>
<entry
file=
"file://$PROJECT_DIR$/test.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
126
"
>
<state
relative-caret-position=
"
252
"
>
<caret
line=
"
7"
column=
"0"
lean-forward=
"false"
selection-start-line=
"7"
selection-start-column=
"0"
selection-end-line=
"8"
selection-end-column=
"0
"
/>
<caret
line=
"
14"
column=
"102"
lean-forward=
"true"
selection-start-line=
"14"
selection-start-column=
"102"
selection-end-line=
"14"
selection-end-column=
"102
"
/>
<folding>
<folding>
<element
signature=
"n#!!doc"
expanded=
"true"
/>
<element
signature=
"n#!!doc"
expanded=
"true"
/>
<element
signature=
"e#44#86#0"
expanded=
"true"
/>
<element
signature=
"e#44#86#0"
expanded=
"true"
/>
...
@@ -207,12 +206,12 @@
...
@@ -207,12 +206,12 @@
<option
value=
"$PROJECT_DIR$/src/utils.ts"
/>
<option
value=
"$PROJECT_DIR$/src/utils.ts"
/>
<option
value=
"$PROJECT_DIR$/src/models/App.ts"
/>
<option
value=
"$PROJECT_DIR$/src/models/App.ts"
/>
<option
value=
"$PROJECT_DIR$/server.ts"
/>
<option
value=
"$PROJECT_DIR$/server.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/app.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/package.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/package.ts"
/>
<option
value=
"$PROJECT_DIR$/views/update.hbs"
/>
<option
value=
"$PROJECT_DIR$/views/update.hbs"
/>
<option
value=
"$PROJECT_DIR$/test.ts"
/>
<option
value=
"$PROJECT_DIR$/package/main.ts"
/>
<option
value=
"$PROJECT_DIR$/package/main.ts"
/>
<option
value=
"$PROJECT_DIR$/package.json"
/>
<option
value=
"$PROJECT_DIR$/package.json"
/>
<option
value=
"$PROJECT_DIR$/test.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/app.ts"
/>
</list>
</list>
</option>
</option>
</component>
</component>
...
@@ -232,7 +231,7 @@
...
@@ -232,7 +231,7 @@
<handled-path
value=
"$PROJECT_DIR$/node_modules"
/>
<handled-path
value=
"$PROJECT_DIR$/node_modules"
/>
</component>
</component>
<component
name=
"ProjectFrameBounds"
>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"
318
"
/>
<option
name=
"x"
value=
"
445
"
/>
<option
name=
"y"
value=
"1103"
/>
<option
name=
"y"
value=
"1103"
/>
<option
name=
"width"
value=
"1232"
/>
<option
name=
"width"
value=
"1232"
/>
<option
name=
"height"
value=
"777"
/>
<option
name=
"height"
value=
"777"
/>
...
@@ -487,12 +486,12 @@
...
@@ -487,12 +486,12 @@
<workItem
from=
"1493107593448"
duration=
"867000"
/>
<workItem
from=
"1493107593448"
duration=
"867000"
/>
<workItem
from=
"1493174892830"
duration=
"25000"
/>
<workItem
from=
"1493174892830"
duration=
"25000"
/>
<workItem
from=
"1493174934848"
duration=
"6205000"
/>
<workItem
from=
"1493174934848"
duration=
"6205000"
/>
<workItem
from=
"1493198225466"
duration=
"
19685
000"
/>
<workItem
from=
"1493198225466"
duration=
"
20790
000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"TimeTrackingManager"
>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"17
0911
000"
/>
<option
name=
"totallyTimeSpent"
value=
"17
2016
000"
/>
</component>
</component>
<component
name=
"TodoView"
>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
<todo-panel
id=
"selected-file"
>
...
@@ -504,7 +503,8 @@
...
@@ -504,7 +503,8 @@
</todo-panel>
</todo-panel>
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"318"
y=
"1103"
width=
"1232"
height=
"777"
extended-state=
"0"
/>
<frame
x=
"445"
y=
"1103"
width=
"1232"
height=
"777"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
id=
"TypeScript"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32846716"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"TypeScript"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32846716"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.1577209"
sideWeight=
"0.49384886"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.1577209"
sideWeight=
"0.49384886"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
...
@@ -515,7 +515,7 @@
...
@@ -515,7 +515,7 @@
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32975295"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32975295"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.43941605"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.43941605"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
tru
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.3620438"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
fals
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.3620438"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.23725356"
sideWeight=
"0.50615114"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.23725356"
sideWeight=
"0.50615114"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
...
@@ -853,16 +853,6 @@
...
@@ -853,16 +853,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/routes/app.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-828"
>
<caret
line=
"9"
column=
"0"
lean-forward=
"false"
selection-start-line=
"9"
selection-start-column=
"0"
selection-end-line=
"10"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#39#81#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/routes/package.ts"
>
<entry
file=
"file://$PROJECT_DIR$/src/routes/package.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"89"
>
<state
relative-caret-position=
"89"
>
...
@@ -899,8 +889,8 @@
...
@@ -899,8 +889,8 @@
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/test.ts"
>
<entry
file=
"file://$PROJECT_DIR$/test.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
126
"
>
<state
relative-caret-position=
"
252
"
>
<caret
line=
"
7"
column=
"0"
lean-forward=
"false"
selection-start-line=
"7"
selection-start-column=
"0"
selection-end-line=
"8"
selection-end-column=
"0
"
/>
<caret
line=
"
14"
column=
"102"
lean-forward=
"true"
selection-start-line=
"14"
selection-start-column=
"102"
selection-end-line=
"14"
selection-end-column=
"102
"
/>
<folding>
<folding>
<element
signature=
"n#!!doc"
expanded=
"true"
/>
<element
signature=
"n#!!doc"
expanded=
"true"
/>
<element
signature=
"e#44#86#0"
expanded=
"true"
/>
<element
signature=
"e#44#86#0"
expanded=
"true"
/>
...
@@ -908,5 +898,15 @@
...
@@ -908,5 +898,15 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/routes/app.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"221"
>
<caret
line=
"64"
column=
"9"
lean-forward=
"true"
selection-start-line=
"64"
selection-start-column=
"9"
selection-end-line=
"64"
selection-end-column=
"9"
/>
<folding>
<element
signature=
"e#39#81#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</component>
</component>
</project>
</project>
\ No newline at end of file
src/routes/app.ts
View file @
f6f77944
...
@@ -6,6 +6,8 @@ import * as joi from 'joi';
...
@@ -6,6 +6,8 @@ import * as joi from 'joi';
import
{
promisify
as
py
}
from
'
bluebird
'
;
import
{
promisify
as
py
}
from
'
bluebird
'
;
const
router
=
new
Router
();
const
router
=
new
Router
();
let
validate
:
any
=
py
(
joi
.
validate
);
router
.
get
(
'
/v2/apps
'
,
async
(
ctx
:
Context
,
next
)
=>
{
router
.
get
(
'
/v2/apps
'
,
async
(
ctx
:
Context
,
next
)
=>
{
ctx
.
body
=
await
mongodb
.
Apps
.
find
({}).
toArray
();
ctx
.
body
=
await
mongodb
.
Apps
.
find
({}).
toArray
();
});
});
...
@@ -61,11 +63,8 @@ router.patch('/v1/app/:id', async (ctx: Context, next) => {
...
@@ -61,11 +63,8 @@ router.patch('/v1/app/:id', async (ctx: Context, next) => {
}
}
if
(
_app
.
status
==
'
ready
'
)
{
if
(
_app
.
status
==
'
ready
'
)
{
try
{
try
{
await
py
(
joi
.
validate
)(
_app
,
joi
.
object
().
keys
({
await
validate
(
_app
,
joi
.
object
().
keys
({
action
:
joi
.
object
().
keys
({
action
:
joi
.
object
().
required
(),
win32
:
joi
.
object
().
required
(),
darwin
:
joi
.
object
().
required
()
}).
required
(),
}).
required
());
}).
required
());
}
catch
(
e
)
{
}
catch
(
e
)
{
e
.
message
=
'
资料尚未填写完毕或格式有误
'
;
e
.
message
=
'
资料尚未填写完毕或格式有误
'
;
...
...
test.ts
View file @
f6f77944
...
@@ -8,7 +8,7 @@ import {XmlDocument} from 'xmldoc';
...
@@ -8,7 +8,7 @@ import {XmlDocument} from 'xmldoc';
// 配置
// 配置
const
old_apps_json
=
'
https://api.moecube.com/apps.json
'
;
const
old_apps_json
=
'
https://api.moecube.com/apps.json
'
;
const
new_apps_json
=
'
http://1
14.215.243.95
:8001/v2/apps
'
;
const
new_apps_json
=
'
http://1
27.0.01
:8001/v2/apps
'
;
const
old_metalinks
=
(
package_id
)
=>
`https://cdn01.moecube.com/release/metalinks/
${
package_id
}
.meta4`
;
const
old_metalinks
=
(
package_id
)
=>
`https://cdn01.moecube.com/release/metalinks/
${
package_id
}
.meta4`
;
const
new_metalinks
=
(
package_id
)
=>
`http://127.0.0.1:8001/v2/package/
${
package_id
}
/meta`
;
// 修改
const
new_metalinks
=
(
package_id
)
=>
`http://127.0.0.1:8001/v2/package/
${
package_id
}
/meta`
;
// 修改
const
old_checksums
=
(
package_id
)
=>
`https://cdn01.moecube.com/release/checksums/
${
package_id
}
`
;
const
old_checksums
=
(
package_id
)
=>
`https://cdn01.moecube.com/release/checksums/
${
package_id
}
`
;
...
...
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