From f8cc44e926fd22f9d1d864dc684c827f6960270b Mon Sep 17 00:00:00 2001 From: hjl <1657978663@qq.com> Date: 星期五, 26 七月 2024 11:51:30 +0800 Subject: [PATCH] feat: 最新代码及配置 --- ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java b/ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java index 866cb3e..7d0b568 100644 --- a/ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java +++ b/ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -58,6 +59,12 @@ private RecoveryClassifyService recoveryClassifyService; @Resource private RecoveryServeService recoveryServeService; + + /** + * 用户端默认头像 + */ + @Value("${default.profilePicture}") + private String profilePicture; /** * 解密用户敏感数据 @@ -128,6 +135,7 @@ // 随机编号 user.setUserNo(String.format(Constants.USER_NO_PRE, RandomUtil.randomNumbers(Constants.EIGHT))); user.setState(Constants.ONE); + user.setProfilePicture(profilePicture); user.setNickname(String.format(Constants.USER_NO_PRE, StringUtils.getCharAndNum(Constants.SIX))); user.setPhone(phone); user.setCity(loginPhoneRequest.getCity()); @@ -239,7 +247,8 @@ @ApiOperation(value = "首页回收分类推荐", tags = {"用户端-首页"}) public R<List<RecoveryClassify>> recommend() { return R.ok(recoveryClassifyService.lambdaQuery().eq(RecoveryClassify::getIsRecommend, Constants.ONE) - .eq(RecoveryClassify::getIsDelete, 0).orderByAsc(RecoveryClassify::getSort).list()); + .eq(RecoveryClassify::getIsDelete, 0).orderByDesc(RecoveryClassify::getSort) + .orderByDesc(RecoveryClassify::getCreateTime).list()); } /** @@ -253,10 +262,10 @@ public R<List<RecoveryServe>> recoverySearch(@RequestParam String keyword) { LambdaQueryChainWrapper<RecoveryServe> wrapper = recoveryServeService.lambdaQuery() .eq(RecoveryServe::getIsDelete, 0) - .orderByAsc(RecoveryServe::getSort); + .orderByDesc(RecoveryServe::getSort); wrapper = null != keyword && !"".equals(keyword.trim()) ? wrapper.like(RecoveryServe::getServeName, keyword) : wrapper; - List<RecoveryServe> serveList = wrapper.list(); + List<RecoveryServe> serveList = wrapper.orderByDesc(RecoveryServe::getCreateTime).list(); for (RecoveryServe recoveryServe : serveList) { RecoveryClassify classify = recoveryClassifyService.lambdaQuery() .eq(RecoveryClassify::getId, recoveryServe.getClassifyId()).one(); -- Gitblit v1.7.1