|
@@ -2,6 +2,7 @@ package com.keao.edu.user.controller;
|
|
|
|
|
|
import com.keao.edu.common.controller.BaseController;
|
|
import com.keao.edu.common.controller.BaseController;
|
|
import com.keao.edu.common.entity.HttpResponseResult;
|
|
import com.keao.edu.common.entity.HttpResponseResult;
|
|
|
|
+import com.keao.edu.common.exception.BizException;
|
|
import com.keao.edu.common.page.PageInfo;
|
|
import com.keao.edu.common.page.PageInfo;
|
|
import com.keao.edu.common.page.QueryInfo;
|
|
import com.keao.edu.common.page.QueryInfo;
|
|
import com.keao.edu.common.tenant.TenantContextHolder;
|
|
import com.keao.edu.common.tenant.TenantContextHolder;
|
|
@@ -12,10 +13,12 @@ import com.keao.edu.user.service.TenantInfoService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author Joburgess
|
|
* @Author Joburgess
|
|
@@ -45,6 +48,9 @@ public class ExamSongController extends BaseController {
|
|
@ApiOperation("新增曲库")
|
|
@ApiOperation("新增曲库")
|
|
@PostMapping(value = "/add")
|
|
@PostMapping(value = "/add")
|
|
public HttpResponseResult add(ExamSong examSong) {
|
|
public HttpResponseResult add(ExamSong examSong) {
|
|
|
|
+ if(StringUtils.isBlank(examSong.getSubjectList())){
|
|
|
|
+ throw new BizException("请选择专业");
|
|
|
|
+ }
|
|
examSong.setTenantId(TenantContextHolder.getTenantId().toString());
|
|
examSong.setTenantId(TenantContextHolder.getTenantId().toString());
|
|
examSongService.insert(examSong);
|
|
examSongService.insert(examSong);
|
|
return succeed();
|
|
return succeed();
|
|
@@ -63,4 +69,10 @@ public class ExamSongController extends BaseController {
|
|
public HttpResponseResult add(Integer id) {
|
|
public HttpResponseResult add(Integer id) {
|
|
return succeed(examSongService.delete(id));
|
|
return succeed(examSongService.delete(id));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation("根据专业获取曲目")
|
|
|
|
+ @GetMapping(value = "/getWithSubject")
|
|
|
|
+ public HttpResponseResult<List<ExamSong>> getWithSubject(Integer subjectId){
|
|
|
|
+ return succeed(examSongService.getWithSubject(subjectId));
|
|
|
|
+ }
|
|
}
|
|
}
|