员工管理、角色资源管理 - coupons-management/doc GitHub Wiki

创建员工

path: /user/add
method: POST
**param: **

{
  "account": "string",
  "age": 0,
  "gender": 0,
  "name": "string",
  "password": "string"
}

参数说明:account:员工账号 age:年龄 gender:性别 name:名称 password:密码

删除员工

path: /user/delete
method: POST
**param: **

{
  "account": "id"
}

参数说明: id:员工ID

员工列表

path: /user/getPage
method: POST
**param: **

{
  "account": "yuan",
  "name":"yuan",
  "pageNumber":1,
  "pageSize":10
}

参数说明:account:账号 name:名称 pageNumber:页码 pageSize:每页显示数量
返回json:

{
    "code": 0,
    "data": {
        "list": [
            {
                "account": "yuanye",
                "age": 1,
                "createTime": 1557211676000,
                "createUser": 1,
                "gender": 1,
                "heardImgUrl": null,
                "id": 1,
                "name": "yuanye",
                "password": "e10adc3949ba59abbe56e057f20f883e",
                "updateTime": 1557211678000,
                "updateUser": 1
            }
        ],
        "pageNumber": 1,
        "pageSize": 10,
        "totalCount": 1,
        "totalPage": 1
    },
    "message": "请求成功",
    "success": true
}

更新员工

path: /user/update
method: POST
**param: **

{
	"id":201,
	"account":"xxnet213",
	"name":"xxnet21-name3",
	"password":"123456",	
	"age":"21",
        "gender":1
}

**参数说明: id:员工ID account:账号 name:名称 password:密码 age:年龄 gender:性别 **

分配员工商家(全量修改)

path: /user/assignStore
method: POST
**param: **

{
	"userId":201,
	"stores":[120663,120662]
}

**参数说明: userId:员工ID stores:商家ID数组 **

分配员工角色(全量修改)

path: /user/assignRole
method: POST
**param: **

{
	"userId":201,
	"roles":[2,3]
}

**参数说明: userId:员工ID roles:角色ID数组 **

员工拥有角色列表

path: /user/roles
method: POST
**param: **

{
	"id":201
}

**参数说明: id:员工ID **
返回json:

{
    "code": 0,
    "data": [
        {
            "createTime": null,
            "createUser": null,
            "description": "string",
            "id": 2,
            "name": "string",
            "type": "NORMAL",
            "updateTime": null,
            "updateUser": null
        },
        {
            "createTime": null,
            "createUser": null,
            "description": "string1",
            "id": 3,
            "name": "string1",
            "type": "NORMAL",
            "updateTime": null,
            "updateUser": null
        }
    ],
    "message": "请求成功",
    "success": true
}

尚未分配给员工的商家列表

path: /store/availableAssign
method: POST
**param: **

{
	"name":"Columbia",
	"pageNumber":1,
	"pageSize":2
}

参数说明: name:名称 pageNumber:页码 pageSize:每页显示数量
返回json:

{
    "code": 0,
    "data": {
        "list": [
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": 1562053477000,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120663,
                "inType": null,
                "isComplete": "1",
                "logoUrl": "https://sgi.offerscdn.net/i/zdcs-merchants/077lXzUyrQlWNczuzjpooEE.h90.w170.flpad.v19.bffffff.png",
                "name": "Columbia Sportswear Canada",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": 8622,
                "typeName": "Sportswear & Gear",
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbiasportswear.ca/en/sale-discount-outlet/?avad=111473_d16451581&mid=affiliate&eid=avantlink&uid=470961&nid=92677&utm_medium=affiliate",
                "websiteCrc": null
            },
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": 1562053474000,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120662,
                "inType": null,
                "isComplete": "1",
                "logoUrl": "https://sgi.offerscdn.net/i/zdcs-merchants/025uyRun5v1JSeMmdpTepYh.h90.w170.flpad.v241.bffffff.png",
                "name": "Columbia Sportswear",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": 8622,
                "typeName": "Sportswear & Gear",
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbia.com/Default-Start?cjevent=a5a31c669c8d11e98055007d0a240614&eid=cj&mid=affiliate&nid=3211374&uid=10725898&utm_medium=affiliate",
                "websiteCrc": null
            }
        ],
        "pageNumber": 1,
        "pageSize": 2,
        "totalCount": 8,
        "totalPage": 4
    },
    "message": "请求成功",
    "success": true
}

