liujc 2 months ago
parent
commit
a756282540

+ 19 - 4
cooleshow-app/src/main/java/com/yonge/cooleshow/teacher/controller/TenantGroupAlbumController.java

@@ -3,7 +3,9 @@ package com.yonge.cooleshow.teacher.controller;
 import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
+import com.yonge.cooleshow.biz.dal.service.TenantAlbumMusicService;
 import com.yonge.cooleshow.biz.dal.service.TenantGroupAlbumService;
+import com.yonge.cooleshow.biz.dal.wrapper.TenantAlbumMusicWrapper;
 import com.yonge.cooleshow.biz.dal.wrapper.TenantGroupAlbumWrapper;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -12,13 +14,12 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-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.*;
 
 import java.util.List;
 
+import static com.yonge.cooleshow.common.controller.BaseController.failed;
+
 @Slf4j
 @Validated
 @RestController
@@ -32,6 +33,8 @@ public class TenantGroupAlbumController {
     @Autowired
     private SysUserFeignService sysUserFeignService;
 
+    @Autowired
+    private TenantAlbumMusicService tenantAlbumMusicService;
 	@ApiOperation(value = "学生可购买机构专辑信息")
 	@GetMapping("/buyAlbumInfo")
 	public HttpResponseResult<List<TenantGroupAlbumWrapper.BuyTenantAlbum>> buyAlbumInfo(@RequestParam(required = false) Long tenantGroupAlbumId) {
@@ -47,4 +50,16 @@ public class TenantGroupAlbumController {
         query.setClientType(ClientEnum.TEACHER);
 		return HttpResponseResult.succeed(tenantGroupAlbumService.buyAlbumInfo(query));
 	}
+
+    @ApiOperation(value = "查询条件")
+    @PostMapping("/selectCondition")
+    public HttpResponseResult<TenantAlbumMusicWrapper.TenantAlbumMusicSelectData> selectCondition(@RequestBody @Validated TenantAlbumMusicWrapper.TenantAlbumMusicSelect query) {
+        SysUser user = sysUserFeignService.queryUserInfo();
+        if (user == null || null == user.getId()) {
+            return failed(HttpStatus.FORBIDDEN, "请登录");
+        }
+        query.setUserId(user.getId());
+        return HttpResponseResult.succeed(tenantAlbumMusicService.getTenantAlbumMusicQuery(query));
+    }
+
 }

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/enums/SubjectTypeEnum.java

@@ -11,7 +11,7 @@ import com.yonge.toolset.base.enums.BaseEnum;
  */
 public enum SubjectTypeEnum implements BaseEnum<String, SubjectTypeEnum> {
 
-
+    // 专辑类型 ENSEMBLE:合奏 MUSIC:小曲目 SUBJECT:声部 COURSEWARE:课件
     ENSEMBLE("合奏"),
     MUSIC("小曲目"),
     SUBJECT("声部"),

+ 2 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/TenantAlbumMusicWrapper.java

@@ -81,9 +81,11 @@ public class TenantAlbumMusicWrapper {
     public static class TenantAlbumMusicSelect {
 
         @ApiModelProperty("专辑ID")
+        @NotNull(message = "专辑ID不能为空")
         private Long tenantAlbumId;
 
         @ApiModelProperty("声部分类(ENSEMBLE, MUSIC, SUBJECT)")
+        @NotNull(message = "分类不能为空")
         private SubjectTypeEnum subjectType;
 
         @ApiModelProperty(value = "用户ID", hidden = true)