Browse Source

数据库修改

dev
Administrator 1 month ago
parent
commit
c5f093e96c
  1. 4
      src/main/java/org/hlrj/duobao_demo/entity/Recommendation.java
  2. 4
      src/main/java/org/hlrj/duobao_demo/entity/SpecialTopic.java
  3. 2
      src/main/java/org/hlrj/duobao_demo/entity/VideoData.java
  4. 10
      src/main/resources/mapper/RecommendationMapper.xml
  5. 7
      src/main/resources/mapper/SpecialTopicMapper.xml
  6. 1
      src/main/resources/mapper/VideoDateMapper.xml

4
src/main/java/org/hlrj/duobao_demo/entity/Recommendation.java

@ -47,7 +47,7 @@ public class Recommendation implements Serializable {
@ApiModelProperty(value = "点赞数")
private Integer likes;
@ApiModelProperty(value = "评论数")
@ApiModelProperty(value = "观看数")
private Integer comments;
@ApiModelProperty(value = "分享数")
@ -56,5 +56,7 @@ public class Recommendation implements Serializable {
@ApiModelProperty(value = "来源")
private String source;
@ApiModelProperty(value = "头像")
private String head;
}

4
src/main/java/org/hlrj/duobao_demo/entity/SpecialTopic.java

@ -56,5 +56,9 @@ public class SpecialTopic implements Serializable {
@ApiModelProperty(value = "点赞数")
private Integer likeCount;
@ApiModelProperty(value = "俱乐部")
private String club;
@ApiModelProperty(value = "头像")
private String head;
}

2
src/main/java/org/hlrj/duobao_demo/entity/VideoData.java

@ -43,5 +43,7 @@ public class VideoData implements Serializable {
private String description;//描述
private String head;//头像
}

10
src/main/resources/mapper/RecommendationMapper.xml

@ -13,6 +13,7 @@
<result column="comments" property="comments" />
<result column="shares" property="shares" />
<result column="source" property="source" />
<result column="head" property="head"/>
</resultMap>
<!--点赞操作-->
@ -40,6 +41,9 @@
<if test="source !=null">
source=#{source},
</if>
<if test="head !=null and head!=''">
head=#{head}
</if>
likes = likes + 1
</set>
where id = #{id}
@ -71,9 +75,13 @@
shares=#{shares},
</if>
<if test="source !=null">
source=#{source}
source=#{source},
</if>
<if test="head !=null and head!=''">
head=#{head}
</if>
</set>
where id = #{id}

7
src/main/resources/mapper/SpecialTopicMapper.xml

@ -13,6 +13,7 @@
<result column="view_count" property="viewCount" />
<result column="comment_count" property="commentCount" />
<result column="like_count" property="likeCount" />
<result column="club" property="club"/>
</resultMap>
<!--点赞操作-->
<update id="addLike" parameterType="org.hlrj.duobao_demo.entity.SpecialTopic">
@ -39,6 +40,12 @@
<if test="commentCount !=null">
commentCount=#{commentCount},
</if>
<if test="club !=null and club!=''">
club=#{club},
</if>
<if test="head !=null and head!=''">
head=#{head},
</if>
like_count = like_count + 1
</set>
where id = #{id}

1
src/main/resources/mapper/VideoDateMapper.xml

@ -11,6 +11,7 @@
<result column="author" property="author" />
<result column="publish_time" property="publishTime" />
<result column="description" property="description" />
<result column="head" property="head"/>
</resultMap>
</mapper>
Loading…
Cancel
Save