2023最新版本开运网运势测算网站数据node.js版接口数据H5网站算命接口api

3 篇文章 0 订阅
2 篇文章 0 订阅

算命api-H5网站算命接口-App算命接口-小程序算命接口
接口数据api
接口平台:http://apidoc.sanqizhouyi.com
支持格式:JSON
请求方式:HTTP GET/POST
数据库mysql
FfsmOrders.init(
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
oid: Sequelize.STRING,
paytype: Sequelize.INTEGER,
data: Sequelize.STRING,
money: {
type: Sequelize.STRING,
defaultValue: ‘19.9’,
},
createtime: {
type: Sequelize.BIGINT(13),
defaultValue: Date.now(),
},
status: {
type: Sequelize.INTEGER,
defaultValue: 0,
},
dl_status: {
type: Sequelize.INTEGER,
defaultValue: 0,
},
ip: Sequelize.STRING,
des: Sequelize.STRING,
type: Sequelize.INTEGER, // 1=八字精批,2=合婚,3=姓名分析,4=姓名配对,5=紫薇排盘
qfshow: {
type: Sequelize.INTEGER,
defaultValue: 0,
},
lantern_id: {
type: Sequelize.INTEGER,
defaultValue: 0,
},
dl_money: {
type: Sequelize.STRING,
defaultValue: ‘0’,
},
},
{
sequelize,
tableName: ‘ffsm_orders’,
}
)

// 根据id获取订单
router.get('/getOrderByid', async ctx => {
  checkParams(ctx, ['oid'])

  const { oid } = ctx.request.query
  const res = await FfsmOrders.getOrderByid(oid)
  ctx.body = {
    data: res,
    status: 200,
    msg: '',
  }
})

/**
 * 生成八字订单
 * 八字精批: type:8
 * 八字姻缘: type:16
 * 姻缘测算: type:7
 * 紫薇命盘: type:5
 */
router.post('/createBzOrder', async ctx => {
  checkParams(ctx, ['pay_uid', 'username', 'gender', 'date', 'hour', 'type'])
  const { body } = ctx.request
  const { username, gender, date, hour } = body
  if (!isDate(date)) {
    throw new BadParamError('date:格式不正确')
  }
  const data = JSON.stringify({
    username,
    gender,
    ...getOrderData(date, hour),
  })
  body.data = data
  const res = await FfsmOrders.createOrder(body)
  ctx.body = {
    data: null,
    status: 200,
    msg: '订单创建成功',
  }
})

// 订单详情
router.get('/getOrderDetail', async ctx => {
  checkParams(ctx, ['oid'])

  const { oid } = ctx.request.query
  const { type } = await FfsmOrders.getOrderByid(oid)
  let res = {}
  switch (type.toString()) {
    case '2':
      res = await FfsmOrders.bazihh(oid)
      break
    case '4':
      res = await FfsmOrders.xmpd(oid)
      break
    case '5':
      res = await FfsmOrders.zwmp(oid)
      break
    case '7':
      res = await FfsmOrders.baziyy(oid)
      break
    case '8':
      res = await FfsmOrders.bazijp(oid)
      break
    case '16':
      res = await FfsmOrders.baziyy(oid)
      break
    case '18':
      res = await FfsmOrders.hmjx(oid)
      break
    case '24':
      res = await FfsmOrders.gsqm(oid)
      break
    case '37':
      res = await FfsmOrders.xzys(oid)
      break
  }
  ctx.body = {
    data: res,
    status: 200,
    msg: '',
  }
})

请求示例:
在这里插入图片描述

接口实现:

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

雨顺518

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值