Browse Source

Merge remote-tracking branch 'origin/master'

Joburgess 5 years ago
parent
commit
8422b28d60

+ 2 - 2
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/web/controller/UserController.java

@@ -93,7 +93,7 @@ public class UserController extends BaseController {
 	@ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "authCode", value = "验证码", required = true, dataType = "String"),
 			@ApiImplicitParam(name = "newPassword", value = "新密码", required = true, dataType = "String")})
-	public Object updatePassword(String mobile,String authCode,String password,String newPassword) {
+	public Object updatePassword(String mobile,String authCode,String newPassword) {
 		if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(authCode) || StringUtils.isEmpty(newPassword)){
 			return failed("参数校验异常");
 		}
@@ -102,7 +102,7 @@ public class UserController extends BaseController {
 			return failed("用户不存在");
 		}
 		if(smsCodeService.verifyValidCode(mobile, authCode)){
-			sysUserService.updatePassword(mobile,newPassword);
+			sysUserService.updatePassword(mobile,new BCryptPasswordEncoder().encode(newPassword));
 			return succeed();
 		}else {
 			return failed("验证码错误");

+ 2 - 2
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/MusicGroupDao.java

@@ -29,7 +29,7 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @param userId
      * @return
      */
-    int countUserMusicGroups(Integer userId);
+    Integer countUserMusicGroups(Integer userId);
 
     /**
      * 根据课程类型获取剩余课时
@@ -37,5 +37,5 @@ public interface MusicGroupDao extends BaseDAO<String, MusicGroup> {
      * @param type
      * @return
      */
-    int countCourseByType(@Param("userId") Integer userId, @Param("type") ClassGroupTypeEnum type);
+    Integer countCourseByType(@Param("userId") Integer userId, @Param("type") ClassGroupTypeEnum type);
 }

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/SysAreaDao.java

@@ -18,4 +18,11 @@ public interface SysAreaDao extends BaseDAO<Integer, SysArea> {
      * @return
      */
     List<SysArea> findRootList(@Param("parentId") Integer parentId, @Param("delFlag") YesOrNoEnum delFlag);
+
+    /**
+     * 根据子级区域获取父级节点
+     * @param id
+     * @return
+     */
+    SysArea getParentArea(Integer id);
 }

+ 27 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/CourseListDto.java

@@ -0,0 +1,27 @@
+package com.ym.mec.biz.dal.dto;
+
+import com.ym.mec.biz.dal.enums.YesOrNoEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+public class CourseListDto {
+
+    @ApiModelProperty(value = "学生姓名",required = true)
+    private String studentNames;
+
+    @ApiModelProperty(value = "乐团、vip课名称",required = true)
+    private String musicGroupName;
+
+    @ApiModelProperty(value = "授课地址",required = true)
+    private String address;
+
+    @ApiModelProperty(value = "总课次",required = true)
+    private Integer totalClassTimes;
+
+    @ApiModelProperty(value = "当前课次",required = true)
+    private Integer currentClassTimes;
+
+    private String teacherName;
+
+    private String teachMode;
+
+}

+ 7 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SysAreaService.java

@@ -22,4 +22,11 @@ public interface SysAreaService extends BaseService<Integer, SysArea> {
      * @return
      */
     List<SysArea> queryChild(TreeDto treeDto);
+
+    /**
+     * 根据子级区域获取父级节点
+     * @param id
+     * @return
+     */
+    SysArea getParentArea(Integer id);
 }

+ 5 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SysAreaServiceImpl.java

@@ -39,6 +39,11 @@ public class SysAreaServiceImpl extends BaseServiceImpl<Integer, SysArea> implem
 		return sysAreaDao.findRootList(treeDto.getParentId(),treeDto.getDelFlag());
 	}
 
