All Projects → anightrabbit → lottery-api

anightrabbit / lottery-api

Licence: other
抽奖api,适用于各种h5营销抽奖活动

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to lottery-api

time-api
Nodejs API for Wobbly Time Tracker for the Teams
Stars: ✭ 24 (+33.33%)
Mutual labels:  nodejs-api
growth
Simples exemplo de CRUD para armazenar em memoria os dados vindo do JSON.
Stars: ✭ 40 (+122.22%)
Mutual labels:  nodejs-api
dhiwise-nodejs
DhiWise Node.js API generator allows you to instantly generate secure REST APIs. Just supply your database schema to DhiWise, and a fully documented CRUD APIs will be ready for consumption in a few simple clicks. The generated code is clean, scalable, and customizable.
Stars: ✭ 224 (+1144.44%)
Mutual labels:  nodejs-api
framework
Envuso is a backend framework focusing building apis using Fastify and MongoDB support.
Stars: ✭ 12 (-33.33%)
Mutual labels:  nodejs-api
nodetomic-api
RESTful API Nodejs designed for horizontal scalability with support for cluster, based on Express, MongoDB, Redis, JWT, Socket.io, Passport.
Stars: ✭ 41 (+127.78%)
Mutual labels:  nodejs-api
AmigoChat-Realtime-Chat-Application
AmigoChat is a responsive real-time chat application built on MERN Stack and Socket io.
Stars: ✭ 22 (+22.22%)
Mutual labels:  nodejs-api
tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 2,350 (+12955.56%)
Mutual labels:  nodejs-api
core
MongoDB and TypeScript MEAN Stack Framework for NodeJS
Stars: ✭ 36 (+100%)
Mutual labels:  nodejs-api
node-rest-api-starter
This repository is a template to avoid rewriting all the basic authentication code for REST API's built with Express.js, MongoDB.
Stars: ✭ 30 (+66.67%)
Mutual labels:  nodejs-api
MyAPI
A template to create awesome APIs easily ⚡️
Stars: ✭ 117 (+550%)
Mutual labels:  nodejs-api
Tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+10683.33%)
Mutual labels:  nodejs-api

h5营销抽奖活动API

功能实现

config目录,API配置信息

  • prizeData.js文件配置奖池信息,各种需求限制自由配置,开启中间件,自由搭配。
  • mongodb配置本地开发环境 “mongodb://test:[email protected]:27017:/demo”
  • updatedb.js帮助导入奖池数据和抽奖活动数据

models目录,MonogoDB数据模型

  • prizeActivity.model.js记录抽奖活动信息
  • prizeContact.model.js记录大奖用户领取联系信息
  • prizePool.model.js记录奖池信息
  • prizeRecord.model.js记录抽奖记录

middlewares目录,中间件

  • checkMemberAuth.js检查用户抽奖权限,非登陆会员不可参与抽奖
  • checkActivityDate.js检查活动有效期
  • checkActivityLimit.js检查活动参与次数限制
  • checkFreeCode.js 检查渠道免费抽奖码
  • checkMemberDrawRecord.js检查会员抽奖记录,限制抽奖次数
  • checkMemberLuckyRecord.js检查会员中奖记录
  • checkMemberRestPoint.js检查会员剩余积分是否足够参与一次抽奖
  • drawPrize.js 生成随机数对应奖池的奖品编号,确定是否中奖
  • updateMemberDrawRecord.js 更新会员抽奖记录

public目录

用react写了一个九宫格类型的抽奖demo,备注[目录下有隐藏福利]

抽奖请求示例

请求参数:

参数 类型 可选 备注
memberId number 会员Id
activity string 活动名称
code string 渠道
{
    "memberId": 15,
    "activity":"fuck3yue",
    "code":"hello"
}

返回参数:

{
    "data": {
        "prizeLevel": 8,
        "checkStatus": false,
        "_id": "5e71caf9a1b3fc3522f23ad0",
        "prizeType": "point",
        "prizeText": "奖励300积分",
        "prizeNo": 3613,
        "__v": 0,
        "created_at": "2020-03-18T07:17:13.827Z",
        "updated_at": "2020-03-18T07:17:13.827Z"
    },
    "msg": "🎉🎉🎉,中奖了呢"
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].