Przeglądaj źródła

官网声部下拉框

liweifan 3 lat temu
rodzic
commit
12cd894c5f

+ 38 - 0
cooleshow-user/user-website/src/main/java/com/yonge/cooleshow/website/controller/SubjectController.java

@@ -0,0 +1,38 @@
+package com.yonge.cooleshow.website.controller;
+
+import com.yonge.cooleshow.biz.dal.entity.Subject;
+import com.yonge.cooleshow.biz.dal.service.SubjectService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RequestMapping("subject")
+@Api(tags = "声部服务")
+@RestController
+public class SubjectController extends BaseController {
+    @Autowired
+    private SubjectService subjectService;
+
+    @ApiOperation(value = "根据声部编号查询声部")
+    @GetMapping("/get/{id}")
+    public Object get(@ApiParam(value = "声部编号", required = true) @PathVariable("id") Long id) {
+        return succeed(subjectService.get(id));
+    }
+
+    @ApiOperation(value = "获取声部")
+    @GetMapping("/subjectSelect")
+    public HttpResponseResult<List<Subject>> subjectSelect() {
+        List<Subject> subjectSelect = subjectService.subjectSelect();
+        return succeed(subjectSelect);
+    }
+
+}