$.ajax({
type: "HTTP Method",
url: "/eample",
data:{
parameter1:"value1",
parameter2:"value2"
},
success: function(response) {
//Deal with response
}
});
$.ajax({
type: "HTTP Method",
url: "/example?parameter1=value1¶meter2=value2",
success: function(response) {
//Deal with response
}
});
$.ajax({
type: "HTTP Method",
url: "/example/parameter",
success: function(response) {
//Deal with response
}
});
To check whether the session is login
{
me:{
UserID:"UserID",
Email:"Email",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role"
}
}
{
error:"notLogin"
}
Get all users
Query | Requirement | Type |
---|---|---|
talent | option | string |
major | option | string |
{
users:[{
UserID:"UserID",
Email:"Email",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role"
}]
}
Create a user in db
Body | Requirement | Type |
---|---|---|
userid | require | string |
pw | require | string |
name | require | string |
require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Login a user
Body | Requirement | Type |
---|---|---|
userid | require | string |
pw | require | string |
"ok"
{
error:"errormsg"
}
Update a user's data
Body | Requirement | Type |
---|---|---|
userid | require | string |
major | require | string |
name | require | string |
require | string | |
talent | require | string |
description | require | string |
website | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Get user's message
Need login
{
msg:[{
FromID:"id",
ToID:"id",
Context:"context",
IsRead:true,
FromIDType:"FromIDType",
ToIDType:"ToIDType",
CreateAt:"CreateAt"
}]
}
Get one user's data
Query | Requirement | Type |
---|---|---|
id | require | string |
{
user:{
UserID:"UserID",
Email:"Email",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role"
}
}
{
error:"errormsg"
}
Get all projects
{
projects:[{
Type:"type",
Time:["date"],
Goal:"goal",
Need:["need"],
Sponser:["sponser"],
Description:"description",
ApplyID:["applyid"],
MemberID:["memberid"],
AdminID:["adminid"],
GroupID:"groupid",
CreateAt:"createat"
}]
}
Create a project
Need login
Body | Requirement | Type |
---|---|---|
group_id | option | string |
name | require | string |
type | require | string |
time | require | string split by , |
goal | require | string |
need | require | string split by , |
description | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Update a project
Need login
Params | Requirement | Type |
---|---|---|
id | require | string |
Body | Requirement | Type |
---|---|---|
name | require | string |
type | require | string |
time | require | string split by , |
goal | require | string |
need | require | string split by , |
description | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Show the user that apply for the project
Params | Requirement | Type |
---|---|---|
id | require | string |
{
apply:[{
UserID:"UserID",
Email:"Email",
Password:"pw",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role",
CreateAt:"CreateAt"
}]
}
{
error:"errormsg"
}
That user join a project
Body | Requirement | Type |
---|---|---|
project_id | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
That user quit from a project
Body | Requirement | Type |
---|---|---|
project_id | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Allow user join the project
Params | Requirement | Type |
---|---|---|
id | require | string |
uid | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Delete member form the project
Params | Requirement | Type |
---|---|---|
id | require | string |
uid | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Delete a project
Params | Requirement | Type |
---|---|---|
id | require | string |
"ok"
{
error:"errormsg1"
}
Get the infomation about the project
Params | Requirement | Type |
---|---|---|
id | require | string |
{
project:{
Type:"type",
Time:["date"],
Goal:"goal",
Need:["need"],
Sponser:["sponser"],
Description:"description",
ApplyID:["applyid"],
MemberID:["memberid"],
AdminID:["adminid"],
GroupID:"groupid",
CreateAt:"createat"
},
comments:[{
ProjectID:"ProjectID",
Context:"context",
PeopleID:"PeopleID",
ResCommentID:"ResCommentID",
CreateAt:"CreateAt"
}],
members:[{
UserID:"UserID",
Email:"Email",
Password:"pw",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role",
CreateAt:"CreateAt"
}]
}
{
error:"errormsg"
}
Get all activity
{
activity:[{
Type:"type",
Description:"Description",
Time:["time"],
MemberID:["memberid"],
AdminID:["adminid"],
Context:"context",
GroupID:["groupid"],
CreateAt:"CreateAt"
}]
}
Need login
Create a activity
Body | Requirement | Type |
---|---|---|
group_id | option | string |
name | require | string |
type | require | string |
description | require | string |
time | require | string split by , |
context | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Update an activity
Need login
Params | Requirement | Type |
---|---|---|
id | require | string |
Body | Requirement | Type |
---|---|---|
name | require | string |
type | require | string |
time | require | string split by , |
context | require | string |
description | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Join an activity
Body | Requirement | Type |
---|---|---|
activity_id | require | string |
user_id | require | string |
"ok"
"notFound"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Quit from an activity
Body | Requirement | Type |
---|---|---|
activity_id | require | string |
user_id | require | string |
"ok"
"notFound"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Params | Requirement | Type |
---|---|---|
id | require | string |
{
activity:{
Type:"type",
Description:"Description",
Time:["time"],
MemberID:["memberid"],
AdminID:["adminid"],
Context:"context",
GroupID:["groupid"],
CreateAt:"CreateAt"
},
comments:[{
ProjectID:"ProjectID",
Context:"context",
PeopleID:"PeopleID",
ResCommentID:"ResCommentID",
CreateAt:"CreateAt"
}],
members:[{
UserID:"UserID",
Email:"Email",
Name:"name",
Major:"major",
Talent:["talent"],
Description:"description",
Website:"website",
Role:"role"
}]
}
{
error:"errormsg"
}
Send message
need login
Body | Requirement | Type |
---|---|---|
fromgid | option | string |
touid | option | string |
togid | option | string |
context | require | string |
"ok"
{
error:[
"errormsg1",
"errormsg2",
"errormsg3"
]
}
Delete message
need login
Query | Requirement | Type |
---|---|---|
id | require | string |
"ok"
{
error:"errormsg1"
}