后端部分,详见go-zero,配好环境之后go run park.go -f etc/park-api.yaml
目前数据库的数据是在生成网站rand的,需要的话可以改,调用api的前缀也因为服务器的域名需要备案只能通过ip的形式访问,后面可能会用nginx反代到域名
前端部分,详见web/README.md
示例,感觉依赖很多,没用的页面也很多,打算删一下,不过还是先摸吧^_)
prefix: http://116.205.130.21:8899
- route definition
- Url: /api/access
- Method: GET
- Request:
- - Response:
accessResp
-
request definition
-
response definition
type AccessResp struct {
Id int64 `json:"id"`
Location string `json:"location"` // 接入地点
Date string `json:"date"` // 接入日期
Num int64 `json:"num"` // 接入数量
}- route definition
- Url: /api/income
- Method: GET
- Request:
- - Response:
incomeResp
-
request definition
-
response definition
type IncomeResp struct {
Id int64 `json:"id"`
Type string `json:"type"` // 收入类型
Date string `json:"date"` // 日期
Num int64 `json:"num"` // 当天收入
}- route definition
- Url: /api/parkingLot
- Method: GET
- Request:
- - Response:
parkingLotResp
-
request definition
-
response definition
type ParkingLotResp struct {
Id int64 `json:"id"`
Name string `json:"name"` // 停车场名字
Duration int64 `json:"duration"` // 停车时间(小时)
Num int64 `json:"num"` // 泊车数
}- route definition
- Url: /api/siteInfo
- Method: GET
- Request:
- - Response:
siteInfoResp
-
request definition
-
response definition
type SiteInfoResp struct {
Id int64 `json:"id"`
Date string `json:"date"` // 日期
RevisitRate int64 `json:"revisit_rate"` // 重复访问率(%)
SiteHealth int64 `json:"site_health"` // 站点健康度
RfHealth int64 `json:"rf_health"` // 射频健康度
DeviceHealth int64 `json:"device_health"` // 设备健康度
Flow int64 `json:"flow"` // 当日站点流量
}- route definition
- Url: /api/touristFlow
- Method: GET
- Request:
- - Response:
touristFlowResp
-
request definition
-
response definition
type TouristFlowResp struct {
Id int64 `json:"id"`
Location string `json:"location"` // 园区地点
Date string `json:"date"` // 时间
Num int64 `json:"num"` // 游客数量
}- route definition
- Url: /api/touristCarProvince
- Method: GET
- Request:
- - Response:
touristCarProvinceResp
-
request definition
-
response definition
type TouristCarProvinceResp struct {
Id int64 `json:"id"`
Province string `json:"province"` // 省份
Date string `json:"date"` // 日期
FlowNum int64 `json:"flow_num"` // 人流数量
CarNum int64 `json:"car_num"` // 车辆数
}- route definition
- Url: /api/user
- Method: POST
- Request:
userReq - Response:
userResp
- request definition
type UserReq struct {
Id int64 `json:"id"` // 用户id
}- response definition
type UserResp struct {
Id int64 `json:"id"` // 用户id
Username string `json:"username"` // 用户名
}- route definition
- Url: /api/wechat
- Method: GET
- Request:
- - Response:
wechatResp
-
request definition
-
response definition
type WechatResp struct {
Date string `json:"date"` // 日期
Num int64 `json:"num"` // 微信关注数量
}- route definition
- Url: /api/deviceInfo
- Method: GET
- Request:
- - Response:
deviceInfoResp
-
request definition
-
response definition
type DeviceInfoResp struct {
Id int64 `json:"id"`
UplinkRate float64 `json:"uplink_rate"` // 上行速率
DownlinkRate float64 `json:"downlink_rate"` // 下载速率
Flow float64 `json:"flow"` // 流量
CpuRate float64 `json:"cpu_rate"` // CPU占有率
Longitude float64 `json:"longitude"` // 经度
Latitude float64 `json:"latitude"` // 纬度
}