| | |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | |
|
| | |
|
| | |
| | | for (UserCloudGroup userCloudGroup: list) {
|
| | | if (groupId.equals(userCloudGroup.getGroupId())) {
|
| | | exist = true;
|
| | | // 群名为空
|
| | | if (StringUtil.isNullOrEmpty(groupName)) {
|
| | | return;
|
| | | }
|
| | | |
| | | // 群名字变化
|
| | | if (!groupName.equals(userCloudGroup.getGroupName())) {
|
| | | UserCloudGroup update = new UserCloudGroup();
|
| | |
| | |
|
| | | if (exist)
|
| | | return;
|
| | | |
| | | // 群名为空
|
| | | if (StringUtil.isNullOrEmpty(groupName)) {
|
| | | groupName = "本群未命名名称";
|
| | | }
|
| | |
|
| | | UserCloudGroup cloudGroup = new UserCloudGroup();
|
| | | cloudGroup.setUid(uid);
|
| | |
| | | userCloudGroupMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteGroup(long uid, long id) throws UserCloudGroupException{
|
| | | UserCloudGroup cloudGroup = userCloudGroupMapper.selectByPrimaryKey(id);
|
| | | if (cloudGroup == null || cloudGroup.getUid() != uid)
|
| | | throw new UserCloudGroupException(1, "该记录已不存在");
|
| | | |
| | | if (cloudGroup.getUid() != uid) {
|
| | | throw new UserCloudGroupException(1, "该群已不存在");
|
| | | }
|
| | | userCloudGroupMapper.deleteByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteGroupByUid(Long uid){
|