From 2fc2f8330e18c2415dc13abe6777474a3babaefa Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Sun, 23 Mar 2025 19:13:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0https?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/constant/UserConstant.java | 2 +- .../controller/clothes/ClothesController.java | 19 ++++++++++++++++++- .../service/user/impl/UserServiceImpl.java | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/cultural/heritage/constant/UserConstant.java b/src/main/java/com/cultural/heritage/constant/UserConstant.java index 41b4ca1..ec16418 100644 --- a/src/main/java/com/cultural/heritage/constant/UserConstant.java +++ b/src/main/java/com/cultural/heritage/constant/UserConstant.java @@ -14,7 +14,7 @@ public interface UserConstant { /** * 用户默认头像 */ - String USER_DEFAULT_AVATAR = "https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQbtEasUN-VCG211285566731.png"; + String USER_DEFAULT_AVATAR = "feiyi%2Ftest%2F0%2FQbtEasUN-VCG211285566731.png"; /** * 用户登录键 diff --git a/src/main/java/com/cultural/heritage/controller/clothes/ClothesController.java b/src/main/java/com/cultural/heritage/controller/clothes/ClothesController.java index 6bf9b26..739d100 100644 --- a/src/main/java/com/cultural/heritage/controller/clothes/ClothesController.java +++ b/src/main/java/com/cultural/heritage/controller/clothes/ClothesController.java @@ -18,6 +18,7 @@ import com.cultural.heritage.model.dto.clothes.ClothesAddRequest; import com.cultural.heritage.model.dto.clothes.ClothesQueryRequest; import com.cultural.heritage.model.dto.clothes.ClothesUpdateRequest; import com.cultural.heritage.model.entity.Clothes; +import com.cultural.heritage.model.vo.clothes.ClothesLabelVO; import com.cultural.heritage.model.vo.clothes.ClothesVO; import com.cultural.heritage.service.clothes.ClothesService; import com.cultural.heritage.service.common.CommonService; @@ -128,7 +129,7 @@ public class ClothesController { /** - * 根据服装id查询服装信息 + * 小程序端用户根据id查询服装 */ @PostMapping("/get/id") @Operation(summary = "小程序端用户根据id查询服装", description = "参数:服装id,权限:所有人,方法名:getClothesById") @@ -139,6 +140,22 @@ public class ClothesController { + /** + * 小程序端用户根据id查询服装(不包含富文本) + */ + @PostMapping("/get/label/id") + @Operation(summary = "小程序端用户根据id查询服装(不包含富文本)", description = "参数:服装id,权限:所有人,方法名:getClothesLabelById") + public BaseResponse getClothesLabelById(@RequestBody CommonRequest commonRequest) { + if (commonRequest == null) throw new BusinessException(ErrorCode.PARAMS_ERROR); + Long id = commonRequest.getId(); + Clothes clothes = clothesService.getById(id); + ThrowUtils.throwIf(clothes == null, ErrorCode.OPERATION_ERROR, "服装不存在"); + ClothesLabelVO clothesLabelVO = commonService.copyProperties(clothes, ClothesLabelVO.class); + return ResultUtils.success(clothesLabelVO); + } + + + /** * Web端管理员分页查询服装 diff --git a/src/main/java/com/cultural/heritage/service/user/impl/UserServiceImpl.java b/src/main/java/com/cultural/heritage/service/user/impl/UserServiceImpl.java index b80aa73..15399c4 100644 --- a/src/main/java/com/cultural/heritage/service/user/impl/UserServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/user/impl/UserServiceImpl.java @@ -185,7 +185,7 @@ public class UserServiceImpl extends ServiceImpl implements Us user.setUserAccount(userAccount); user.setUserPassword(userPassword); user.setMiniOpenId(openid); - user.setUserName("非遗雅士"); + user.setUserName("玲珑" + RandomUtil.randomString(8)); user.setUserRole("user"); user.setPoints(10000); user.setUserAvatar(UserConstant.USER_DEFAULT_AVATAR);