|
@@ -1,5 +1,6 @@
|
|
|
package com.yonge.cooleshow.admin.controller;
|
|
|
|
|
|
+import com.yonge.cooleshow.biz.dal.enums.MusicSheetTypeEnum;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -106,7 +107,13 @@ public class MusicSheetController extends BaseController {
|
|
|
&& musicSheetDto.getMusicPrice()==null){
|
|
|
return failed("此曲谱为收费曲谱,需要提供价格");
|
|
|
}
|
|
|
- if (StringUtil.isEmpty(musicSheetDto.getMusicSubject())) {
|
|
|
+
|
|
|
+ // 单曲时声部必填,合奏非必填,默认单曲
|
|
|
+ if (musicSheetDto.getMusicSheetType() == null || StringUtil.isEmpty(musicSheetDto.getMusicSheetType())) {
|
|
|
+ musicSheetDto.setMusicSheetType(MusicSheetTypeEnum.SINGLE.getCode());
|
|
|
+ }
|
|
|
+ if (MusicSheetTypeEnum.SINGLE.getCode().equals(musicSheetDto.getMusicSheetType())
|
|
|
+ && StringUtil.isEmpty(musicSheetDto.getMusicSubject())) {
|
|
|
return failed("曲目声部不能为空");
|
|
|
}
|
|
|
|
|
@@ -121,7 +128,9 @@ public class MusicSheetController extends BaseController {
|
|
|
return failed("每个一级标签只能选一个二级标签");
|
|
|
}
|
|
|
|
|
|
- if (StringUtil.isEmpty(musicSheetDto.getMusicImg())) {
|
|
|
+ // 合奏图片不做限制
|
|
|
+ if (MusicSheetTypeEnum.SINGLE.getCode().equals(musicSheetDto.getMusicSheetType()) &&
|
|
|
+ StringUtil.isEmpty(musicSheetDto.getMusicImg())) {
|
|
|
throw new BizException("曲目渲染失败");
|
|
|
}
|
|
|
|
|
@@ -177,7 +186,9 @@ public class MusicSheetController extends BaseController {
|
|
|
musicSheet.setNotation(YesOrNoEnum.NO);
|
|
|
}
|
|
|
|
|
|
- if (StringUtil.isEmpty(musicSheet.getMusicImg())) {
|
|
|
+ // 合奏时图片不做限制
|
|
|
+ if (MusicSheetTypeEnum.SINGLE.getCode().equals(musicSheet.getMusicSheetType())
|
|
|
+ && StringUtil.isEmpty(musicSheet.getMusicImg())) {
|
|
|
throw new BizException("曲目渲染失败");
|
|
|
}
|
|
|
|