-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.js
171 lines (146 loc) · 7.27 KB
/
router.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
const router = require('koa-router')();
// 引入 controller
const AccountController = require('./controller/account')
const OrdersController = require('./controller/orders')
const SettingController = require('./controller/setting')
const GoodsController = require('./controller/goods')
const DictionaryController = require('./controller/dictionary')
const MemberController = require('./controller/member')
const StorageController = require('./controller/storage')
module.exports = (app) => {
// 中间件测试返回JSON数据
router.get('/api', AccountController.responseJson)
.get('/home', AccountController.home)
/*-------------账户管理开始-----------*/
// 首页重定向到登录页面
.get('/', AccountController.signin)
// 跳转到登录页面
.get('/signin', AccountController.signin)
// 跳转到注册页
.get('/signup', AccountController.signup)
// 退出账号
.get('/signout', AccountController.signout)
// 登录
.post('/login', AccountController.login)
// 注册用户
.post('/register', AccountController.register)
/*-------------账户管理结束-----------*/
/*-------------订单管理开始-----------*/
// 跳转到订单——新订单
.get('/orders/new', OrdersController.orderNew)
// 跳转到订单——配送中
.get('/orders/sending', OrdersController.orderSending)
// 跳转到订单——已完成
.get('/orders/end', OrdersController.orderEnd)
/*-------------订单管理结束-----------*/
/*-------------商品管理开始-----------*/
// 跳转到商品上下架
.get('/goods/shelf', GoodsController.goodsShelf)
/*-------------商品管理结束-----------*/
/*-------------会员管理开始-----------*/
// 跳转到会员列表
.get('/member/lists', MemberController.memberLists)
// 跳转到会员地址
.get('/member/address', MemberController.address)
// 获取全部会员列表
.get('/member/findAllMembers', MemberController.findAllMembers)
// 通过条件查询会员列表
.post('/member/findMembersByParams', MemberController.findMembersByParams)
// 获取全部地址
.get('/member/findAllAddress', MemberController.findAllAddress)
// 通过条件查询地址列表
.post('/member/findAddressByParams', MemberController.findAddressByParams)
/*-------------会员管理结束-----------*/
/*-------------仓储管理开始-----------*/
// 跳转到 仓储管理——仓库管理
.get('/storage/warehouse', StorageController.warehouse)
// 跳转到 仓储管理——采购入库
.get('/storage/purchase', StorageController.purchase)
// 跳转到 仓储管理——销售出库
.get('/storage/sale', StorageController.sale)
// 跳转到 仓储管理——销售退货
.get('/storage/return', StorageController.return)
// 跳转到 仓储管理——库存盘点
.get('/storage/check', StorageController.check)
// 跳转到 仓储管理——库存清单
.get('/storage/lists', StorageController.lists)
/*-------------仓储管理结束-----------*/
/*-------------基础资料开始-----------*/
// 跳转到分类字典
.get('/dictionary/category', DictionaryController.category)
// 跳转到商品字典
.get('/dictionary/goods', DictionaryController.goods)
// 跳转到创建商品——基本信息页
.get('/dictionary/goods/base', DictionaryController.goodsBase)
// 跳转到创建商品——轮播图
.get('/dictionary/goods/slideshow', DictionaryController.goodsSlideshow)
// 跳转到创建商品——图文介绍
.get('/dictionary/goods/info', DictionaryController.goodsInfo)
// 跳转到创建商品——规格参数
.get('/dictionary/goods/specification', DictionaryController.goodsSpecification)
// 跳转到客户列表
.get('/dictionary/customer', DictionaryController.customer)
// 增加字典列表
.post('/dictionary/addDictionary', DictionaryController.addDictionary)
// 通过字典 id 删除记录
.post('/dictionary/deleteDictionaryById', DictionaryController.deleteDictionaryById)
// 通过批量字典 id 删除多条记录
.post('/dictionary/deleteDictionaryByIds', DictionaryController.deleteDictionaryByIds)
// 通过 id 修改对应字典记录
.post('/dictionary/updateDictionaryById', DictionaryController.updateDictionaryById)
// 查询全部字典记录
.get('/dictionary/findAllParentLists', DictionaryController.findAllParentLists)
// 通过字典编码查询 字典
.get('/dictionary/findParentDicByCode', DictionaryController.findParentDicByCode)
// 根据字典 id 查询字段列表
.post('/dictionary/findFieldsById', DictionaryController.findFieldsById)
// 增加字段列表
.post('/dictionary/addField', DictionaryController.addField)
// 通过 id 修改对应字段记录
.post('/dictionary/updateFieldById', DictionaryController.updateFieldById)
// 增加客户资料
.post('/dictionary/addCustomer', DictionaryController.addCustomer)
// 通过客户 id 删除记录
.post('/dictionary/deleteCustomerById', DictionaryController.deleteCustomerById)
// 通过 id 修改对应客户记录
.post('/dictionary/updateCustomerById', DictionaryController.updateCustomerById)
// 查询全部客户列表
.get('/dictionary/findAllCustomers', DictionaryController.findAllCustomers)
// 添加商品字典记录
.post('/dictionary/addGoods', DictionaryController.addGoods)
// 通过id删除商品字典记录
.post('/dictionary/deleteGoodsById', DictionaryController.deleteGoodsById)
// 通过 id 更新商品字典记录信息
.post('/dictionary/updateGoodsById', DictionaryController.updateGoodsById)
// 查询商品字典列表
.post('/dictionary/findGoodsLists', DictionaryController.findGoodsLists)
// 查询商品字典最后一条记录Id
.get('/dictionary/findLastGoodsId', DictionaryController.findLastGoodsId)
// 通过id查询商品字典记录
.get('/dictionary/findGoodsById', DictionaryController.findGoodsById)
// 增加商品字典对应的规格参数信息
.post('/dictionary/addGoodsSpecification', DictionaryController.addGoodsSpecification)
/*-------------基础资料结束-----------*/
/*-------------账户设置开始-----------*/
// 跳转到 修改密码页
.get('/setting/changepwd', SettingController.changepwd)
// 跳转到 修改个人资料页
.get('/setting/changeinfo', SettingController.changeinfo)
// 跳转到 切换账号页
.get('/setting/changeaccount', SettingController.changeaccount)
// 获取个人资料
.get('/setting/findUserInfoByUID', AccountController.findUserInfoByUID)
// 更新密码
.post('/setting/updatePwd', SettingController.updatePwd)
// 更新个人资料
.post('/setting/updateUserInfo', SettingController.updateUserInfo)
// 获取关联账号列表
.post('/setting/findLinkAccountByMainId', SettingController.findLinkAccountByMainId)
// 关联账号免密登录
.post('/setting/linkAccountLogin', SettingController.linkAccountLogin)
// 删除关联账号
.post('/setting/deleteLinkAccount', SettingController.deleteLinkAccount)
/*-------------账户设置结束-----------*/
app.use(router.routes())
.use(router.allowedMethods())
}