init
This commit is contained in:
103
doc/api.api
Normal file
103
doc/api.api
Normal file
@ -0,0 +1,103 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "type title here"
|
||||
desc: "type desc here"
|
||||
author: "DevTTL"
|
||||
email: "admin@devttl.com"
|
||||
version: "v0.1"
|
||||
)
|
||||
|
||||
type Order172 {
|
||||
OrderNo string `json:"OrderNo"` // Y 合作方订单号
|
||||
OrderNo172 string `json:"OrderNo172"` // Y 172平台订单号,请求头sign里加密的是这个号码。
|
||||
OrderStatus string `json:"OrderStatus"` // Y 订单状态:已发货,已完成,审核不通过,已取消,已撤单
|
||||
ThirdPhone string `json:"ThirdPhone"` // N 办理号码
|
||||
ExpressName string `json:"ExpressName"` // N 物流公司
|
||||
ExpressCode string `json:"ExpressCode"` // N 物流单号
|
||||
CardStatus string `json:"CardStatus"` // N 激活状态:已激活,未激活,可能为Null
|
||||
ActiveTime string `json:"ActiveTime"` // N 激活时间格式yyyy-MM-dd HH:mm:ss,可能为Null
|
||||
Remark string `json:"Remark"` // N 备注失败原因
|
||||
}
|
||||
|
||||
type PushReq {
|
||||
RequidId string `json:"RequidId"` // Y 推送请求唯一ID
|
||||
Data Order172 `json:"Data"` // Y 返回订单信息
|
||||
}
|
||||
|
||||
type Push172Resp {
|
||||
Code int64 `json:"code",options=-1|0` // Y 响应码 -1错误 0正常
|
||||
Msg string `json:"message"` // Y 错误信息
|
||||
}
|
||||
|
||||
type GoodsItem {
|
||||
Id int64 `json:"id"` // Y 商品ID
|
||||
Name string `json:"name"` // Y 商品信息
|
||||
MainPic string `json:"mainPic"` // Y 主图
|
||||
DisableAge string `json:"disableAge"` // Y 年龄限制
|
||||
UniFlow string `json:"uniFlow"` // Y 通用流量
|
||||
DirFlow string `json:"dirFlow"` // Y 定向流量
|
||||
TalkTime string `json:"talkTime"` // Y 通话时长
|
||||
Remarks string `json:"remarks"` // Y 备注
|
||||
}
|
||||
|
||||
type (
|
||||
GoodsListReq {
|
||||
Type string `json:"type":"type,default=0"` // Y 运营商 0:全部 1:电信 2:联通 3:移动 4:光电
|
||||
}
|
||||
GoodsListResp {
|
||||
Data []GoodsItem `json:"data"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
GoodsDetailsReq {
|
||||
Id int64 `path:"id"`
|
||||
}
|
||||
GoodsDetailsResp {
|
||||
Data GoodsItem `json:"data"` // Y 商品详情
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TiktokReq {
|
||||
VideoUrl string `from:"videoUrl"` // 视频地址
|
||||
}
|
||||
TiktokResp {
|
||||
AuthorID string `json:"authorId"` // 作者ID
|
||||
AuthorUniqueID string `json:"authorUniqueId"` // 作者账号
|
||||
AuthorAvatar string `json:"authorAvatar"` // 作者头像
|
||||
AuthorNickname string `json:"authorNickname"` // 作者昵称
|
||||
VideoID string `json:"videoId"` // 视频ID
|
||||
VideoTitle string `json:"videoTitle"` // 作品描述
|
||||
OriginCover string `json:"originCover"` // 静态封面
|
||||
DynamicCover string `json:"dynamicCover"` // 动态封面
|
||||
DestinationURL string `json:"destinationUrl"` // 无水印下载地址
|
||||
WatermarkVideoURL string `json:"watermarkVideoUrl"` // 有水印下载地址
|
||||
MusicURL string `json:"musicUrl"` // 背景音乐链接
|
||||
OriginalURL string `json:"originalUrl"` // 原始下载链接
|
||||
DownloaderURL string `json:"downloaderUrl"` // 解析后下载地址
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
Result bool `json:"result"` // 结果
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
group: api
|
||||
prefix: api
|
||||
middleware: RealIPMiddleware
|
||||
)
|
||||
service api {
|
||||
@handler tiktokInfo
|
||||
post /tiktok/getVideoInfo (TiktokReq) returns (TiktokResp)
|
||||
|
||||
@handler order172
|
||||
post /push/order172 (PushReq) returns (Push172Resp)
|
||||
|
||||
@handler goodsList
|
||||
get /goods/list (GoodsListReq) returns (GoodsListResp)
|
||||
|
||||
@handler goodsDetails
|
||||
get /goods/:id (GoodsDetailsReq) returns (GoodsDetailsResp)
|
||||
}
|
||||
|
8
doc/sql/config_api.sql
Normal file
8
doc/sql/config_api.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE `config_api`
|
||||
(
|
||||
`id` bigint auto_increment NOT NULL COMMENT '主键ID',
|
||||
`type` varchar(255) NOT NULL COMMENT '接口类型 0:172',
|
||||
`key` varchar(20) DEFAULT NULL COMMENT 'key',
|
||||
`secret` varchar(100) DEFAULT NULL COMMENT '密钥',
|
||||
primary key (id)
|
||||
) COMMENT ='API配置表';
|
28
doc/sql/goods_info.sql
Normal file
28
doc/sql/goods_info.sql
Normal file
@ -0,0 +1,28 @@
|
||||
CREATE TABLE `goods_info`
|
||||
(
|
||||
`id` bigint NOT NULL auto_increment COMMENT '主键ID',
|
||||
`type` char(1) NOT NULL default '0' COMMENT '运营商 0:未标注 1:电信 2:联通 3:移动 4:光电',
|
||||
`name` varchar(255) NOT NULL COMMENT '商品名',
|
||||
`main_pic` varchar(1000) NOT NULL COMMENT '主图',
|
||||
`little_picture` varchar(1000) DEFAULT '' COMMENT '详情图',
|
||||
`netAddr` VARCHAR(255) DEFAULT '' COMMENT '商品套餐资料介绍地址',
|
||||
`area` VARCHAR(10) DEFAULT '' COMMENT '归属地',
|
||||
|
||||
`uni_flow` VARCHAR(10) DEFAULT '' COMMENT '通用流量',
|
||||
`dir_flow` VARCHAR(10) DEFAULT '' COMMENT '定向流量',
|
||||
`talk_time` VARCHAR(10) DEFAULT '' COMMENT '通话时间',
|
||||
|
||||
`disable_area` VARCHAR(1000) DEFAULT '' COMMENT '禁发地区',
|
||||
`disable_age` VARCHAR(100) DEFAULT '' COMMENT '年龄限制',
|
||||
`disable_contract` VARCHAR(10) DEFAULT '' COMMENT '合约期',
|
||||
`notes` text COMMENT '商品说明',
|
||||
|
||||
`api_id` bigint DEFAULT NULL COMMENT '三方接口',
|
||||
`api_product_id` bigint DEFAULT NULL COMMENT '三方商品id',
|
||||
`number_sel` char(1) NOT NULL DEFAULT '0' COMMENT '是否选号 0:不支持 1:收货地不是归属地 2:收货地是归属地',
|
||||
`status` char(1) NOT NULL DEFAULT '0' COMMENT '状态 0:上架 1:下架',
|
||||
`create_time` datetime NOT NULL default current_timestamp() comment '创建时间',
|
||||
`update_time` datetime NOT NULL default current_timestamp() on update current_timestamp() comment '更新时间',
|
||||
`remarks` VARCHAR(255) DEFAULT NULL COMMENT '备注',
|
||||
primary key (id)
|
||||
) COMMENT '商品列表 ';
|
8
doc/sql/goods_status.sql
Normal file
8
doc/sql/goods_status.sql
Normal file
@ -0,0 +1,8 @@
|
||||
CREATE TABLE `goods_status`
|
||||
(
|
||||
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
|
||||
`api_id` int(255) DEFAULT NULL COMMENT '三方接口',
|
||||
`api_product_id` int(255) DEFAULT NULL COMMENT '三方商品id',
|
||||
`status` int(10) DEFAULT NULL COMMENT '商品状态 0=上架 1=下架',
|
||||
primary key (id)
|
||||
) COMMENT '商品状态';
|
22
doc/sql/oder_info.sql
Normal file
22
doc/sql/oder_info.sql
Normal file
@ -0,0 +1,22 @@
|
||||
CREATE TABLE `oder_info`
|
||||
(
|
||||
`id` bigint NOT NULL COMMENT '订单id',
|
||||
`oder_id` varchar(50) NOT NULL COMMENT '订单id',
|
||||
`goods_id` varchar(50) NOT NULL COMMENT '下单产品ID',
|
||||
`name` varchar(30) NOT NULL COMMENT '姓名',
|
||||
`id_card` varchar(18) NOT NULL COMMENT '身份证号',
|
||||
`phone` varchar(15) NOT NULL COMMENT '手机号码',
|
||||
`province` varchar(20) NOT NULL COMMENT '省',
|
||||
`city` varchar(20) NOT NULL COMMENT '城市',
|
||||
`area` varchar(20) NOT NULL COMMENT '区/县/镇',
|
||||
`address` varchar(100) NOT NULL COMMENT '详细地址',
|
||||
`status` char(1) NOT NULL DEFAULT '0' COMMENT '发货处理状态:0=未处理,1=已下单 2=已发货 3已完成 4失败',
|
||||
`api_id` varchar(255) DEFAULT NULL COMMENT '接口来源',
|
||||
`api_oder_id` varchar(255) DEFAULT NULL COMMENT '第三方订单',
|
||||
`third_phone` varchar(255) DEFAULT NULL COMMENT '用户办理的号码',
|
||||
`card_status` char(1) DEFAULT '0' COMMENT '号码状态',
|
||||
`create_time` datetime NOT NULL default current_timestamp() comment '创建时间',
|
||||
`update_time` datetime NOT NULL default current_timestamp() on update current_timestamp() comment '更新时间',
|
||||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
|
||||
primary key (id)
|
||||
) COMMENT '订单列表';
|
Reference in New Issue
Block a user