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/9k=",
    "code": 200,
    "uuid": "2cb831addae746a3a145b8b35ef18a24"
}

2. 登录请求

POST
http://localhost/dev-api/login?username=admin&password=admin123&code=n27u&uuid=59009263b52b42e8bac6c62cc1bdf7a0

{
    "msg": "操作成功",
    "code": 200,
    "token": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjJmNDI2MTYxLWUxOTktNDMyNS04ZGVkLWU3YzBkMGZlZjMyNSJ9.yhMPTLt3xh4lnS7VoaAEg_xAZyFsy-kK74vuTvipn2vEwOMLmHKlHcHN47SGfqnW0uGKjZIvHhPg_33krM5uPA"
}

3. 获得路由规则

GET
http://localhost/dev-api/getRouters

{
    "msg": "操作成功",
    "code": 200,
    "data": [
        {
            "name": "System",
            "path": "/system",
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "系统管理",
                "icon": "system"
            },
            "children": [
                {
                    "name": "User",
                    "path": "user",
                    "component": "system/user/index",
                    "meta": {
                        "title": "用户管理",
                        "icon": "user"
                    }
                },
                {
                    "name": "Role",
                    "path": "role",
                    "component": "system/role/index",
                    "meta": {
                        "title": "角色管理",
                        "icon": "peoples"
                    }
                },
                {
                    "name": "Menu",
                    "path": "menu",
                    "component": "system/menu/index",
                    "meta": {
                        "title": "菜单管理",
                        "icon": "tree-table"
                    }
                },
                {
                    "name": "Dept",
                    "path": "dept",
                    "component": "system/dept/index",
                    "meta": {
                        "title": "部门管理",
                        "icon": "tree"
                    }
                },
                {
                    "name": "Post",
                    "path": "post",
                    "component": "system/post/index",
                    "meta": {
                        "title": "岗位管理",
                        "icon": "post"
                    }
                },
                {
                    "name": "Dict",
                    "path": "dict",
                    "component": "system/dict/index",
                    "meta": {
                        "title": "字典管理",
                        "icon": "dict"
                    }
                },
                {
                    "name": "Config",
                    "path": "config",
                    "component": "system/config/index",
                    "meta": {
                        "title": "参数设置",
                        "icon": "edit"
                    }
                },
                {
                    "name": "Notice",
                    "path": "notice",
                    "component": "system/notice/index",
                    "meta": {
                        "title": "通知公告",
                        "icon": "message"
                    }
                },
                {
                    "name": "Log",
                    "path": "log",
                    "redirect": "noRedirect",
                    "component": "system/log/index",
                    "alwaysShow": true,
                    "meta": {
                        "title": "日志管理",
                        "icon": "log"
                    },
                    "children": [
                        {
                            "name": "Operlog",
                            "path": "operlog",
                            "component": "monitor/operlog/index",
                            "meta": {
                                "title": "操作日志",
                                "icon": "form"
                            }
                        },
                        {
                            "name": "Logininfor",
                            "path": "logininfor",
                            "component": "monitor/logininfor/index",
                            "meta": {
                                "title": "登录日志",
                                "icon": "logininfor"
                            }
                        }
                    ]
                }
            ]
        },
        {
            "name": "Monitor",
            "path": "/monitor",
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "系统监控",
                "icon": "monitor"
            },
            "children": [
                {
                    "name": "Online",
                    "path": "online",
                    "component": "monitor/online/index",
                    "meta": {
                        "title": "在线用户",
                        "icon": "online"
                    }
                },
                {
                    "name": "Job",
                    "path": "job",
                    "component": "monitor/job/index",
                    "meta": {
                        "title": "定时任务",
                        "icon": "job"
                    }
                },
                {
                    "name": "Druid",
                    "path": "druid",
                    "component": "monitor/druid/index",
                    "meta": {
                        "title": "数据监控",
                        "icon": "druid"
                    }
                },
                {
                    "name": "Server",
                    "path": "server",
                    "component": "monitor/server/index",
                    "meta": {
                        "title": "服务监控",
                        "icon": "server"
                    }
                }
            ]
        },
        {
            "name": "Tool",
            "path": "/tool",
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "系统工具",
                "icon": "tool"
            },
            "children": [
                {
                    "name": "Build",
                    "path": "build",
                    "component": "tool/build/index",
                    "meta": {
                        "title": "表单构建",
                        "icon": "build"
                    }
                },
                {
                    "name": "Gen",
                    "path": "gen",
                    "component": "tool/gen/index",
                    "meta": {
                        "title": "代码生成",
                        "icon": "code"
                    }
                },
                {
                    "name": "Swagger",
                    "path": "swagger",
                    "component": "tool/swagger/index",
                    "meta": {
                        "title": "系统接口",
                        "icon": "swagger"
                    }
                }
            ]
        },
        {
            "name": "Http://ruoyi.vip",
            "path": "http://ruoyi.vip",
            "component": "Layout",
            "meta": {
                "title": "若依官网",
                "icon": "guide"
            }
        },
        {
            "name": "Asset",
            "path": "/asset",
            "redirect": "noRedirect",
            "component": "Layout",
            "alwaysShow": true,
            "meta": {
                "title": "资产管理",
                "icon": "example"
            },
            "children": [
                {
                    "name": "BaseManagement",
                    "path": "BaseManagement",
                    "component": "web/BaseManagement/index",
                    "meta": {
                        "title": "基地管理",
                        "icon": "code"
                    }
                }
            ]
        }
    ]
}

3. 获得所有信息

GET
http://localhost/dev-api/getInfo

{
    "msg": "操作成功",
    "code": 200,
    "permissions": [
        "*:*:*"
    ],
    "roles": [
        "admin"
    ],
    "user": {
        "searchValue": null,
        "createBy": "admin",
        "createTime": "2018-03-16 11:33:00",
        "updateBy": null,
        "updateTime": null,
        "remark": "管理员",
        "dataScope": null,
        "params": {},
        "userId": 1,
        "deptId": 103,
        "userName": "admin",
        "nickName": "若依",
        "email": "ry@163.com",
        "phonenumber": "15888888888",
        "sex": "1",
        "avatar": "",
        "password": "$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2",
        "salt": null,
        "status": "0",
        "delFlag": "0",
        "loginIp": "127.0.0.1",
        "loginDate": "2018-03-16T11:33:00.000+0800",
        "dept": {
            "searchValue": null,
            "createBy": null,
            "createTime": null,
            "updateBy": null,
            "updateTime": null,
            "remark": null,
            "dataScope": null,
            "params": {},
            "deptId": 103,
            "parentId": 101,
            "ancestors": null,
            "deptName": "研发部门",
            "orderNum": "1",
            "leader": "若依",
            "phone": null,
            "email": null,
            "status": "0",
            "delFlag": null,
            "parentName": null,
            "children": []
        },
        "roles": [
            {
                "searchValue": null,
                "createBy": null,
                "createTime": null,
                "updateBy": null,
                "updateTime": null,
                "remark": null,
                "dataScope": "1",
                "params": {},
                "roleId": 1,
                "roleName": "管理员",
                "roleKey": "admin",
                "roleSort": "1",
                "status": "0",
                "delFlag": null,
                "flag": false,
                "menuIds": null,
                "deptIds": null,
                "admin": true
            }
        ],
        "roleIds": null,
        "postIds": null,
        "admin": true
    }
}

5. 查询列表

GET
http://localhost/dev-api/web/BaseManagement/list?pageNum=1&pageSize=10

{
    "total": 3,
    "rows": [
        {
            "searchValue": null,
            "createBy": null,
            "createTime": null,
            "updateBy": null,
            "updateTime": null,
            "remark": null,
            "dataScope": null,
            "params": {},
            "id": 8,
            "baseNumber": 2,
            "baseName": "2",
            "baseAddress": "2",
            "baseCoordinateLongitude": 119.32847,
            "baseCoordinateLatitude": 32.09687
        },
        {
            "searchValue": null,
            "createBy": null,
            "createTime": null,
            "updateBy": null,
            "updateTime": null,
            "remark": null,
            "dataScope": null,
            "params": {},
            "id": 9,
            "baseNumber": 3,
            "baseName": "3",
            "baseAddress": "3",
            "baseCoordinateLongitude": 119.749172,
            "baseCoordinateLatitude": 31.894506
        },
        {
            "searchValue": null,
            "createBy": null,
            "createTime": null,
            "updateBy": null,
            "updateTime": null,
            "remark": null,
            "dataScope": null,
            "params": {},
            "id": 10,
            "baseNumber": 3,
            "baseName": "3",
            "baseAddress": "3",
            "baseCoordinateLongitude": 118.847768,
            "baseCoordinateLatitude": 32.03974
        }
    ],
    "code": 200,
    "msg": 0
}

6. 新增

POST
http://localhost/dev-api/web/BaseManagement

请求参数

{
	"baseNumber": "4",
	"baseName": "4",
	"baseAddress": "4",
	"coords": "118.797751,32.049902",
	"baseCoordinateLatitude": "32.049902",
	"baseCoordinateLongitude": "118.797751"
}

响应

{
	"msg": "操作成功",
	"code": 200
}

最后查询一下

7. 修改

查询
GET
http://localhost/dev-api/web/BaseManagement/11

{
    "msg": "操作成功",
    "code": 200,
    "data": {
        "searchValue": null,
        "createBy": null,
        "createTime": null,
        "updateBy": null,
        "updateTime": null,
        "remark": null,
        "dataScope": null,
        "params": {},
        "id": 11,
        "baseNumber": 4,
        "baseName": "4",
        "baseAddress": "4",
        "baseCoordinateLongitude": 118.799215,
        "baseCoordinateLatitude": 32.049787
    }
}

修改
PUT
http://localhost/dev-api/web/BaseManagement

传入参数

{
	"searchValue": null,
	"createBy": null,
	"createTime": null,
	"updateBy": null,
	"updateTime": null,
	"remark": null,
	"dataScope": null,
	"params": {},
	"id": 11,
	"baseNumber": 4,
	"baseName": "4",
	"baseAddress": "4",
	"baseCoordinateLongitude": "118.799215",
	"baseCoordinateLatitude": "32.049787",
	"coords": "118.799215,32.049787"
}

响应

{
    "msg": "操作成功",
    "code": 200,
    "data": {
        "searchValue": null,
        "createBy": null,
        "createTime": null,
        "updateBy": null,
        "updateTime": null,
        "remark": null,
        "dataScope": null,
        "params": {},
        "id": 11,
        "baseNumber": 4,
        "baseName": "4",
        "baseAddress": "4",
        "baseCoordinateLongitude": 118.799215,
        "baseCoordinateLatitude": 32.049787
    }
}

最后查询一下

8. 删除

DELETE
http://localhost/dev-api/web/BaseManagement/11

{
	"msg": "操作成功",
	"code": 200
}

9. 获得树表数据(公司数据)

GET
http://localhost/dev-api/system/dept/treeselect

{
	"msg": "操作成功",
	"code": 200,
	"data": [{
		"id": 100,
		"label": "若依科技",
		"children": [{
			"id": 101,
			"label": "深圳总公司",
			"children": [{
				"id": 103,
				"label": "研发部门"
			}, {
				"id": 104,
				"label": "市场部门"
			}, {
				"id": 105,
				"label": "测试部门"
			}, {
				"id": 106,
				"label": "财务部门"
			}, {
				"id": 107,
				"label": "运维部门"
			}]
		}, {
			"id": 102,
			"label": "长沙分公司",
			"children": [{
				"id": 108,
				"label": "市场部门"
			}, {
				"id": 109,
				"label": "财务部门"
			}]
		}]
	}]
}

10. 查询数据字典

GET
http://localhost/dev-api/system/dict/data/dictType/sys_user_sex

{
    "msg": "操作成功",
    "code": 200,
    "data": [
        {
            "searchValue": null,
            "createBy": "admin",
            "createTime": "2018-03-16 11:33:00",
            "updateBy": null,
            "updateTime": null,
            "remark": "性别男",
            "dataScope": null,
            "params": {},
            "dictCode": 1,
            "dictSort": 1,
            "dictLabel": "男",
            "dictValue": "0",
            "dictType": "sys_user_sex",
            "cssClass": "",
            "listClass": "",
            "isDefault": "Y",
            "status": "0",
            "default": true
        },
        {
            "searchValue": null,
            "createBy": "admin",
            "createTime": "2018-03-16 11:33:00",
            "updateBy": null,
            "updateTime": null,
            "remark": "性别女",
            "dataScope": null,
            "params": {},
            "dictCode": 2,
            "dictSort": 2,
            "dictLabel": "女",
            "dictValue": "1",
            "dictType": "sys_user_sex",
            "cssClass": "",
            "listClass": "",
            "isDefault": "N",
            "status": "0",
            "default": false
        },
        {
            "searchValue": null,
            "createBy": "admin",
            "createTime": "2018-03-16 11:33:00",
            "updateBy": null,
            "updateTime": null,
            "remark": "性别未知",
            "dataScope": null,
            "params": {},
            "dictCode": 3,
            "dictSort": 3,
            "dictLabel": "未知",
            "dictValue": "2",
            "dictType": "sys_user_sex",
            "cssClass": "",
            "listClass": "",
            "isDefault": "N",
            "status": "0",
            "default": false
        }
    ]
}
Logo

快速构建 Web 应用程序

更多推荐