(type)
| 60 | } |
| 61 | //获取id列表 |
| 62 | async getId(type){ |
| 63 | if (!this.idList.includes(type)) { |
| 64 | console.log('id类型错误'); |
| 65 | throw new Error('id类型错误'); |
| 66 | return |
| 67 | } |
| 68 | try{ |
| 69 | const idData = await Ids.findOne(); |
| 70 | idData[type] ++ ; |
| 71 | await idData.save(); |
| 72 | return idData[type] |
| 73 | }catch(err){ |
| 74 | console.log('获取ID数据失败'); |
| 75 | throw new Error(err) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | async uploadImg(req, res, next){ |
| 80 | const type = req.params.type; |
no outgoing calls
no test coverage detected