-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
254 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "whu-library-seat", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"author": "CS-Tao <[email protected]>", | ||
"description": "武汉大学图书馆抢座软件", | ||
"license": null, | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Mock from 'mockjs' | ||
import gitcontentsApi from './gitcontents.api' | ||
import libraryApi from './library.api' | ||
import urls from '../urls' | ||
|
||
// 用户验证 | ||
Mock.mock(urls.gitcontents.validateUser.regular, 'get', gitcontentsApi.validateUser) | ||
|
||
// 登录 | ||
Mock.mock(urls.library.Login.regular, 'get', libraryApi.Login) | ||
|
||
// 得到可以使用的房间信息 | ||
Mock.mock(urls.library.FreeFilters.regular, 'get', libraryApi.FreeFilters) | ||
|
||
// 得到房间详细信息 | ||
Mock.mock(urls.library.RoomStats.regular, 'get', libraryApi.RoomStats) | ||
|
||
// 验证 token 是否可用 | ||
Mock.mock(urls.library.ValidateToken.regular, 'get', libraryApi.ValidateToken) | ||
|
||
// 得到位置详细信息 | ||
Mock.mock(urls.library.LayoutByDate.regular, 'get', libraryApi.LayoutByDate) | ||
|
||
// 按时间搜索位置 | ||
Mock.mock(urls.library.SearchSeat.regular, 'post', libraryApi.SearchSeat) | ||
|
||
// 预约位置 | ||
Mock.mock(urls.library.Book.regular, 'post', libraryApi.Book) | ||
|
||
// 取消预约 | ||
Mock.mock(urls.library.Cancel.regular, 'get', libraryApi.Cancel) | ||
|
||
// 得到用户信息 | ||
Mock.mock(urls.library.User.regular, 'get', libraryApi.User) | ||
|
||
// 得到预约历史 | ||
Mock.mock(urls.library.History.regular, 'get', libraryApi.History) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
const urls = { | ||
gitcontents: { | ||
// 用户验证 | ||
validateUser: { | ||
url () { | ||
return '/user-validation/validation.json' | ||
}, | ||
regular: /\/user-validation\/validation.json/ | ||
} | ||
}, | ||
library: { | ||
// 登录 | ||
Login: { | ||
url () { | ||
return '/rest/auth' | ||
}, | ||
regular: /\/rest\/auth/ | ||
}, | ||
// 得到可以使用的房间信息 | ||
FreeFilters: { | ||
url () { | ||
return '/rest/v2/free/filters' | ||
}, | ||
regular: /\/rest\/v2\/free\/filters/ | ||
}, | ||
// 得到房间详细信息 | ||
RoomStats: { | ||
url (libraryId) { | ||
return `/rest/v2/room/stats2/${libraryId}` | ||
}, | ||
regular: /\/rest\/v2\/room\/stats2\// | ||
}, | ||
ValidateToken: { | ||
// 验证 token 是否可用 | ||
url () { | ||
return '/rest/v2/violations' | ||
}, | ||
regular: /\/rest\/v2\/violations/ | ||
}, | ||
// 得到位置详细信息 | ||
LayoutByDate: { | ||
url (roomId, dateStr) { | ||
return `/rest/v2/room/layoutByDate/${roomId}/${dateStr}` | ||
}, | ||
regular: /\/rest\/v2\/room\/layoutByDate\// | ||
}, | ||
// 按时间搜索位置 | ||
SearchSeat: { | ||
url (dateStr, startTime, endTime) { | ||
return `/rest/v2/searchSeats/${dateStr}/${startTime}/${endTime}` | ||
}, | ||
regular: /\/rest\/v2\/searchSeats\// | ||
}, | ||
// 预约位置 | ||
Book: { | ||
url () { | ||
return '/rest/v2/freeBook' | ||
}, | ||
regular: /\/rest\/v2\/freeBook/ | ||
}, | ||
// 取消预约 | ||
Cancel: { | ||
url (id) { | ||
return `/rest/v2/cancel/${id}` | ||
}, | ||
regular: /\/rest\/v2\/cancel\// | ||
}, | ||
// 得到用户信息 | ||
User: { | ||
url () { | ||
return '/rest/v2/user' | ||
}, | ||
regular: /\/rest\/v2\/user/ | ||
}, | ||
// 得到预约历史 | ||
History: { | ||
url (page, count) { | ||
return `/rest/v2/history/${page}/${count}` | ||
}, | ||
regular: /\/rest\/v2\/history\// | ||
} | ||
} | ||
} | ||
|
||
export default urls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.