|
@@ -134,8 +134,8 @@ public class TaPostController extends BaseController {
|
134
|
134
|
*/
|
135
|
135
|
@RequestMapping(value="/admin/post/{id}",method= RequestMethod.PUT)
|
136
|
136
|
@ApiOperation(value="更新", notes = "更新", httpMethod = "PUT", response = ResponseBean.class)
|
137
|
|
- public ResponseBean taPostUpdate(@ApiParam("对象ID") @PathVariable Integer id,
|
138
|
|
- @ApiParam("更新内容") @RequestBody TaPost taPost) throws Exception{
|
|
137
|
+ public ResponseBean taPostUpdate(@ApiParam("对象ID") @PathVariable String id,
|
|
138
|
+ @ApiParam("更新内容") @RequestBody TaPost taPost) throws Exception{
|
139
|
139
|
|
140
|
140
|
TdPostType postType = iTdPostTypeService.getById(taPost.getTypeId());
|
141
|
141
|
if (null != postType) {
|
|
@@ -158,8 +158,6 @@ public class TaPostController extends BaseController {
|
158
|
158
|
public ResponseBean taPostGet(@ApiParam(value = "客户端", allowableValues = "admin,ma") @PathVariable String client,
|
159
|
159
|
@ApiParam("文章ID") @PathVariable String id) throws Exception{
|
160
|
160
|
|
161
|
|
- Map<String, Object> result = new HashMap<>();
|
162
|
|
-
|
163
|
161
|
// 获取文章信息
|
164
|
162
|
TaPost taPost = iTaPostService.getById(id);
|
165
|
163
|
if (null == taPost || Constants.STATUS_DELETED.equals(taPost.getStatus())) {
|
|
@@ -168,6 +166,7 @@ public class TaPostController extends BaseController {
|
168
|
166
|
|
169
|
167
|
// 获取统计信息
|
170
|
168
|
TaPostData taPostData = iTaPostDataService.getById(id);
|
|
169
|
+ taPost.setPostData(taPostData);
|
171
|
170
|
|
172
|
171
|
|
173
|
172
|
// 获取试题
|
|
@@ -178,7 +177,7 @@ public class TaPostController extends BaseController {
|
178
|
177
|
// 当前人员是否收藏过
|
179
|
178
|
TaPerson taPerson = getCurrentPerson();
|
180
|
179
|
boolean saved = iTaPostSaveService.checkSaved(taPerson.getPersonId(), id);
|
181
|
|
- result.put("saved", saved);
|
|
180
|
+ taPost.setIsSaved(saved);
|
182
|
181
|
|
183
|
182
|
// 埋点数据
|
184
|
183
|
iTaPostDataService.recordBy(id, taPerson);
|
|
@@ -192,11 +191,8 @@ public class TaPostController extends BaseController {
|
192
|
191
|
}
|
193
|
192
|
}
|
194
|
193
|
}
|
|
194
|
+ taPost.setPostTestList(postTestList);
|
195
|
195
|
|
196
|
|
- result.put("post", taPost);
|
197
|
|
- result.put("postData", taPostData);
|
198
|
|
- result.put("postTest", postTestList);
|
199
|
|
-
|
200
|
|
- return ResponseBean.success(result);
|
|
196
|
+ return ResponseBean.success(taPost);
|
201
|
197
|
}
|
202
|
198
|
}
|