|
@@ -7,17 +7,23 @@ import com.yonge.cooleshow.admin.io.request.music.MusicCompareVo;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.biz.dal.service.MusicCompareRecordStatService;
|
|
import com.yonge.cooleshow.biz.dal.service.MusicCompareRecordStatService;
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysMusicCompareRecordService;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.music.MusicCompareWrapper;
|
|
import com.yonge.cooleshow.biz.dal.wrapper.music.MusicCompareWrapper;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
|
+import com.yonge.toolset.base.exception.BizException;
|
|
import com.yonge.toolset.base.page.PageInfo;
|
|
import com.yonge.toolset.base.page.PageInfo;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
import com.yonge.toolset.mybatis.support.PageUtil;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -39,6 +45,8 @@ public class MusicCompareRecordStatController extends BaseController {
|
|
private SysUserFeignService sysUserFeignService;
|
|
private SysUserFeignService sysUserFeignService;
|
|
@Autowired
|
|
@Autowired
|
|
private MusicCompareRecordStatService musicCompareRecordStatService;
|
|
private MusicCompareRecordStatService musicCompareRecordStatService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private SysMusicCompareRecordService sysMusicCompareRecordService;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 查询曲目统计汇总信息
|
|
* 查询曲目统计汇总信息
|
|
@@ -83,4 +91,40 @@ public class MusicCompareRecordStatController extends BaseController {
|
|
|
|
|
|
return succeed(PageUtil.getPageInfo(wrapper, pageInfos));
|
|
return succeed(PageUtil.getPageInfo(wrapper, pageInfos));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询曲目统计汇总信息
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "曲目评测信息查询")
|
|
|
|
+ @PostMapping(value = "/evaluate/page", consumes="application/json", produces="application/json")
|
|
|
|
+ public HttpResponseResult<PageInfo<MusicCompareWrapper.RecordEvaluate>> musicCompareEvaluatePageInfo(@RequestBody MusicCompareVo.EvaluateQueryInfo request) {
|
|
|
|
+
|
|
|
|
+ if (request.invalidParam()) {
|
|
|
|
+ return failed("无效的请求参数");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 曲目统计信息
|
|
|
|
+ IPage<MusicCompareWrapper.RecordEvaluate> wrapper = musicCompareRecordStatService.findMusicCompareRecordEvaluatePage(PageUtil.getPage(request),
|
|
|
|
+ MusicCompareWrapper.EvaluteQueryInfo.from(request.jsonString()));
|
|
|
|
+
|
|
|
|
+ return succeed(PageUtil.pageInfo(wrapper));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 用户最近一次评测报告
|
|
|
|
+ * @param recordId 评测记录ID
|
|
|
|
+ * @return HttpResponseResult<Object>
|
|
|
|
+ */
|
|
|
|
+ @ApiOperation(value = "用户最后一次评测数据")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "recordId", value = "评测记录ID", required = true, dataType = "Integer")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping("evaluate/report")
|
|
|
|
+ public HttpResponseResult<Object> getLastEvaluationMusicalNotesPlayStats(@RequestParam("recordId") Long recordId){
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
+ if(sysUser == null){
|
|
|
|
+ throw new BizException("请登录");
|
|
|
|
+ }
|
|
|
|
+ return succeed(sysMusicCompareRecordService.getLastEvaluationMusicalNotesPlayStats(sysUser.getId(), recordId));
|
|
|
|
+ }
|
|
}
|
|
}
|