|
@@ -1,11 +1,16 @@
|
|
|
package com.yonge.cooleshow.website.controller;
|
|
|
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.album.PurchaseRecordTypeEnum;
|
|
|
+import com.yonge.cooleshow.common.enums.EStatus;
|
|
|
import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Optional;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
@@ -82,13 +87,19 @@ public class MusicSheetController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 我的单曲,收藏单曲
|
|
|
*/
|
|
|
- @GetMapping("/my")
|
|
|
@ApiOperation(value = "学生-我的单曲")
|
|
|
- public HttpResponseResult<PageInfo<MusicSheetVo>> myMusic(@ApiParam(value = "客户端类型") @RequestParam(value = "clientType", required = false, defaultValue = "STUDENT") String clientType,
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "clientType", value = "客户端类型 TEACHER, STUDENT, 默认值: STUDENT"),
|
|
|
+ @ApiImplicitParam(name = "gift", value = "课程赠品 0:购买 1:赠品, 默认值: 0"),
|
|
|
+ @ApiImplicitParam(name = "page", value = "分页查询, 默认值: 1"),
|
|
|
+ @ApiImplicitParam(name = "row", value = "当前页行数, 默认值: 10"),
|
|
|
+ })
|
|
|
+ @GetMapping("/my")
|
|
|
+ public HttpResponseResult<PageInfo<MusicSheetVo>> myMusic(@RequestParam(value = "clientType", required = false, defaultValue = "STUDENT") String clientType,
|
|
|
+ @RequestParam(value = "gift", required = false, defaultValue = "0") Integer gift,
|
|
|
QueryInfo query) {
|
|
|
SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
if (sysUser == null || sysUser.getId() == null) {
|
|
@@ -103,11 +114,15 @@ public class MusicSheetController extends BaseController {
|
|
|
search.setStudentId(sysUser.getId());
|
|
|
search.setAuditStatus(AuthStatusEnum.PASS);
|
|
|
search.setUserType(ClientEnum.valueOf(clientType));
|
|
|
+ search.setPurchaseType(Optional.ofNullable(search.getPurchaseType()).orElse(PurchaseRecordTypeEnum.MUSIC));
|
|
|
+ search.setCourseGift(Optional.ofNullable(search.getCourseGift()).orElse(EStatus.DISABLE.getValue()));
|
|
|
+
|
|
|
IPage<MusicSheetVo> sheetVoIPage = musicSheetService.myMusic(PageUtil.getPage(query),search);
|
|
|
return succeed(PageUtil.pageInfo(sheetVoIPage));
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 我的单曲,收藏单曲
|
|
|
*/
|