jelly пре 3 година
родитељ
комит
5922d04034

+ 37 - 0
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/MusicSheetController.java

@@ -0,0 +1,37 @@
+package com.yonge.cooleshow.admin.controller;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.biz.dal.entity.MusicSheet;
+import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/music")
+@Api(tags = "乐谱 web controller")
+public class MusicSheetController extends BaseController {
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private MusicSheetService musicSheetService;
+
+    @ApiOperation(value = "新增曲谱")
+    @RequestMapping("/sheet/create")
+    public Object create(@RequestBody MusicSheet musicSheet) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+
+        musicSheet.setCreateBy(0L);
+        musicSheetService.insert(musicSheet);
+        return succeed();
+    }
+}

+ 20 - 4
cooleshow-user/user-admin/src/main/resources/bootstrap-dev.yml

@@ -1,12 +1,28 @@
+#spring:
+#  cloud:
+#    nacos:
+#      config:
+#        server-addr: 47.114.1.200:8848
+#        namespace: 6f8374a9-598f-4889-bb17-476070ffb8de
+#        group: DEFAULT_GROUP
+#        prefix: student
+#        file-extension: yaml
+#        refresh:
+#          enabled: true
+#        enabled: true
+
 spring:
   cloud:
     nacos:
+      discovery:
+        server-addr: localhost:8848 #ÅäÖÃNacosµØÖ·
+        namespace: dev
       config:
-        server-addr: 47.114.1.200:8848
-        namespace: 6f8374a9-598f-4889-bb17-476070ffb8de
+        server-addr: localhost:8848
+        namespace: dev
         group: DEFAULT_GROUP
-        prefix: student
+        #prefix: admin
         file-extension: yaml
         refresh:
           enabled: true
-        enabled: true
+        enabled: true