员工管理商家列表

path: /user/stores
method: POST
**param: **

{
	"userId":201,
	"name":"Sportswear",
	"pageNumber":1,
	"pageSize":10
}

参数说明: userId:员工ID name:名称 pageNumber:页码 pageSize:每页显示数量
返回json:

{
    "code": 0,
    "data": {
        "list": [
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": null,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120663,
                "inType": null,
                "isComplete": null,
                "logoUrl": null,
                "name": "Columbia Sportswear Canada",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": null,
                "typeName": null,
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbiasportswear.ca/en/sale-discount-outlet/?avad=111473_d16451581&mid=affiliate&eid=avantlink&uid=470961&nid=92677&utm_medium=affiliate",
                "websiteCrc": null
            },
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": null,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120662,
                "inType": null,
                "isComplete": null,
                "logoUrl": null,
                "name": "Columbia Sportswear",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": null,
                "typeName": null,
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbia.com/Default-Start?cjevent=a5a31c669c8d11e98055007d0a240614&eid=cj&mid=affiliate&nid=3211374&uid=10725898&utm_medium=affiliate",
                "websiteCrc": null
            }
        ],
        "pageNumber": 1,
        "pageSize": 10,
        "totalCount": 2,
        "totalPage": 1
    },
    "message": "请求成功",
    "success": true
}

当前用户管理商家列表

path: /user/currentStores
method: POST
**param: **

{
	"name":"Sportswear",
	"pageNumber":1,
	"pageSize":1
}

参数说明: userId:员工ID name:名称 pageNumber:页码 pageSize:每页显示数量
返回json:

{
    "code": 0,
    "data": {
        "list": [
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": null,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120663,
                "inType": null,
                "isComplete": null,
                "logoUrl": null,
                "name": "Columbia Sportswear Canada",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": null,
                "typeName": null,
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbiasportswear.ca/en/sale-discount-outlet/?avad=111473_d16451581&mid=affiliate&eid=avantlink&uid=470961&nid=92677&utm_medium=affiliate",
                "websiteCrc": null
            },
            {
                "advertising": null,
                "approval": "0",
                "country": "US",
                "couponCount": null,
                "couponCountValid": null,
                "createTime": null,
                "createUser": null,
                "createdAt": null,
                "des": null,
                "id": 120662,
                "inType": null,
                "isComplete": null,
                "logoUrl": null,
                "name": "Columbia Sportswear",
                "nameCrc": null,
                "storeId": 0,
                "title": null,
                "typeId": null,
                "typeName": null,
                "updateTime": null,
                "updateUser": null,
                "uuid": null,
                "website": "https://www.columbia.com/Default-Start?cjevent=a5a31c669c8d11e98055007d0a240614&eid=cj&mid=affiliate&nid=3211374&uid=10725898&utm_medium=affiliate",
                "websiteCrc": null
            }
        ],
        "pageNumber": 1,
        "pageSize": 10,
        "totalCount": 2,
        "totalPage": 1
    },
    "message": "请求成功",
    "success": true
}

新增角色

path: /role/add
method: POST
**param: **

{
  "description": "普通管理员",
  "name": "普通管理员"
}

**参数说明: name:角色名称 description:角色描述 **

修改角色基本信息

path: /role/update
method: POST
**param: **

{
  "id":4,
  "description": "普通管理员1",
  "name": "普通管理员1"
}

**参数说明: id:角色ID name:角色名称 description:角色描述 **

删除角色

path: /role/delete
method: POST
**param: **

{
  "id": 5
}

**参数说明: id:角色ID **

角色资源列表

path: /role/resource
method: POST
**param: **

{
  "id": 2
}

**参数说明: id:角色ID **
返回json:

{
	"code": 0,
	"data": [{
		"id": 6,
		"name": "维护操作",
		"pid": 1,
		"url": "/spider/spiderMaintain"
	}, {
		"id": 8,
		"name": "绿站",
		"pid": 7,
		"url": "/site/site1"
	}, {
		"id": 9,
		"name": "橙站",
		"pid": 7,
		"url": "/site/site2"
	}],
	"message": "请求成功",
	"success": true
}

当前用户资源树

