Skip to content
Siyuan Zhang | 张豆 edited this page Oct 11, 2019 · 1 revision

Get All Groups

HTTP Request

GET /api/v1/groups

Response

[
    {
        "id": 123,
        "name": "更改",
        "createDate": "2018-10-04T16:31:40",
        "jwtUserList": [
            {
                "username": "shu-test",
                "firstname": null,
                "lastname": null,
                "email": "[email protected]",
                "school": "上海大学",
                "signature": null,
                "acCount": 0,
                "submitCount": 0,
                "acRate": 0,
                "enabled": true,
                "authorities": [
                    {
                        "authority": "ROLE_USER"
                    }
                ]
            },
            {
                "username": "Sylvia",
                "firstname": null,
                "lastname": null,
                "email": "[email protected]",
                "school": "上海大学",
                "signature": null,
                "acCount": 0,
                "submitCount": 0,
                "acRate": 0,
                "enabled": true,
                "authorities": [
                    {
                        "authority": "ROLE_ADMIN"
                    }
                ]
            }
        ]
    },
    {
        "id": 125,
        "name": "test three!!!",
        "createDate": "2018-09-18T21:30:00",
        "jwtUserList": [
            {
                "username": "test",
                "firstname": null,
                "lastname": null,
                "email": "[email protected]",
                "school": "上海大学",
                "signature": null,
                "acCount": 0,
                "submitCount": 0,
                "acRate": 0,
                "enabled": true,
                "authorities": [
                    {
                        "authority": "ROLE_ADMIN"
                    }
                ]
            }
        ]
    }
]

Get a Specific Group

HTTP Request

GET /api/v1/groups/:id

Response

{
    "id": 123,
    "name": "更改",
    "createDate": "2018-10-04T16:31:40",
    "jwtUserList": [
        {
            "username": "shu-test",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_USER"
                }
            ]
        },
        {
            "username": "test",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_ADMIN"
                }
            ]
        },
        {
            "username": "Sylvia",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_ADMIN"
                }
            ]
        }
    ]
}

Create a group

ADMIN Required

HTTP Request

POST /api/v1/groups

Request Parameters

Parameter Default Description
name null groupName

Response

{
    "id": 131,
    "name": "2018年冬季赛",
    "createDate": "2018-10-05T13:55:19.593",
    "jwtUserList": null
}

Update a Specific Group

ADMIN Required

HTTP Request

PUT /api/v1/groups/:id

Request Parameters

Parameter Default Description
name null

Response

{
    "id": 131,
    "name": "2018年冬季赛热身赛",
    "createDate": "2018-10-05T13:55:20",
    "jwtUserList": []
}

Delete a Specific Group

ADMIN Required

HTTP Request

DELETE /api/v1/groups/:id

Response

{
    "id": 131,
    "name": "2018年冬季赛热身赛",
    "createDate": "2018-10-05T13:55:20",
    "jwtUserList": null
}

Add Members to group

ADMIN Required

HTTP Request

POST /api/v1/groups/:id/members

Request Parameter

Parameter Default Description
userIdList null example:[20,91,111]

Response

{
    "id": 132,
    "name": "2019年春季赛",
    "createDate": "2018-10-05T14:15:53",
    "jwtUserList": [
        {
            "username": "kastnerorz",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_ADMIN"
                }
            ]
        },
        {
            "username": "iris",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_USER"
                }
            ]
        }
    ]
}

Delete Members in a specific group

ADMIN Required

HTTP Request

DELETE /api/v1/groups/:id/members

Request Parameters

Parameter Default Description
userIdList null example:[20,91,111]

Response

{
    "id": 132,
    "name": "2019年春季赛",
    "createDate": "2018-10-05T14:15:53",
    "jwtUserList": [
        {
            "username": "iris",
            "firstname": null,
            "lastname": null,
            "email": "[email protected]",
            "school": "上海大学",
            "signature": null,
            "acCount": 0,
            "submitCount": 0,
            "acRate": 0,
            "enabled": true,
            "authorities": [
                {
                    "authority": "ROLE_USER"
                }
            ]
        }
    ]
}