From 8fa7cc70d7017f606a858f524ea4023e53ffdb4a Mon Sep 17 00:00:00 2001 From: aarongao Date: Fri, 20 Mar 2020 14:28:46 +0800 Subject: [PATCH] .. --- README.md | 971 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ main.go | 14 +++++++++++++- 2 files changed, 984 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e69de29..f84fd58 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,971 @@ + +## 乐游图后端接口文档 +| Specification | Value | +|-----|-----| +| API Version | 1.0.0 | +| BasePath | 正式 leyoutu.st-i.com.cn; 测试 leyoutu.sti-uat.com | + + + +### API List +1. [查询所有商品](#allcommodity-get) +1. [投诉 - 查询所有投诉](#allcomplaint-get) +1. [设备管理 - 获得所有设备的等待时间](#allitemtime-get) +1. [设备管理 - 查询所有游玩项目](#allitems-get) +1. [查询所有线路](#allline-get) +1. [操作员管理 - 所有操作员](#alloperator-get) +1. [所有景区基础信息](#allscenic-get) +1. [标签 - 所有标签](#alltag-get) +1. [标签 - 按照标签分组查看所有标签](#alltaggroup-get) +1. [查询所有用户行为](#alluserlog-get) +1. [用户管理 - 检查Token是否过期](#checktoken-post) +1. [查询商品信息](#commodityinfo-get) +1. [投诉 - 增加投诉](#createcomplaint-post) +1. [查询用户的定时提醒](#dealymessage-info-get) +1. [创建提醒](#dealymessage-create-post) +1. [删除提醒](#dealymessage-remove-post) +1. [图标管理 - 返回图标基础信息](#icon-info-get) +1. [图标管理 - 增加或修改图标信息](#icon-update-post) +1. [图标管理 - 所有图标](#icon-all-get) +1. [问券调查 - 增加调查](#investigation-save-post) +1. [问券调查 - 查询所有问券调查](#investigation-list-get) +1. [设备管理 - 查询设备信息](#iteminfo-get) +1. [查询线路信息](#lineinfo-get) +1. [操作员管理 - 操作员登录](#loginoperator-post) +1. [用户管理 - 用户登录&注册](#loginuser-post) +1. [用户管理 - 注册客户端](#registerdevice-post) +1. [用户管理 - 删除用户(注销)](#removeuser-post) +1. [返回景区基础信息](#scenicinfo-get) +1. [发送短信验证码](#sms-send-post) +1. [查询系统信息接口](#systeminfo-get) +1. [标签 - 增加标签](#tag-create-post) +1. [标签 - 删除标签](#tag-remove-post) +1. [菜单管理 - 查询所有菜单](#topmenus-all-get) +1. [菜单管理 - 更新菜单](#topmenus-update-post) +1. [保存用户移动轨迹(5分钟提交一次)](#trajectory-save-post) +1. [更新商品](#updatecommodity-post) +1. [设备管理 - 更新设施](#updateitem-post) +1. [设备管理 - 更新等待时间](#updateitemtime-post) +1. [更新线路](#updateline-post) +1. [操作员管理 - 修改用户信息](#updateoperator-post) +1. [更新景区基础信息](#updatescenic-post) +1. [用户管理 - 修改用户信息](#updateuser-post) +1. [上传](#upload-post) +1. [用户管理 - 获取用户信息](#userinfo-get) +1. [增加用户行为日志](#userlog-post) + + + + + +#### /AllCommodity (GET) + + +查询所有商品 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Price=价格;ShopName=店铺名称;KvPhoto用于列表页的图片;TopPhoto详情页最上面的轮播图;Images详情页下面的产品详细图 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllComplaint (GET) + + +投诉 - 查询所有投诉 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Page | 1 | int | 当前第几页 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllItemTime (GET) + + +设备管理 - 获得所有设备的等待时间 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {5df864740a9ac17ac7a7feb8: '20',.....} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {} | + + + + + +#### /AllItems (GET) + + +设备管理 - 查询所有游玩项目 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Tags所属标签,标签有分类;LimitHeight限高;PlayDuration游玩时长;SceneTime场次时间;Picture照片;Voice音频;AverageConsumption平均消费;Menu菜单, OpenHours开放时间: LocationDescription位置描述; Reminder温馨提示; State运行状态0=正常1=停运 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllLine (GET) + + +查询所有线路 + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;SubName副标题;PlayDuration游玩时长;Suitable适合人群;Location线路点坐标;Annotations需要点亮的设施id;Distance距离 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllOperator (GET) + + +操作员管理 - 所有操作员 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | 5dfb03070a9ac17ac7a82054 | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllScenic (GET) + + +所有景区基础信息 + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllTag (GET) + + +标签 - 所有标签 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":[{"Type":"menu","Name":"服务设施"},{"Type":"normal","Name":"不错"},{"Type":"thrilling","Name":"刺激"},{"Type":"recommend","Name":"必玩"}]} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllTagGroup (GET) + + +标签 - 按照标签分组查看所有标签 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":[{"Tags":["儿童","成人","青少年"],"Type":"age"}]} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /AllUserLog (GET) + + +查询所有用户行为 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Page | 1 | int | 当前第几页 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"total":1,"currpage":1,"totalpages":1,"prepage":20,"result":} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /CheckToken (POST) + + +用户管理 - 检查Token是否过期 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":401,"errmsg":"token过期"} | + + + + + +#### /CommodityInfo (GET) + + +查询商品信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Price=价格;ShopName=店铺名称;KvPhoto用于列表页的图片;TopPhoto详情页最上面的轮播图;Images详情页下面的产品详细图 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /CreateComplaint (POST) + + +投诉 - 增加投诉 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Mobile | 18616619599 | string | 联系电话 | Yes | +| Name | 高先生 | string | 姓名 | Yes | +| Code | 123456 | string | 验证码 | Yes | +| Sex | 男 | string | 性别 | Yes | +| ScenicId | 5e1ed07524e03431008b4572 | string | 景区id | Yes | +| Type | 1 | string | 类型 | Yes | +| Content | 卫生不干净 | string | 投诉内容 | Yes | +| Image | ["http://www.xx.com/123.jpg","http://www.xx.com/123.jpg"] | string | 照片数组 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /DealyMessage/Info (GET) + + +查询用户的定时提醒 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| UserId | 5dfb03070a9ac17ac7a82054 | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | DelayTime=执行时间;Type=类型(0请求url地址1发送app通知);Fail失败次数;Title=通知标题;Content=通知内容;DeviceToken=设备id | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /DealyMessage/Create (POST) + + +创建提醒 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| UserId | 5dfb03070a9ac17ac7a82054 | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| DeviceToken | 5dfb03070a9ac17ac7a82054 | string | 设备id | Yes | +| Title | 表演时间提醒 | string | 标题 | Yes | +| Content | 5分钟后有表演 | string | 内容 | Yes | +| DelayTime | 1579066863 | string | 到达这个时间戳就执行 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /DealyMessage/Remove (POST) + + +删除提醒 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 提醒id | Yes | +| UserId | 5dfb03070a9ac17ac7a82054 | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Icon/Info (GET) + + +图标管理 - 返回图标基础信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 图标id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称:Picture图片地址:id图标id | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /Icon/Update (POST) + + +图标管理 - 增加或修改图标信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 图标id | Yes | +| ScenicId | 5e0d504e24e03431008b4567 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称:Picture图片地址:id图标id:ScenicId景区id | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /Icon/All (GET) + + +图标管理 - 所有图标 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称:Picture图片地址:id图标id:ScenicId景区id | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Investigation/Save (POST) + + +问券调查 - 增加调查 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| UserId | 1111111 | string | UserId | Yes | +| Mobile | 18616619599 | string | 联系电话 | Yes | +| type | 1 | string | 类型 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /Investigation/List (GET) + + +问券调查 - 查询所有问券调查 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Page | 1 | int | 当前第几页 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"total":1,"currpage":1,"totalpages":1,"prepage":20,"result":} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /ItemInfo (GET) + + +设备管理 - 查询设备信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 设备id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Tags所属标签,标签有分类;LimitHeight限高;PlayDuration游玩时长;SceneTime场次时间;Picture照片;Voice音频;AverageConsumption平均消费;Menu菜单, OpenHours开放时间: LocationDescription位置描述; Reminder温馨提示; State运行状态0=正常1=停运 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /LineInfo (GET) + + +查询线路信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;SubName副标题;PlayDuration游玩时长;Suitable适合人群;Location线路点坐标;Annotations需要点亮的设施id;Distance距离 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /LoginOperator (POST) + + +操作员管理 - 操作员登录 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Username | aaron | string | 用户名 | Yes | +| Password | 123 | string | 密码 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Id":"5e09c64c1c09c6f0f7ca2fa9","Token":"640bf934e425aba5d3c90998b2641f2f0ca07261d334d9615d1cd4790b5f34e7"}} 调用其它需要登陆的接口时携带token,有过期时间 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /LoginUser (POST) + + +用户管理 - 用户登录&注册 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Mobile | aaron | string | 手机号 | Yes | +| Code | 1 | string | 验证码(使用验证码的新手机号自动注册) | Yes | +| DeviceId | abc123 | string | 手机唯一识别码,不重复(存放于http.header中) | | +| Mac | abc123 | string | 网卡Mac地址(存放于http.header中) | | +| SystemType | ios | string | ios,android(存放于http.header中) | | +| SystemVersion | 13.01 | string | 手机版本(存放于http.header中) | | +| SystemModel | iphone8 | string | 手机型号(存放于http.header中) | | +| AppVersion | 1.0 | string | app版本号(存放于http.header中) | | +| DeviceToken | abc | string | 推送token(存放于http.header中) | | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Id":"5e09c64c1c09c6f0f7ca2fa9","Token":"640bf934e425aba5d3c90998b2641f2f0ca07261d334d9615d1cd4790b5f34e7"}} 调用其它需要登陆的接口时携带token,有过期时间 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /RegisterDevice (POST) + + +用户管理 - 注册客户端 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| DeviceId | abc123 | string | 手机唯一识别码,不重复(存放于http.header中) | | +| Mac | abc123 | string | 网卡Mac地址(存放于http.header中) | | +| SystemType | ios | string | ios,android(存放于http.header中) | | +| SystemVersion | 13.01 | string | 手机版本(存放于http.header中) | | +| SystemModel | iphone8 | string | 手机型号(存放于http.header中) | | +| AppVersion | 1.0 | string | app版本号(存放于http.header中) | | +| DeviceToken | abc | string | 推送token(存放于http.header中) | | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /RemoveUser (POST) + + +用户管理 - 删除用户(注销) + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | aaron | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /ScenicInfo (GET) + + +返回景区基础信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点) | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Sms/Send (POST) + + +发送短信验证码 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Mobile | 18616619599 | string | 手机号 | Yes | +| Location | {"Latitude": 119, "Longitude": 39} | string | 位置 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"}验证码1分钟内有效 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /SystemInfo (GET) + + +查询系统信息接口 + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Version=最新版本号UpdateLocationInterval上报位置时间间隔(秒) | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Tag/Create (POST) + + +标签 - 增加标签 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| TagName | 广场 | string | 标签名称 | Yes | +| TagGroup | location | string | 群组名称 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /Tag/Remove (POST) + + +标签 - 删除标签 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| TagName | 广场 | string | 标签名称 | Yes | +| TagGroup | location | string | 群组名称 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /TopMenus/All (GET) + + +菜单管理 - 查询所有菜单 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5e0d504e24e03431008b4567 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":[{"Id":"","ScenicId":"","Title":"玩水","Tags":["玩水"]},{"Id":"","ScenicId":"","Title":"设施","Tags":["服务设施","游玩项目"]}]} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + +#### /TopMenus/Update (POST) + + +菜单管理 - 更新菜单 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5e0d504e24e03431008b4567 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":[{"Id":"","ScenicId":"","Title":"玩水","Tags":["玩水"]},{"Id":"","ScenicId":"","Title":"设施","Tags":["服务设施","游玩项目"]}]} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Trajectory/Save (POST) + + +保存用户移动轨迹(5分钟提交一次) + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| UserId | 5dfb03070a9ac17ac7a82054 | string | 用户id | Yes | +| Location | {"Latitude": 119, "Longitude": 39} | string | 经纬度 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateCommodity (POST) + + +更新商品 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateItem (POST) + + +设备管理 - 更新设施 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 设备id | Yes | +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Tags所属标签,标签有分类;LimitHeight限高;PlayDuration游玩时长;SceneTime场次时间;Picture照片;Voice音频;AverageConsumption平均消费;Menu菜单, OpenHours开放时间: LocationDescription位置描述; Reminder温馨提示; State运行状态0=正常1=停运 | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateItemTime (POST) + + +设备管理 - 更新等待时间 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| item | [{"id":"5df864740a9ac17ac7a7feb8","time":"20"},{"id":"5df8660924e03417008b4567","time":"33"}] | string | 设备列表 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {errcode: 0, result: "ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateLine (POST) + + +更新线路 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 线路id | Yes | +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateOperator (POST) + + +操作员管理 - 修改用户信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | aaron | string | 用户id | Yes | +| ScenicId | 5e0d504e24e03431008b4567 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| Username | aarongao | string | 用户名 | Yes | +| Remarks | 18616619599 | string | 备注 | Yes | +| Password | 12345 | string | 密码 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateScenic (POST) + + +更新景区基础信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | Name名称;Describe介绍;OpenHours营业时间;Picture最上面图片;ShopAdPicture商城列表页图片;ItemScenicPicture项目场次照片;ActivityPicture活动照片;VideoList视频(VideoPicture=首桢图片);InvestigationUrl问券调查的url;RangeLocation景区范围(多个坐标点) | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UpdateUser (POST) + + +用户管理 - 修改用户信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | aaron | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | +| Birthday | 2010.10.10 | string | 生日 | Yes | +| FullName | aarongao | string | 全名 | Yes | +| Code | 12345678 | string | 6位验证码 | Yes | +| Mobile | 18616619599 | string | 手机,同用户名 | Yes | +| Sex | 男 | string | 性别 | Yes | +| Openid | 12345 | string | 微信id | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /Upload (POST) + + +上传 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| file | 1 | file | 文件 | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"图片地址"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UserInfo (GET) + + +用户管理 - 获取用户信息 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| id | aaron | string | 用户id | Yes | +| Token | wgergejfwe | string | 用户token | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":{"Id":"5e09c64c1c09c6f0f7ca2fa9","Token":"640bf934e425aba5d3c90998b2641f2f0ca07261d334d9615d1cd4790b5f34e7"}} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + + + + +#### /UserLog (POST) + + +增加用户行为日志 + +| Param Name | Example | Data Type | Description | Required? | +|-----|-----|-----|-----|-----| +| Type | 访问页面 | string | 安装;卸载;访问页面;使用功能;缩放地图;进入景区 | Yes | +| SubType | 景区详情 | string | 推荐;景区详情;登陆;商城;投诉建议;问券调查....(app中能点的都加上) | Yes | +| ScenicId | 5dfb03070a9ac17ac7a82054 | string | 景区id | Yes | +| UserId | 5dfb03070a9ac17ac7a82054 | string | 用户ID | Yes | +| UserName | Aaron | string | 用户名称 | Yes | +| Location | {"Latitude": 119, "Longitude": 39} | string | 位置 | Yes | +| Remarks | 备注 | string | 备注 | Yes | +| Source | 用户分享 | string | 来源 | Yes | +| DeviceId | abc123 | string | 手机唯一识别码,不重复(存放于http.header中) | Yes | +| Mac | abc123 | string | 网卡Mac地址(存放于http.header中) | Yes | +| SystemType | ios | string | ios,android(存放于http.header中) | Yes | +| SystemVersion | 13.01 | string | 手机版本(存放于http.header中) | Yes | +| SystemModel | iphone8 | string | 手机型号(存放于http.header中) | Yes | +| AppVersion | 1.0 | string | app版本号(存放于http.header中) | Yes | +| DeviceToken | abc | string | 推送token(存放于http.header中) | Yes | + + +| Code | Type | Model | Message | +|-----|-----|-----|-----| +| 200 | object | [ResponseSeccess](#github.com.aarongao.tools.ResponseSeccess) | {"errcode":0,"result":"ok"} | +| 500 | object | [ResponseError](#github.com.aarongao.tools.ResponseError) | {"errcode":1,"errmsg":"错误原因"} | + + diff --git a/main.go b/main.go index 340d827..3470bdf 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "flag" "github.com/aarongao/tools" "github.com/davecgh/go-spew/spew" "github.com/gin-gonic/gin" @@ -34,6 +35,12 @@ func main() { err := decoder.Decode(&Config.Info) tools.CheckError(err) + // 启动参数中的端口号 + var runPort string + flag.StringVar(&runPort, "port", "", "端口号,默认为8080") + flag.Parse() + + // 连接数据库 // Set client options clientOptions := options.Client() @@ -196,7 +203,12 @@ func main() { spew.Dump(err) } - Gin.Run(Config.Info.ServerPort) + // 默认情况使用配置文件中的端口号,除非在启动命令中指定-port :808x + _port := Config.Info.ServerPort + if runPort != ""{ + _port = runPort + } + Gin.Run(_port) } func InitController(method string, uri string, handFunc func(c *gin.Context), auth *DB.SModel) { -- libgit2 0.21.0