+	@Override
+	public SysArea getParentArea(Integer id) {
+		return sysAreaDao.getParentArea(id);
+	}
+
 	private SysArea getTree(SysArea area){
 		//得到根节点对象
 		//获取子节点list

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/SysAreaMapper.xml

@@ -80,4 +80,7 @@
         SELECT * FROM sys_area WHERE parent_organ_id_ = #{parentId}
         AND del_flag_ = #{delFlag,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
     </select>
+    <select id="getParentArea" resultMap="SysArea">
+        SELECT * FROM sys_area WHERE id_ = (SELECT parent_organ_id_ FROM sys_area WHERE id_ = #{id})
+    </select>
 </mapper>

+ 38 - 0
mec-client-api/src/main/java/com/ym/im/ImFeignService.java

@@ -2,6 +2,7 @@ package com.ym.im;
 
 import com.ym.im.fallback.ImFeignServiceFallback;
 import com.ym.mec.common.config.FeignConfiguration;
+import com.ym.mec.common.entity.ImGroupModel;
 import com.ym.mec.common.entity.ImUserModel;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -10,6 +11,43 @@ import org.springframework.web.bind.annotation.RequestBody;
 @FeignClient(name = "im-server", configuration = FeignConfiguration.class, fallback = ImFeignServiceFallback.class)
 public interface ImFeignService {
 
+    /**
+     * 用户注册
+     * @param userModel
+     * @return
+     */
     @PostMapping(value = "user/register")
     Object getUser(@RequestBody ImUserModel userModel);
+
+    /**
+     * 创建群组
+     * @param groupModel
+     * @return
+     */
+    @PostMapping(value = "group/create")
+    Object groupCreate(@RequestBody ImGroupModel groupModel);
+
+    /**
+     * 加入群组
+     * @param groupModel
+     * @return
+     */
+    @PostMapping(value = "group/join")
+    Object groupJoin(@RequestBody ImGroupModel groupModel);
+
+    /**
+     * 退出群组
+     * @param groupModel
+     * @return
+     */
+    @PostMapping(value = "group/quit")
+    Object groupQuit(@RequestBody ImGroupModel groupModel);
+
+    /**
+     * 解散群组
+     * @param groupModel
+     * @return
+     */
+    @PostMapping(value = "group/dismiss")
+    Object groupDismiss(@RequestBody ImGroupModel groupModel);
 }

+ 41 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupMember.java

@@ -0,0 +1,41 @@
+package com.ym.mec.common.entity;
+
+public class ImGroupMember {
+    public String id;
+    public String groupId;
+    public Integer munite;
+
+    public ImGroupMember() {
+    }
+
+    public ImGroupMember(String id, String groupId, Integer munite) {
+        this.id = id;
+        this.groupId = groupId;
+        this.munite = munite;
+    }
+
+    public ImGroupMember setId(String id) {
+        this.id = id;
+        return this;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+
+    public String getGroupId() {
+        return this.groupId;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public Integer getMunite() {
+        return this.munite;
+    }
+
+    public void setMunite(Integer munite) {
+        this.munite = munite;
+    }
+}

+ 69 - 0
mec-common/common-core/src/main/java/com/ym/mec/common/entity/ImGroupModel.java

@@ -0,0 +1,69 @@
+package com.ym.mec.common.entity;
+
+public class ImGroupModel {
+    private String id;
+    private ImGroupMember[] members;
+    private String name;
+    private Integer minute;
+    private Integer status;
+
+    public ImGroupModel() {
+    }
+
+    public ImGroupModel(String id, ImGroupMember[] members, String name, Integer minute) {
+        this.id = id;
+        this.members = members;
+        this.name = name;
+        this.minute = minute;
+    }
+
+    public ImGroupModel(String id, Integer status) {
+        this.id = id;
+        this.status = status;
+    }
+
+    public String getId() {
+        return this.id;
+    }
+
+    public ImGroupModel setId(String id) {
+        this.id = id;
+        return this;
+    }
+
+    public ImGroupMember[] getMembers() {
+        return this.members;
+    }
+
+    public ImGroupModel setMembers(ImGroupMember[] members) {
+        this.members = members;
+        return this;
+    }
+
+    public String getName() {
+        return this.name;
+    }
+
+    public ImGroupModel setName(String name) {
+        this.name = name;
+        return this;
+    }
+
+    public Integer getMinute() {
+        return this.minute;
+    }
+
+    public ImGroupModel setMinute(Integer minute) {
+        this.minute = minute;
+        return this;
+    }
+
+    public Integer getStatus() {
+        return this.status;
+    }
+
+    public ImGroupModel setStatus(Integer status) {
+        this.status = status;
+        return this;
+    }
+}

+ 1 - 0
mec-im/src/main/java/com/ym/service/Impl/RoomServiceImpl.java

@@ -83,6 +83,7 @@ public class RoomServiceImpl implements RoomService {
         CheckUtils.checkArgument(roomId != null, "roomId must't be null");
 
         log.info("joinRoom: roomId={}, userName={}, isAudience={}, isDisableCamera={}", roomId, userName, isAudience, isDisableCamera);
+        roomId = "DAYA" + roomId;
 //        String userId = getUser().getUserId().toString();
         String userId = sysUserFeignService.queryUserInfo().getId().toString();
 

+ 5 - 2
mec-student/src/main/java/com/ym/mec/student/controller/MusicGroupController.java

@@ -4,6 +4,8 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.service.MusicGroupService;
 import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.security.AuthUser;
+import com.ym.mec.common.security.SecurityUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,10 +27,11 @@ public class MusicGroupController extends BaseController {
     @GetMapping(value = "/queryUserMusicGroups")
     public Object queryUserMusicGroups(){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
+        AuthUser user = SecurityUtils.getUser();
         if(sysUser == null){
             return failed("请重新登录");
         }
-        return succeed(musicGroupService.queryUserMusicGroups(sysUser.getId()));
+        return succeed(musicGroupService.queryUserMusicGroups(1));
     }
 
     @ApiOperation("获取学生个人中心乐团信息")
@@ -38,6 +41,6 @@ public class MusicGroupController extends BaseController {
         if(sysUser == null){
             return failed("请重新登录");
         }
-        return succeed(musicGroupService.queryPersonalMusicGroups(sysUser.getId()));
+        return succeed(musicGroupService.queryPersonalMusicGroups(1));
     }
 }

+ 3 - 3
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/storage/vendors/AliyunOssStoragePlugin.java

@@ -21,13 +21,13 @@ public class AliyunOssStoragePlugin implements StoragePlugin, InitializingBean,
 	@Value("${storage.oss.endpoint:oss-cn-beijing.aliyuncs.com}")
 	private String endpoint;
 
-	@Value("${storage.oss.accessKeyId:LTAIwZW9XqrfsZ4r}")
+	@Value("${storage.oss.accessKeyId:LTAI4Fdhxwfo7FsBDZKK8Wfv}")
 	private String accessKeyId;
 
-	@Value("${storage.oss.accessKeySecret:5uDsNZmHMxcnxav8w9byII4zcPpu5G}")
+	@Value("${storage.oss.accessKeySecret:ERRma4P9VWbD98n93gspnZXmoq7rn5}")
 	private String accessKeySecret;
 
-	@Value("${storage.oss.bucketName:yooma-test}")
+	@Value("${storage.oss.bucketName:daya-online}")
 	private String bucketName;
 
 	private OSSClient ossClient;

+ 8 - 6
mec-web/src/main/java/com/ym/mec/web/controller/SysAreaController.java

@@ -3,8 +3,10 @@ package com.ym.mec.web.controller;
 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;
 
@@ -52,12 +54,12 @@ public class SysAreaController extends BaseController {
     public Object update(SysArea area){
         area.setUpdateTime(new Date());
         return succeed(sysAreaService.update(area));
-    }
+    }*/
 
-    @ApiOperation(value = "根据区域编号查询区域详情")
-    @GetMapping("/get/{id}")
+    @ApiOperation(value = "根据子级区域获取父级节点")
+    @GetMapping("/getParentArea/{id}")
     @ApiParam(value = "区域编号", required = true)
-    public Object get( @PathVariable("id") Integer id){
-        return succeed(sysAreaService.get(id));
-    }*/
+    public Object getParentArea( @PathVariable("id") Integer id){
+        return succeed(sysAreaService.getParentArea(id));
+    }
 }