Skip to content

Commit

Permalink
去掉emoji的依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenWatermelon committed Feb 22, 2023
1 parent e60124b commit 85c073b
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 71 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<qiniu.version>7.2.18</qiniu.version>
<weixin.version>3.5.0</weixin.version>
<orika.version>1.5.4</orika.version>
<emoji.version>4.0.0</emoji.version>
<aliyun-core.version>4.3.9</aliyun-core.version>
<aliyun-dysmsapi.version>1.1.0</aliyun-dysmsapi.version>
<mybatis-plus.version>3.1.0</mybatis-plus.version>
Expand Down Expand Up @@ -89,11 +88,6 @@
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>${aliyun-dysmsapi.version}</version>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
<version>${emoji.version}</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* Swagger文档,只有在测试环境才会使用
* @author LGH
*/
//@Profile("dev")
@Configuration
public class SwaggerConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
package com.yami.shop.admin.controller;

import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.emoji.EmojiUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.User;
Expand Down Expand Up @@ -46,7 +45,7 @@ public ResponseEntity<IPage<User>> page(User user,PageParam<User> page) {
.like(StrUtil.isNotBlank(user.getNickName()), User::getNickName, user.getNickName())
.eq(user.getStatus() != null, User::getStatus, user.getStatus()));
for (User userResult : userPage.getRecords()) {
userResult.setNickName(EmojiUtil.toUnicode(userResult.getNickName() == null ? "" : userResult.getNickName()));
userResult.setNickName(userResult.getNickName() == null ? "" : userResult.getNickName());
}
return ResponseEntity.ok(userPage);
}
Expand All @@ -58,7 +57,7 @@ public ResponseEntity<IPage<User>> page(User user,PageParam<User> page) {
@PreAuthorize("@pms.hasPermission('admin:user:info')")
public ResponseEntity<User> info(@PathVariable("userId") String userId) {
User user = userService.getById(userId);
user.setNickName(EmojiUtil.toUnicode(user.getNickName() == null ? "" : user.getNickName()));
user.setNickName(user.getNickName() == null ? "" : user.getNickName());
return ResponseEntity.ok(user);
}

Expand All @@ -69,7 +68,7 @@ public ResponseEntity<User> info(@PathVariable("userId") String userId) {
@PreAuthorize("@pms.hasPermission('admin:user:update')")
public ResponseEntity<Void> update(@RequestBody User user) {
user.setModifyTime(new Date());
user.setNickName(EmojiUtil.toAlias(user.getNickName() == null ? "" : user.getNickName()));
user.setNickName(user.getNickName() == null ? "" : user.getNickName());
userService.updateById(user);
return ResponseEntity.ok().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
* Swagger文档,只有在测试环境才会使用
* @author LGH
*/
//@Profile("dev")
@Configuration
public class SwaggerConfiguration {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class PayController {
*/
@PostMapping("/pay")
@Operation(summary = "根据订单号进行支付" , description = "根据订单号进行支付")
@SneakyThrows
public ResponseEntity<WxPayMpOrderResult> pay(@RequestBody PayParam payParam) {
YamiUser user = SecurityUtils.getUser();
String userId = user.getUserId();
Expand All @@ -58,7 +57,6 @@ public ResponseEntity<WxPayMpOrderResult> pay(@RequestBody PayParam payParam) {
*/
@PostMapping("/normalPay")
@Operation(summary = "根据订单号进行支付" , description = "根据订单号进行支付")
@SneakyThrows
public ResponseEntity<Boolean> normalPay(@RequestBody PayParam payParam) {

YamiUser user = SecurityUtils.getUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@

package com.yami.shop.api.controller;

import cn.hutool.extra.emoji.EmojiUtil;
import com.yami.shop.bean.app.dto.UserDto;
import com.yami.shop.bean.app.param.UserInfoParam;
import com.yami.shop.bean.model.User;
import com.yami.shop.security.api.util.SecurityUtils;
import com.yami.shop.service.UserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import ma.glasnost.orika.MapperFacade;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -53,7 +52,7 @@ public ResponseEntity<Void> setUserInfo(@RequestBody UserInfoParam userInfoParam
User user = new User();
user.setUserId(userId);
user.setPic(userInfoParam.getAvatarUrl());
user.setNickName(EmojiUtil.toAlias(userInfoParam.getNickName()));
user.setNickName(userInfoParam.getNickName());
userService.updateById(user);
return ResponseEntity.ok().build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.common.serializer.json.EmojiJsonSerializer;
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
Expand Down Expand Up @@ -63,7 +62,6 @@ public class ProdCommDto {
@JsonFormat(pattern = "yyyy-MM-dd")
private Date replyTime;

@JsonSerialize(using = EmojiJsonSerializer.class)
@Schema(description = "用户昵称" )
private String nickName;

Expand Down
14 changes: 5 additions & 9 deletions yami-shop-bean/src/main/java/com/yami/shop/bean/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,14 @@

package com.yami.shop.bean.model;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.*;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.common.serializer.json.EmojiJsonSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @author lanhai
*/
Expand All @@ -37,7 +34,6 @@ public class User implements Serializable {
/**
* 用户昵称
*/
@JsonSerialize(using = EmojiJsonSerializer.class)
private String nickName;

/**
Expand Down
4 changes: 0 additions & 4 deletions yami-shop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
</dependency>
<dependency>
<groupId>com.vdurmont</groupId>
<artifactId>emoji-java</artifactId>
</dependency>
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-pay</artifactId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,19 @@

package com.yami.shop.service.impl;

import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.emoji.EmojiUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.bean.model.User;
import com.yami.shop.bean.param.UserRegisterParam;
import com.yami.shop.bean.vo.UserVO;
import com.yami.shop.common.exception.YamiShopBindException;
import com.yami.shop.common.util.RedisUtil;
import com.yami.shop.dao.UserMapper;
import com.yami.shop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.Objects;
import java.util.UUID;

/**
* @author lgh on 2018/09/11.
Expand Down

0 comments on commit 85c073b

Please sign in to comment.