| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-s/v1/organize/department": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "查询部门信息列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Department" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "添加部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.AddDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-s/v1/organize/department/{id}": { |
| | | "put": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "编辑部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "编辑部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "definitions": { |
| | |
| | | "valid": { |
| | | "description": "Valid is true if Time is not NULL", |
| | | "type": "boolean" |
| | | } |
| | | } |
| | | }, |
| | | "models.Department": { |
| | | "type": "object", |
| | | "properties": { |
| | | "children": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Department" |
| | | } |
| | | }, |
| | | "head": { |
| | | "description": "部门负责人", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | }, |
| | | "sort": { |
| | | "description": "排序", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddDepartment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID 一级部门传0", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddDict": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "number": { |
| | | "description": "编码", |
| | | "type": "string" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateDepartment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID 一级部门传0", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-s/v1/organize/department": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "查询部门信息列表", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "description": "页码", |
| | | "name": "page", |
| | | "in": "query" |
| | | }, |
| | | { |
| | | "type": "integer", |
| | | "description": "每页大小", |
| | | "name": "pageSize", |
| | | "in": "query" |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.ResponseList" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Department" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "post": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "添加部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.AddDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-s/v1/organize/department/{id}": { |
| | | "put": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "编辑部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "delete": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "部门信息" |
| | | ], |
| | | "summary": "编辑部门信息", |
| | | "parameters": [ |
| | | { |
| | | "description": "部门信息信息", |
| | | "name": "object", |
| | | "in": "body", |
| | | "required": true, |
| | | "schema": { |
| | | "$ref": "#/definitions/request.UpdateDepartment" |
| | | } |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "$ref": "#/definitions/util.Response" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "definitions": { |
| | |
| | | "valid": { |
| | | "description": "Valid is true if Time is not NULL", |
| | | "type": "boolean" |
| | | } |
| | | } |
| | | }, |
| | | "models.Department": { |
| | | "type": "object", |
| | | "properties": { |
| | | "children": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Department" |
| | | } |
| | | }, |
| | | "head": { |
| | | "description": "部门负责人", |
| | | "type": "string" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | }, |
| | | "sort": { |
| | | "description": "排序", |
| | | "type": "integer" |
| | | } |
| | | } |
| | | }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | "request.AddDepartment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID 一级部门传0", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.AddDict": { |
| | | "type": "object", |
| | | "properties": { |
| | |
| | | "number": { |
| | | "description": "编码", |
| | | "type": "string" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "request.UpdateDepartment": { |
| | | "type": "object", |
| | | "properties": { |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "name": { |
| | | "description": "部门名称", |
| | | "type": "string" |
| | | }, |
| | | "number": { |
| | | "description": "部门编号", |
| | | "type": "string" |
| | | }, |
| | | "parentId": { |
| | | "description": "上级部门ID 一级部门传0", |
| | | "type": "integer" |
| | | }, |
| | | "remark": { |
| | | "description": "备注", |
| | |
| | | description: Valid is true if Time is not NULL |
| | | type: boolean |
| | | type: object |
| | | models.Department: |
| | | properties: |
| | | children: |
| | | items: |
| | | $ref: '#/definitions/models.Department' |
| | | type: array |
| | | head: |
| | | description: 部门负责人 |
| | | type: string |
| | | id: |
| | | type: integer |
| | | name: |
| | | description: 部门名称 |
| | | type: string |
| | | number: |
| | | description: 部门编号 |
| | | type: string |
| | | parentId: |
| | | description: 上级部门ID |
| | | type: integer |
| | | remark: |
| | | description: 备注 |
| | | type: string |
| | | sort: |
| | | description: 排序 |
| | | type: integer |
| | | type: object |
| | | models.Dict: |
| | | properties: |
| | | createdAt: |
| | |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | request.AddDepartment: |
| | | properties: |
| | | name: |
| | | description: 部门名称 |
| | | type: string |
| | | number: |
| | | description: 部门编号 |
| | | type: string |
| | | parentId: |
| | | description: 上级部门ID 一级部门传0 |
| | | type: integer |
| | | remark: |
| | | description: 备注 |
| | | type: string |
| | | type: object |
| | | request.AddDict: |
| | | properties: |
| | | dictType: |
| | |
| | | number: |
| | | description: 编码 |
| | | type: string |
| | | remark: |
| | | description: 备注 |
| | | type: string |
| | | type: object |
| | | request.UpdateDepartment: |
| | | properties: |
| | | id: |
| | | type: integer |
| | | name: |
| | | description: 部门名称 |
| | | type: string |
| | | number: |
| | | description: 部门编号 |
| | | type: string |
| | | parentId: |
| | | description: 上级部门ID 一级部门传0 |
| | | type: integer |
| | | remark: |
| | | description: 备注 |
| | | type: string |
| | |
| | | summary: 删除字典 |
| | | tags: |
| | | - 系统设置/字典 |
| | | /api-s/v1/organize/department: |
| | | get: |
| | | parameters: |
| | | - description: 页码 |
| | | in: query |
| | | name: page |
| | | type: integer |
| | | - description: 每页大小 |
| | | in: query |
| | | name: pageSize |
| | | type: integer |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.ResponseList' |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.Department' |
| | | type: array |
| | | type: object |
| | | summary: 查询部门信息列表 |
| | | tags: |
| | | - 部门信息 |
| | | post: |
| | | parameters: |
| | | - description: 部门信息信息 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.AddDepartment' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 添加部门信息 |
| | | tags: |
| | | - 部门信息 |
| | | /api-s/v1/organize/department/{id}: |
| | | delete: |
| | | parameters: |
| | | - description: 部门信息信息 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.UpdateDepartment' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 编辑部门信息 |
| | | tags: |
| | | - 部门信息 |
| | | put: |
| | | parameters: |
| | | - description: 部门信息信息 |
| | | in: body |
| | | name: object |
| | | required: true |
| | | schema: |
| | | $ref: '#/definitions/request.UpdateDepartment' |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | $ref: '#/definitions/util.Response' |
| | | summary: 编辑部门信息 |
| | | tags: |
| | | - 部门信息 |
| | | swagger: "2.0" |
| | |
| | | |
| | | urlPrefix := "/api-jl/v1" |
| | | |
| | | // 组织管理 |
| | | departmentController := new(controllers.DepartmentController) |
| | | organizeAPI := r.Group(urlPrefix + "/organize") |
| | | { |
| | | organizeAPI.GET("department", departmentController.List) // 获取部门列表 |
| | | organizeAPI.POST("department", departmentController.Add) // 新增部门 |
| | | organizeAPI.PUT("department/:id", departmentController.Update) // 修改部门 |
| | | organizeAPI.DELETE("department/:id", departmentController.Delete) // 删除部门 |
| | | } |
| | | |
| | | // 词典管理 |
| | | DictController := new(controllers.DictController) |
| | | systemApi := r.Group(urlPrefix + "/system") |