| 101 | global.Hydro.model.blog = BlogModel; |
| 102 | |
| 103 | class BlogHandler extends Handler { |
| 104 | ddoc?: BlogDoc; |
| 105 | |
| 106 | @param('did', Types.ObjectId, true) |
| 107 | async _prepare(domainId: string, did: ObjectId) { |
| 108 | if (did) { |
| 109 | this.ddoc = await BlogModel.get(did); |
| 110 | if (!this.ddoc) throw new DiscussionNotFoundError(domainId, did); |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | class BlogUserHandler extends BlogHandler { |
| 116 | @param('uid', Types.Int) |