|
|
@@ -119,29 +119,6 @@ public class TechnicianMomentController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取动态详情
|
|
|
- * 包含动态标题、技师昵称头像、技师状态、浏览量、封面图等信息
|
|
|
- * 每点击查看一次,浏览量+1
|
|
|
- *
|
|
|
- * @param momentId 动态ID
|
|
|
- * @return R<MomentDetailVO> 动态详情
|
|
|
- */
|
|
|
- @GetMapping("/detail/{momentId}")
|
|
|
- @ApiOperation("获取动态详情")
|
|
|
- public R<MomentDetailVO> getMomentDetail(@ApiParam("动态ID") @PathVariable Long momentId) {
|
|
|
- try {
|
|
|
- if (momentId == null) {
|
|
|
- return R.fail("动态ID不能为空");
|
|
|
- }
|
|
|
- MomentDetailVO detail = momentService.getMomentDetail(momentId);
|
|
|
- return R.ok(detail);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("获取动态详情失败", e);
|
|
|
- return R.fail("获取动态详情失败:" + e.getMessage());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 统一查询接口
|
|
|
* 根据queryType参数决定查询类型:1-推荐,2-同城,3-附近
|
|
|
@@ -152,20 +129,19 @@ public class TechnicianMomentController extends BaseController {
|
|
|
* @param longitude 用户经度(附近查询时必填)
|
|
|
* @param pageNum 页码,默认1
|
|
|
* @param pageSize 每页数量,默认10
|
|
|
- * @return 动态列表
|
|
|
+ * @return R<List<MomentListVO>> 动态列表
|
|
|
*/
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation("统一查询接口")
|
|
|
public R<List<MomentListVO>> getMomentList(
|
|
|
@ApiParam("查询类型:1-推荐,2-同城,3-附近") @RequestParam Integer queryType,
|
|
|
@ApiParam("城市编码") @RequestParam(required = false) String cityCode,
|
|
|
- @ApiParam("用户纬度") @RequestParam(required = false) java.math.BigDecimal latitude,
|
|
|
- @ApiParam("用户经度") @RequestParam(required = false) java.math.BigDecimal longitude,
|
|
|
+ @ApiParam("用户经度") @RequestParam(required = false) BigDecimal longitude,
|
|
|
+ @ApiParam("用户纬度") @RequestParam(required = false) BigDecimal latitude,
|
|
|
@ApiParam("页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
@ApiParam("每页数量") @RequestParam(defaultValue = "10") Integer pageSize) {
|
|
|
try {
|
|
|
List<MomentListVO> list;
|
|
|
-
|
|
|
switch (queryType) {
|
|
|
case 1:
|
|
|
// 推荐
|
|
|
@@ -188,7 +164,6 @@ public class TechnicianMomentController extends BaseController {
|
|
|
default:
|
|
|
return R.fail("查询类型不正确,必须是1-推荐、2-同城、3-附近");
|
|
|
}
|
|
|
-
|
|
|
return R.ok(list);
|
|
|
} catch (Exception e) {
|
|
|
log.error("查询动态列表失败", e);
|
|
|
@@ -196,6 +171,33 @@ public class TechnicianMomentController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取动态详情
|
|
|
+ * 包含动态标题、技师昵称头像、技师状态、浏览量、封面图等信息
|
|
|
+ * 每点击查看一次,浏览量+1
|
|
|
+ *
|
|
|
+ * @param momentId 动态ID
|
|
|
+ * @return R<MomentDetailVO> 动态详情
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperation("获取动态详情")
|
|
|
+ public R<MomentDetailVO> getMomentDetail(@ApiParam("动态ID") @RequestParam Long momentId,
|
|
|
+ @ApiParam("用户经度") @RequestParam(required = false) BigDecimal longitude,
|
|
|
+ @ApiParam("用户纬度") @RequestParam(required = false) BigDecimal latitude) {
|
|
|
+ try {
|
|
|
+ if (momentId == null) {
|
|
|
+ return R.fail("动态ID不能为空");
|
|
|
+ }
|
|
|
+ MomentDetailVO detail = momentService.getMomentDetail(momentId, longitude, latitude);
|
|
|
+ return R.ok(detail);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取动态详情失败", e);
|
|
|
+ return R.fail("获取动态详情失败:" + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 发布动态或保存草稿
|
|
|
*
|