Commit 61e9dfbf authored by liming's avatar liming

用户个人信息注销接口

parent 9e8e233e
......@@ -112,4 +112,11 @@ public class SportUserController {
public ResponseEntity<Result<HomePopupVO>> getPopup(@PathVariable("sportUserId") Long sportUserId) {
return success(sportUserService.getPopup(sportUserId));
}
@ApiOperation("账户注销")
@GetMapping("delete/{sportUserId}")
public ResponseEntity<Result> delete(@PathVariable("sportUserId") Long sportUserId){
sportUserService.delete(sportUserId);
return success();
}
}
......@@ -13,7 +13,9 @@ import com.antai.sport.http.server.server.api.business.user.dto.NewMessageVO;
import com.antai.sport.http.server.server.api.business.user.dto.RespUserHomeInfo;
import com.antai.sport.http.server.server.api.business.user.mapper.SportUserSummaryBusinessMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import javax.annotation.Resource;
import java.math.BigDecimal;
......@@ -39,6 +41,9 @@ public class SportUserService {
@Resource
private AchievementService achievementService;
@Resource
private RedisTemplate<String, Object> redisTemplate;
public RespUserHomeInfo getUserHomeInfo(Long userId) {
RespUserHomeInfo resp = new RespUserHomeInfo();
SportUser sportUser = sportUserMapper.selectById(userId);
......@@ -149,4 +154,10 @@ public class SportUserService {
return result;
}
public void delete(@PathVariable("sportUserId") Long sportUserId) {
SportUser sportUser = sportUserMapper.selectById(sportUserId);
redisTemplate.delete("sport_user::" + sportUser.getPhone());
sportUserMapper.deleteById(sportUserId);
}
}
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