Commit 5ec26d5c authored by 李健华's avatar 李健华

Merge branch 'feature/compliance_user_attached-20220530' into 'master'

Feature/compliance user attached 20220530

See merge request !66
parents 1a5f0ea3 90addeb9
# Created by https://www.gitignore.io # Created by https://www.gitignore.io
### log ### ### log ###
*.log *.log
*.gz
### svn ### ### svn ###
.svn/ .svn/
......
...@@ -125,6 +125,34 @@ public class UserCenterController { ...@@ -125,6 +125,34 @@ public class UserCenterController {
return JsonResult.buildSuccessResult(null, userAttached.getNick()); return JsonResult.buildSuccessResult(null, userAttached.getNick());
} }
@RequestMapping("/kdsp/saveNick")
@ApiOperation(value = "保存昵称", notes = "保存用户昵称", httpMethod = "POST")
public JsonResult saveUserNickForKdsp(Long userId, String nick) {
if (null == userId || userId == 0L) {
return JsonResult.buildErrorStateResult("该用户不存在", null);
}
UserAttached userAttached = userCenterService.saveUserNick(userId, nick);
return JsonResult.buildSuccessResult(null, userAttached.getNick());
}
@RequestMapping("/kdsp/save/avatar")
@ApiOperation(value = "保存头像", notes = "保存用户头像", httpMethod = "POST")
public JsonResult saveUserAvatarAddrForKdsp(Long userId, String avatarUrl) {
if (StringUtils.isBlank(avatarUrl)) {
log.error("参数不合法:avatarUrl:{}}", avatarUrl );
return JsonResult.buildErrorStateResult("参数不合法", null);
}
if (null == userId || userId == 0L) {
return JsonResult.buildErrorStateResult("该用户不存在", null);
}
UserAttached userAttached = userCenterService.saveUserAvatar(userId, avatarUrl);
if (null == userAttached) {
log.error("保存用户头像昵称失败.");
return JsonResult.buildErrorStateResult("信息保存失败,请稍后再试.", null);
}
return JsonResult.buildSuccessResult("保存成功", userAttached);
}
/** /**
* 上传后调用该接口保存用户头像 * 上传后调用该接口保存用户头像
* *
...@@ -408,4 +436,11 @@ public class UserCenterController { ...@@ -408,4 +436,11 @@ public class UserCenterController {
return null == user ? null : user.getId(); return null == user ? null : user.getId();
} }
@GetMapping("/attach/listLimit/{id}")
public JsonResult queryUserAttachListLimit(@PathVariable Long id) {
//默认羊小咩租户
List<UserAttached> userAttachedList = userCenterService.queryUserAttachListLimit(id);
return JsonResult.buildSuccessResultGeneric(userAttachedList);
}
} }
...@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.repository; ...@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.UserAttached; import cn.quantgroup.xyqb.entity.UserAttached;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
...@@ -17,4 +18,7 @@ public interface IUserAttachedRepository extends JpaRepository<UserAttached, Lon ...@@ -17,4 +18,7 @@ public interface IUserAttachedRepository extends JpaRepository<UserAttached, Lon
@Transactional @Transactional
void deleteByUserId(Long userId); void deleteByUserId(Long userId);
@Query(value = "select * from user_attached where id>?1 limit 500" ,nativeQuery = true)
List<UserAttached> findALlAttached(Long id);
} }
...@@ -40,4 +40,6 @@ public interface UserCenterService { ...@@ -40,4 +40,6 @@ public interface UserCenterService {
* @return * @return
*/ */
UserAttached saveUserNick(long userId, String nick); UserAttached saveUserNick(long userId, String nick);
List<UserAttached> queryUserAttachListLimit(Long id);
} }
...@@ -114,6 +114,11 @@ public class UserCenterServiceImpl implements UserCenterService { ...@@ -114,6 +114,11 @@ public class UserCenterServiceImpl implements UserCenterService {
return userAttached; return userAttached;
} }
@Override
public List<UserAttached> queryUserAttachListLimit(Long id) {
return userAttachedRepository.findALlAttached(id);
}
/** /**
* 创建用户附加信息实体 * 创建用户附加信息实体
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment