Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category Module API #7

Open
Raymond-Wong opened this issue Mar 4, 2015 · 0 comments
Open

Category Module API #7

Raymond-Wong opened this issue Mar 4, 2015 · 0 comments

Comments

@Raymond-Wong
Copy link
Collaborator

4. Cat Module

cat1

id 
name

cat2

id
name
cat1_id -> cat1.id
4.1 add_cat1

POST /admin/cat1/add


input:
name

output:
{
    'code': x,
    'data': {'id': 'id'}
}

local errno:
-1 same cat1 exists
4.2 edit_cat1

POST /admin/cat1/edit/<cat1_id:int>


input:
name

output:
{
    'code': x,
    'data': ''
}

local errno:
-1 same cat name exists
-2 cat1's id doesnt existed
4.3 delete_cat1

POST /admin/cat1/delete


output:
{
    'code': x,
    'data': ''
}

local errno:
-1 cat1's id doesnt exist
4.4 get_cat2

GET /admin/cat1/<cat1_id:int>/cat2


output:
{
    'code': x,
    'data': [
    {'name': 'name'}, {...},]
}

local errno:
-1 cat1_id doesnt exist
4.5 add_cat2

POST /admin/cat1/<cat1_id:int>/cat2/add


input:
name

output:
{
    'code': x,
    'data': {'id': 'id'}
}

local errno:
-1 same cat name exist
-2 cat1's id doesnt exist
4.6 edit_cat2

POST /admin/cat1/<cat1_id:int>/cat2/edit/<cat2_id:int>


input:
name

output:
{
    'code': x,
    'data': ''
}

local errno:
-1 same cat name exists
-2 cat1's id doesnt exist
-3 cat2's id doesnt exist
4.7 delete_cat2

POST /admin/cat1/<cat1_id:int>/cat1/cat2/delete/<cat2_id:int>


output:
{
    'code': x,
    'data': ''
}

local errno:
-1 cat1's id doesnt exist
-2 cat2's id doesnt exist
@Raymond-Wong Raymond-Wong changed the title Category Module Category Module API Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant