swagger.yaml 12.2 KB
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1
basePath: /
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
2
definitions:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  api.AddMenuAuthorityInfo:
    properties:
      authorityId:
        type: string
      menus:
        items:
          $ref: '#/definitions/dbModel.BaseMenu'
        type: array
    type: object
  api.AuthAndPathIn:
    properties:
      apis:
        items:
          $ref: '#/definitions/dbModel.Api'
        type: array
      authorityId:
        type: string
    type: object
  api.AuthorityIdInfo:
    properties:
      authorityId:
        type: string
    type: object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
26
  api.ChangePasswordStutrc:
27
    properties:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
28
      newPassword:
29
        type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
30
      password:
31
        type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
32
      username:
33 34
        type: string
    type: object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
35 36 37 38 39 40 41 42 43 44
  api.CreateApiParams:
    properties:
      description:
        type: string
      path:
        type: string
    type: object
  api.CreateAuthorityPatams:
    properties:
      authorityId:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
45
        type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
46 47 48 49
      authorityName:
        type: string
    type: object
  api.DeleteApiParams:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
50 51 52
    properties:
      path:
        type: integer
Mr.奇淼('s avatar
Mr.奇淼( 已提交
53 54 55 56 57 58
    type: object
  api.DeleteAuthorityPatams:
    properties:
      authorityId:
        type: integer
    type: object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
59 60 61 62 63
  api.IdInfo:
    properties:
      id:
        type: number
    type: object
64
  api.RegistAndLoginStuct:
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
65
    properties:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
66
      password:
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
67
        type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
68
      username:
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
69 70
        type: string
    type: object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
  dbModel.Api:
    properties:
      description:
        type: string
      path:
        type: string
    type: object
  dbModel.BaseMenu:
    properties:
      children:
        items:
          $ref: '#/definitions/dbModel.BaseMenu'
        type: array
      component:
        type: string
      hidden:
        type: boolean
      icon:
        type: string
      name:
        type: string
      nickName:
        type: string
      parentId:
        type: string
      path:
        type: string
      title:
        type: string
    type: object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
101 102 103 104 105 106 107
  modelInterface.PageInfo:
    properties:
      page:
        type: integer
      pageSize:
        type: integer
    type: object
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
108 109
info:
  contact: {}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
110
  description: This is a sample Server pets
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
111
  license: {}
Mr.奇淼('s avatar
Mr.奇淼( 已提交
112 113
  title: Swagger Example API
  version: 0.0.1
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
114
paths:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
115
  /api/createApi:
116
    post:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
117 118
      consumes:
      - application/json
119
      parameters:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
120
      - description: 创建api
121 122 123 124
        in: body
        name: data
        required: true
        schema:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
125
          $ref: '#/definitions/api.CreateApiParams'
126 127 128 129 130
          type: object
      produces:
      - application/json
      responses:
        "200":
Mr.奇淼('s avatar
Mr.奇淼( 已提交
131
          description: '{"success":true,"data":{},"msg":"获取成功"}'
132 133
          schema:
            type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
134 135
      security:
      - ApiKeyAuth: []
Mr.奇淼('s avatar
Mr.奇淼( 已提交
136
      summary: 创建基础api
137
      tags:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
138 139
      - Api
  /api/deleteApi:
140
    post:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
141 142
      consumes:
      - application/json
143
      parameters:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
      - description: 删除api
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.DeleteApiParams'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
Mr.奇淼('s avatar
Mr.奇淼( 已提交
160
      summary: 删除指定api
Mr.奇淼('s avatar
Mr.奇淼( 已提交
161 162
      tags:
      - Api
Mr.奇淼('s avatar
Mr.奇淼( 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
  /api/getApiList:
    post:
      consumes:
      - application/json
      parameters:
      - description: 分页获取用户列表
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/modelInterface.PageInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 分页获取角色列表
      tags:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
186
      - Api
Mr.奇淼('s avatar
Mr.奇淼( 已提交
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
  /api/setAuthAndPath:
    post:
      consumes:
      - application/json
      parameters:
      - description: 创建api和角色关系
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.AuthAndPathIn'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 创建api和角色关系
      tags:
      - Api
Mr.奇淼('s avatar
Mr.奇淼( 已提交
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
  /authority/createAuthority:
    post:
      consumes:
      - application/json
      parameters:
      - description: 创建角色
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.CreateAuthorityPatams'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 创建角色
      tags:
      - authority
  /authority/deleteAuthority:
    post:
      consumes:
      - application/json
      parameters:
      - description: 删除角色
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.DeleteAuthorityPatams'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 删除角色
      tags:
      - authority
Mr.奇淼('s avatar
Mr.奇淼( 已提交
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
  /authority/getAuthorityList:
    post:
      consumes:
      - application/json
      parameters:
      - description: 分页获取用户列表
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/modelInterface.PageInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 分页获取角色列表
      tags:
      - authority
Mr.奇淼('s avatar
Mr.奇淼( 已提交
283 284 285 286
  /base/login:
    post:
      parameters:
      - description: 用户登录接口
287 288 289 290 291 292 293 294 295 296
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.RegistAndLoginStuct'
          type: object
      produces:
      - application/json
      responses:
        "200":
Mr.奇淼('s avatar
Mr.奇淼( 已提交
297
          description: '{"success":true,"data":{},"msg":"登陆成功"}'
298 299
          schema:
            type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
300
      summary: 用户登录
301
      tags:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
302
      - Base
Mr.奇淼('s avatar
Mr.奇淼( 已提交
303
  /base/regist:
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
304 305
    post:
      parameters:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
306
      - description: 用户注册接口
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
307 308 309 310
        in: body
        name: data
        required: true
        schema:
311
          $ref: '#/definitions/api.RegistAndLoginStuct'
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
312 313
          type: object
      produces:
314
      - application/json
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
315 316
      responses:
        "200":
Mr.奇淼('s avatar
Mr.奇淼( 已提交
317
          description: '{"success":true,"data":{},"msg":"注册成功"}'
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
318 319
          schema:
            type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
320
      summary: 用户注册账号
Mr.奇淼('s avatar
Mr.奇淼( 已提交
321
      tags:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
322
      - Base
Mr.奇淼('s avatar
Mr.奇淼( 已提交
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
  /menu/addBaseMenu:
    post:
      consumes:
      - application/json
      parameters:
      - description: 分页获取基础menu列表
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/modelInterface.PageInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 分页获取基础menu列表
      tags:
      - menu
  /menu/addMenuAuthority:
    post:
      consumes:
      - application/json
      parameters:
      - description: 增加menu和角色关联关系
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.AuthorityIdInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 获取指定角色menu
      tags:
      - authorityAndMenu
  /menu/deleteBaseMenu:
    post:
      consumes:
      - application/json
      parameters:
      - description: 删除菜单
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.IdInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 获取指定角色menu
      tags:
      - menu
  /menu/getBaseMenuTree:
    post:
      parameters:
      - description: 可以什么都不填
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.RegistAndLoginStuct'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"返回成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 获取用户动态路由
      tags:
      - authorityAndMenu
  /menu/getMenu:
    post:
      parameters:
      - description: 可以什么都不填
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/api.RegistAndLoginStuct'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"返回成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 获取用户动态路由
      tags:
      - authorityAndMenu
  /menu/getMenuList:
    post:
      consumes:
      - application/json
      parameters:
      - description: 分页获取基础menu列表
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/modelInterface.PageInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 分页获取基础menu列表
      tags:
      - menu
Mr.奇淼('s avatar
Mr.奇淼( 已提交
463
  /user/changePassword:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
464 465 466 467 468 469 470
    post:
      parameters:
      - description: 用户修改密码
        in: body
        name: data
        required: true
        schema:
Mr.奇淼('s avatar
Mr.奇淼( 已提交
471
          $ref: '#/definitions/api.ChangePasswordStutrc'
Mr.奇淼('s avatar
Mr.奇淼( 已提交
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"修改成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 用户修改密码
      tags:
      - User
  /user/getInfoList:
    post:
      consumes:
      - application/json
      parameters:
      - description: 分页获取用户列表
        in: body
        name: data
        required: true
        schema:
          $ref: '#/definitions/modelInterface.PageInfo'
          type: object
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"获取成功"}'
          schema:
            type: string
      security:
      - ApiKeyAuth: []
      summary: 分页获取用户列表
507 508
      tags:
      - User
509 510 511 512 513 514 515 516 517 518 519 520
  /user/uploadHeaderImg:
    post:
      consumes:
      - multipart/form-data
      parameters:
      - description: 用户上传头像
        in: formData
        name: headerImg
        required: true
        type: file
      - description: 用户上传头像
        in: formData
Mr.奇淼('s avatar
Mr.奇淼( 已提交
521
        name: username
522 523 524 525 526 527 528 529 530
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: '{"success":true,"data":{},"msg":"上传成功"}'
          schema:
            type: string
Mr.奇淼('s avatar
Mr.奇淼( 已提交
531 532
      security:
      - ApiKeyAuth: []
533 534 535
      summary: 用户上传头像
      tags:
      - User
Mr.奇淼('s avatar
Mr.奇淼( 已提交
536 537 538 539 540
securityDefinitions:
  ApiKeyAuth:
    in: header
    name: x-token
    type: apiKey
Mr.奇淼('s avatar
swagger  
Mr.奇淼( 已提交
541
swagger: "2.0"