Commit 31325531 authored by 刘基明's avatar 刘基明

删除无用方法

parent 3fdd9bb1
package com.tanpu.community.dao.entity.community;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
/**
* <p>
* 个人主页
* </p>
*
* @author xudong
* @since 2021-07-22
*/
@TableName("home_page")
@ApiModel(value="HomePageEntity对象", description="个人主页")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class HomePageEntity implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "头像url")
private String headImg;
@ApiModelProperty(value = "昵称")
private String nickName;
@ApiModelProperty(value = "个人简介")
private String introduction;
@ApiModelProperty(value = "性别")
private Integer sex;
@ApiModelProperty(value = "地址")
private String location;
private LocalDateTime createTime;
private LocalDateTime updateTime;
private Integer deleteTag;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getHeadImg() {
return headImg;
}
public void setHeadImg(String headImg) {
this.headImg = headImg;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public LocalDateTime getCreateTime() {
return createTime;
}
public void setCreateTime(LocalDateTime createTime) {
this.createTime = createTime;
}
public LocalDateTime getUpdateTime() {
return updateTime;
}
public void setUpdateTime(LocalDateTime updateTime) {
this.updateTime = updateTime;
}
public Integer getDeleteTag() {
return deleteTag;
}
public void setDeleteTag(Integer deleteTag) {
this.deleteTag = deleteTag;
}
@Override
public String toString() {
return "HomePageEntity{" +
"id=" + id +
", userId=" + userId +
", headImg=" + headImg +
", nickName=" + nickName +
", introduction=" + introduction +
", sex=" + sex +
", location=" + location +
", createTime=" + createTime +
", updateTime=" + updateTime +
", deleteTag=" + deleteTag +
"}";
}
}
package com.tanpu.community.dao.mapper.community;
import com.tanpu.community.dao.entity.community.HomePageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 个人主页 Mapper 接口
* </p>
*
* @author xudong
* @since 2021-07-22
*/
public interface HomePageMapper extends BaseMapper<HomePageEntity> {
}
package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanpu.community.api.enums.DeleteTagEnum;
import com.tanpu.community.dao.entity.community.HomePageEntity;
import com.tanpu.community.dao.mapper.community.HomePageMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Service
public class HomePageService {
@Resource
private HomePageMapper homePageMapper;
public HomePageEntity selectByUserId(String userId) {
return homePageMapper.selectOne(new LambdaQueryWrapper<HomePageEntity>()
.eq(HomePageEntity::getUserId, userId)
.eq(HomePageEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode()));
}
public List<HomePageEntity> selectListByUserIds(List<String> userIds) {
if (CollectionUtils.isEmpty(userIds)) {
return Collections.emptyList();
}
return homePageMapper.selectList(new LambdaQueryWrapper<HomePageEntity>()
.eq(HomePageEntity::getDeleteTag,DeleteTagEnum.NOT_DELETED.getCode())
.in(HomePageEntity::getUserId, userIds));
}
public void update(HomePageEntity entity) {
homePageMapper.updateById(entity);
}
public void insert(HomePageEntity entity) {
homePageMapper.insert(entity);
}
}
......@@ -118,7 +118,7 @@ public class RankService {
if (this.rankTopicList.size()==0){
rankTopics();
}
List<TopicRankQo> matchTopic = this.rankTopicList.stream().filter(o -> o.getTopicId().equals(topicId)).limit(1).collect(Collectors.toList());
List<TopicRankQo> matchTopic = this.rankTopicList.stream().filter(o -> topicId.equals(o.getTopicId())).limit(1).collect(Collectors.toList());
matchTopic.add(new TopicRankQo());
return matchTopic.get(0);
}
......@@ -149,6 +149,6 @@ public class RankService {
if (this.rankThemeList.size()==0){
this.rankThemes();
}
return rankThemeList.stream().filter(o->o.getTopicId().equals(topicId)).collect(Collectors.toList());
return rankThemeList.stream().filter(o->topicId.equals(o.getTopicId())).collect(Collectors.toList());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tanpu.community.dao.mapper.community.HomePageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.tanpu.community.dao.entity.community.HomePageEntity">
<id column="id" property="id" />
<result column="user_id" property="userId" />
<result column="head_img" property="headImg" />
<result column="nick_name" property="nickName" />
<result column="introduction" property="introduction" />
<result column="sex" property="sex" />
<result column="location" property="location" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="delete_tag" property="deleteTag" />
</resultMap>
</mapper>
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