小编的第二个全栈项目,这里先做项目总结分析,接下来会继续推出其中的源码设计和功能分析博客,大家多多支持呀!
项目源码地址:
https://gitee.com/lwkgood/time-client (客户端)
https://gitee.com/lwkgood/time-serve-admin (服务端)
https://gitee.com/lwkgood/time-vue-admin (后台前端PC)
项目视频地址:
https://www.bilibili.com/video/BV1Ui4y1G78J (功能演示视频)
https://www.bilibili.com/video/BV1NK411H7hx (宣传视频)
惜时APP是一款时间管理类的手机APP,是一款简洁不收费的管理待办事项工具。为专注工作和学习而设计,主要针对的是事务繁忙或者工作效率低的人士,如学生,上班族等,是拯救遗忘症和拖延症的神器。它能协助用户管理待办任务,规划日程,提醒重要时间节点……通过“每件事都需要去完成”这样的简单仪式,帮助用户形成良好的时间管理习惯。
1.需求分析
用户需求:
市场需求:
营销策略:
主要是渠道推广,线上推广与线下推广结合。
线上推广:
线下推广:
APP自身推广:
盈利模式:
1.广告位出售:收取其他平台植入广告费用。
2.自营商品利润:销售商品后,赚取商品进货价与销售价之间的利润差价。
3.第三方商家费用:第三方入驻后,可以收取相对应的入驻费、商品推荐广告费,交易佣金等。
Routes接口目录:Api接口–Restful风格 GET/POST/PUT/DELETE
核心代码演示:
// app/router.js 用于配置 URL 路由规则
/**
* router中使用中间件:针对单个路由生效
*/
'use strict';
/**
* @param {Egg.Application} app - egg application
*/
module.exports = app => {
const { router, controller } = app;
router.get('/', controller.home.index);
//jwt中间件
// const jwt = app.passport.authenticate("jwt",{
// session:false,
// successReturnToOrRedirect:null
// })
const jwt = app.middleware.checkToken(app.config.jwt);
/**
* 后台管理系统接口
*/
//用户登录
router.post("/api/admin/login", controller.admin.users.login);
//用户退出
router.post("/api/admin/logout", controller.admin.users.logout);
/*
* 这里的第二个对象不再是控制器,而是 jwt 验证对象,第三个地方才是控制器
* 只有在需要验证 token 的路由才需要第二个 是 jwt 否则第二个对象为控制器
**/
//获取用户信息
router.get("/api/admin/users/userInfo", jwt, controller.admin.users.userInfo);
//登录时获取用户权限
router.get("/api/admin/users/permission", jwt, controller.admin.users.getPermission);
//映射controller/admin/users.js
router.resources("users", "/api/admin/users", jwt, controller.admin.users);
//映射controller/admin/roles.js
router.resources("roles", "/api/admin/roles", jwt, controller.admin.roles);
//映射
router.resources("permissions", "/api/admin/permissions", jwt, controller.admin.permissions);
//编辑用户角色
router.post("/api/admin/users/roles/:id", jwt, controller.admin.users.editUserRoles);
//批量添加用户
router.post("/api/admin/users/batch", jwt, controller.admin.users.batch);
//角色拥有哪些权限
router.get("/api/admin/roles/permissions/:id", jwt, controller.admin.roles.rolesHasPermission);
//为角色添加权限
router.put('/api/admin/roles/permissions/:id', jwt, controller.admin.roles.addRolePermissions);
/**以下接口属于客户端 */
//用户登录
router.post('/api/client/users/login',controller.client.users.login);
//获取用户信息
router.get('/api/client/users/userinfo', jwt, controller.client.users.userinfo);
//修改密码
router.put('/api/client/users/updatePassword/:id', jwt, controller.client.users.updatePassword);
//重置密码
router.post('/api/client/users/resetPassword/:id', controller.client.users.resetPassword);
//注册用户
router.post('/api/client/users/register', controller.client.users.register);
//编辑用户信息
router.put('/api/client/users/updateUserInfo/:id', jwt, controller.client.users.updateUserInfo);
//获取公告
router.get('/api/client/users/getAnnounce', jwt, controller.client.users.getAnnounce);
//新增今日待办
router.post('/api/client/matters/createMatter/:id', jwt, controller.client.matters.createMatter);
//获取待办事情By userId
router.get('/api/client/matters/getMatter', jwt, controller.client.matters.getMatter);
//获取待办事情ByDesc
router.get('/api/client/matters/getMatterDesc', jwt, controller.client.matters.getMatterDesc);
//编辑待办事情
router.put('/api/client/matters/updateMatter/:id', jwt, controller.client.matters.updateMatter);
//新增心得体会
router.post('/api/client/matters/createExperience/:id', jwt, controller.client.matters.createExperience);
//延期待办事情By matterId
router.put('/api/client/matters/delayTodayMatter/:id', jwt, controller.client.matters.delayTodayMatter);
//删除今日待办
router.delete('/api/client/matters/deleteMatter/:id', jwt, controller.client.matters.deleteMatter);
//新增意见反馈
router.post('/api/client/feedbacks/createFeedback/:id', jwt, controller.client.feedbacks.createFeedback);
//根据日期获取当前待办
router.get('/api/client/matters/getOneMatterByDate', jwt, controller.client.matters.getOneMatterByDate);
//获取打卡天数
router.get('/api/client/clocks/getClock', jwt, controller.client.clocks.getClock);
//新增打卡天数
router.post('/api/client/clocks/createClock/:id', jwt, controller.client.clocks.createClock);
//新增动态
router.post('/api/client/dynamics/createDynamic/:id', jwt, controller.client.dynamics.createDynamic);
//更新打卡天数
router.put('/api/client/clocks/updateClock/:id', jwt, controller.client.clocks.updateClock);
//获取所有动态
router.get('/api/client/dynamics/getDynamics', jwt, controller.client.dynamics.getDynamics);
//删除动态
router.delete('/api/client/dynamics/deleteDynamic/:id', jwt, controller.client.dynamics.deleteDynamic);
//点赞动态
router.post('/api/client/dynamics/likeDynamic/:id', jwt, controller.client.dynamics.likeDynamic);
//取消点赞
router.delete('/api/client/dynamics/notLikeDynamic/:dynamicId/:userId', jwt, controller.client.dynamics.notLikeDynamic);
//位置更改
router.get('/api/client/locations/getLocation', jwt, controller.client.locations.getLocation);
//新增地址
router.post('/api/client/addresss/createAddress/:id', jwt, controller.client.addresss.createAddress);
//获取当前用户所有地址
router.get('/api/client/addresss/getAddress', jwt, controller.client.addresss.getAddress);
//编辑当前地址
router.put('/api/client/addresss/updateAddress/:id/:userId', jwt, controller.client.addresss.updateAddress);
//删除当前地址
router.delete('/api/client/addresss/deleteAddress/:addressId', jwt, controller.client.addresss.deleteAddress);
//获取所有优惠券
router.get('/api/client/coupons/getCoupons', jwt, controller.client.coupons.getCoupons);
//兑换优惠券
router.post('/api/client/coupons/exchangeCoupon/:couponId/:userId', jwt, controller.client.coupons.exchangeCoupon);
//获取我的优惠券
router.get('/api/client/coupons/getMyCoupons', jwt, controller.client.coupons.getMyCoupons);
//获取所有商品
router.get('/api/client/goods/getGoods', jwt, controller.client.goods.getGoods);
//获取所有商品分类
router.get('/api/client/goods/getCateGoods', jwt, controller.client.goods.getCateGoods);
//收藏商品
router.post('/api/client/goods/collectGoods/:userId/:goodId', jwt, controller.client.goods.collectGoods);
//取消收藏商品
router.post('/api/client/goods/cancelCollectGoods/:userId/:goodId', jwt, controller.client.goods.cancelCollectGoods);
//获取用户收藏的商品
router.get('/api/client/goods/getCollectGoods', jwt, controller.client.goods.getCollectGoods);
//新增订单
router.post('/api/client/orders/createOrders/:id', jwt, controller.client.orders.createOrders);
//获取所有订单
router.get('/api/client/orders/getOrders', jwt, controller.client.orders.getOrders);
};