path: /role/currentResource
method: POST
返回json:

{
    "code": 0,
    "data": [
        {
            "children": [
                {
                    "children": [],
                    "id": 6,
                    "name": "维护操作",
                    "orderNum": 6,
                    "pid": 1,
                    "url": "/spider/spiderMaintain"
                }
            ],
            "id": 1,
            "name": "基本数据",
            "orderNum": 1,
            "pid": null,
            "url": null
        },
        {
            "children": [
                {
                    "children": [],
                    "id": 8,
                    "name": "绿站",
                    "orderNum": 8,
                    "pid": 7,
                    "url": "/site/site1"
                },
                {
                    "children": [],
                    "id": 9,
                    "name": "橙站",
                    "orderNum": 9,
                    "pid": 7,
                    "url": "/site/site2"
                }
            ],
            "id": 7,
            "name": "网站数据",
            "orderNum": 7,
            "pid": null,
            "url": null
        },
        {
            "children": [],
            "id": 10,
            "name": "商家审核",
            "orderNum": 10,
            "pid": null,
            "url": "/storeCheck/check"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": 19,
                    "name": "角色管理",
                    "orderNum": 19,
                    "pid": 18,
                    "url": "/power/roleManage"
                }
            ],
            "id": 18,
            "name": "权限管理",
            "orderNum": 18,
            "pid": null,
            "url": null
        }
    ],
    "message": "请求成功",
    "success": true
}

全部资源树

path: /role/allResource
method: POST
返回json:

{
    "code": 0,
    "data": [
        {
            "children": [
                {
                    "children": [],
                    "id": 6,
                    "name": "维护操作",
                    "orderNum": 6,
                    "pid": 1,
                    "url": "/spider/spiderMaintain"
                }
            ],
            "id": 1,
            "name": "基本数据",
            "orderNum": 1,
            "pid": null,
            "url": null
        },
        {
            "children": [
                {
                    "children": [],
                    "id": 8,
                    "name": "绿站",
                    "orderNum": 8,
                    "pid": 7,
                    "url": "/site/site1"
                },
                {
                    "children": [],
                    "id": 9,
                    "name": "橙站",
                    "orderNum": 9,
                    "pid": 7,
                    "url": "/site/site2"
                }
            ],
            "id": 7,
            "name": "网站数据",
            "orderNum": 7,
            "pid": null,
            "url": null
        },
        {
            "children": [],
            "id": 10,
            "name": "商家审核",
            "orderNum": 10,
            "pid": null,
            "url": "/storeCheck/check"
        },
        {
            "children": [
                {
                    "children": [],
                    "id": 19,
                    "name": "角色管理",
                    "orderNum": 19,
                    "pid": 18,
                    "url": "/power/roleManage"
                }
            ],
            "id": 18,
            "name": "权限管理",
            "orderNum": 18,
            "pid": null,
            "url": null
        }
    ],
    "message": "请求成功",
    "success": true
}

修改角色资源(全量修改)

path: /role/updateResource
method: POST
**param: **

{
  "roleId": 2,
  "resources": [
    6,7,8,9
  ]
}

参数说明: roleId:角色ID resources:资源ID数组

全部角色列表

path: /role/list
method: POST
返回json:

{
    "code": 0,
    "data": [
        {
            "createTime": null,
            "createUser": null,
            "description": "管理员",
            "id": 1,
            "name": "管理员",
            "type": "ADMIN",
            "updateTime": null,
            "updateUser": null
        },
        {
            "createTime": 1564046194000,
            "createUser": 1,
            "description": "test",
            "id": 9,
            "name": "test",
            "type": "NORMAL",
            "updateTime": null,
            "updateUser": null
        },
        {
            "createTime": 1562316774000,
            "createUser": 201,
            "description": "普通管理员",
            "id": 4,
            "name": "普通管理员",
            "type": "NORMAL",
            "updateTime": 1563954126000,
            "updateUser": 1
        }
    ],
    "message": "请求成功",
    "success": true
}

分配、取消分配商家

path: /user/assignOrCancel
method: POST
**param: **

{
	"userId":234,
	"storeId":"82892",
	"operation":1
}

参数说明: userId:用户id storeId:商家id operation:操作 1:分配 2:取消分配

⚠️ **GitHub.com Fallback** ⚠️