{ "swagger": "2.0", "info": { "description": "{{.Description}}", "title": "{{.Title}}", "contact": {}, "license": {}, "version": "{{.Version}}" }, "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { "/api/v1/addUserInfo": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "添加用户地址信息", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.AddUserInfo" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/addAdmin": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "添加管理员", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.Register" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/deleteAdmin": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "删除管理员", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/deleteAdmins": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "批量删除管理员", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.DeleteIds" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsStock/addGoodsStock": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品库存" ], "summary": "添加商品库存", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.AddGoodsStock" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsStock/queryByGoodsStockID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品库存" ], "summary": "查看商品库存详情", "parameters": [ { "type": "string", "description": "商品库存ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsStock/queryGoodsStocksByLimitOffset": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "商品库存" ], "summary": "分页查询商品库存(默认前100条) 并返回总记录数", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsStock/updateGoodsStock": { "put": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品库存" ], "summary": "增加商品库存、总数量", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.UpdateGoodsStock" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/addGoodsType": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "添加商品种类", "parameters": [ { "type": "string", "description": "商品名称", "name": "goods_name", "in": "formData", "required": true }, { "type": "string", "description": "商品规格 1.盒 2.瓶 3.支", "name": "goods_specs", "in": "formData" }, { "type": "float", "description": "商品成本价", "name": "goods_unitprince", "in": "formData" }, { "type": "float", "description": "商品销售价", "name": "goods_prince", "in": "formData" }, { "type": "file", "description": "商品图片", "name": "goods_image[]", "in": "formData" }, { "type": "string", "description": "生产批号", "name": "goods_batch_number", "in": "formData" }, { "type": "string", "description": "生产日期", "name": "goods_date", "in": "formData" }, { "type": "string", "description": "商品状态 1.下架 2.在售", "name": "goods_state", "in": "formData" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/deleteGoodsType": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "下架商品", "parameters": [ { "type": "string", "description": "id", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/deleteGoodsTypes": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "批量下架商品", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.DeleteIds" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/queryAllGoods": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "查询商品种类ID和商品名(支持模糊查询)", "parameters": [ { "type": "string", "description": "商品名称", "name": "goods_name", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/queryByGoodsTypeID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "查看商品种类详情", "parameters": [ { "type": "string", "description": "商品种类ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/queryGoodsTypesByLimitOffset": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "分页查询商品种类(默认前100条) 并返回总记录数", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/goodsType/updateGoodsType": { "put": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "商品种类" ], "summary": "修改商品种类信息", "parameters": [ { "type": "integer", "description": "商品ID", "name": "goods_id", "in": "formData", "required": true }, { "type": "string", "description": "商品名称", "name": "goods_name", "in": "formData", "required": true }, { "type": "string", "description": "商品规格 1.盒 2.瓶 3.支", "name": "goods_specs", "in": "formData" }, { "type": "float", "description": "商品成本价", "name": "goods_unitprince", "in": "formData" }, { "type": "float", "description": "商品销售价", "name": "goods_prince", "in": "formData" }, { "type": "file", "description": "商品图片", "name": "goods_image[]", "in": "formData" }, { "type": "string", "description": "生产批号", "name": "goods_batch_number", "in": "formData" }, { "type": "string", "description": "生产日期", "name": "goods_date", "in": "formData" }, { "type": "string", "description": "商品状态 1.下架 2.在售", "name": "goods_state", "in": "formData" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "管理员登录", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.Login" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/order/queryOrderByLimitOffset": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "分页查询订单(默认前100条) 并返回总记录数", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/queryAdmins": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "分页查询管理员(默认前100条) 并返回总记录数", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/admin/updateAdminPass": {}, "/api/v1/admin/users/queryUserByLimitOffset": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "tags": [ "管理员" ], "summary": "分页查询用户(默认前100条) 并返回总记录数", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/deleteUserInfo": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "删除户地址信息", "parameters": [ { "type": "string", "description": "用户地址ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/deleteUserInfos": { "delete": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "批量删除户地址信息", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.DeleteIds" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/login": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "用户登录", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.UserLogin" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/queryUserInfoByID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "查询用户地址信息详情", "parameters": [ { "type": "string", "description": "用户地址ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/queryUserInfoByUserID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "查询用户所有地址信息", "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/register": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "用户注册", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.UserRegister" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/updatePass": { "put": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "修改用户密码", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.UserUpdatePass" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/user/order/addOrder": { "post": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "添加订单", "parameters": [ { "description": "body", "name": "body", "in": "body", "required": true, "schema": { "type": "object", "$ref": "#/definitions/entity.AddOrder" } } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/user/order/queryByGoodsOrderID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "查询订单详情", "parameters": [ { "type": "string", "description": "订单ID", "name": "id", "in": "query", "required": true } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } }, "/api/v1/user/order/queryByOrderUserID": { "get": { "security": [ { "ApiKeyAuth": [] } ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "用户" ], "summary": "查询用户订单", "parameters": [ { "type": "string", "description": "页大小", "name": "pageSize", "in": "query" }, { "type": "string", "description": "页数", "name": "page", "in": "query" } ], "responses": { "200": { "description": "desc", "schema": { "type": "object", "$ref": "#/definitions/entity.ResponseData" } } } } } }, "definitions": { "entity.AddGoodsStock": { "type": "object", "properties": { "goods_type_id": { "description": "商品种类ID", "type": "integer" }, "quantity_total": { "description": "总数量", "type": "integer" } } }, "entity.AddOrder": { "type": "object", "properties": { "goods_details": { "description": "商品信息", "type": "array", "items": { "$ref": "#/definitions/entity.GoodsDetails" } }, "user_details": { "description": "用户信息", "type": "object", "$ref": "#/definitions/entity.UserDetails" } } }, "entity.AddUserInfo": { "type": "object", "properties": { "city": { "description": "城市", "type": "string" }, "provice": { "description": "省", "type": "string" }, "shop_address1": { "description": "门店详细地址", "type": "string" }, "tel": { "description": "收货电话", "type": "string" } } }, "entity.DeleteIds": { "type": "object", "properties": { "ids": { "description": "ids", "type": "array", "items": { "type": "integer" } } } }, "entity.GoodsDetails": { "type": "object", "properties": { "goods_qty": { "description": "商品数量", "type": "integer" }, "goods_type_id": { "description": "商品ID", "type": "integer" } } }, "entity.Login": { "type": "object", "properties": { "password": { "type": "string" }, "username": { "type": "string" } } }, "entity.Register": { "type": "object", "properties": { "administrator": { "description": "超级管理员 Y | N", "type": "string" }, "password": { "description": "密码", "type": "string" }, "username": { "description": "用户名", "type": "string" } } }, "entity.ResponseData": { "type": "object", "properties": { "data": { "type": "object" }, "message": { "type": "string" }, "status": { "type": "boolean" } } }, "entity.UpdateGoodsStock": { "type": "object", "properties": { "add_quantity": { "description": "添加库存数量", "type": "integer" }, "goods_stock_id": { "description": "库存ID", "type": "integer" } } }, "entity.UpdatePass": { "type": "object", "properties": { "newPassword": { "description": "密码", "type": "string" }, "oldPassword": { "description": "旧密码", "type": "string" } } }, "entity.UserDetails": { "type": "object", "properties": { "city": { "description": "城市", "type": "string" }, "provice": { "description": "省", "type": "string" }, "shop_address1": { "description": "门店详细地址", "type": "string" }, "tel": { "description": "联系电话", "type": "string" } } }, "entity.UserLogin": { "type": "object", "properties": { "password": { "type": "string" }, "tel": { "type": "string" } } }, "entity.UserRegister": { "type": "object", "properties": { "password": { "description": "密码", "type": "string" }, "tel": { "description": "用户名", "type": "string" } } }, "entity.UserUpdatePass": { "type": "object", "properties": { "newPassword": { "description": "密码", "type": "string" }, "oldPassword": { "description": "旧密码", "type": "string" } } } }, "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Authorization", "in": "header" } } }