Explorar el Código

content-service 中删除 Favlist 和 FavlistContent

reghao hace 6 meses
padre
commit
1fb435270b

+ 0 - 23
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/FavlistContentMapper.java

@@ -1,23 +0,0 @@
-package cn.reghao.tnb.content.app.vod.db.mapper;
-
-import cn.reghao.jutil.jdk.db.BaseMapper;
-import cn.reghao.jutil.jdk.db.Page;
-import cn.reghao.tnb.content.app.vod.model.po.FavlistContent;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author reghao
- * @date 2023-10-11 14:23:45
- */
-@Mapper
-public interface FavlistContentMapper extends BaseMapper<FavlistContent> {
-    void deleteByContentId(@Param("contentId") String contentId, @Param("favlistId") long favlistId);
-
-    FavlistContent findByContentId(String contentId, int contentType, long userId);
-
-    int countByFavlistId(long favlistId);
-    List<FavlistContent> findByFavlistIdByPage(Page page, long favlistId);
-}

+ 0 - 20
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/FavlistMapper.java

@@ -1,20 +0,0 @@
-package cn.reghao.tnb.content.app.vod.db.mapper;
-
-import cn.reghao.jutil.jdk.db.BaseMapper;
-import cn.reghao.tnb.content.app.vod.model.po.Favlist;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author reghao
- * @date 2023-10-11 14:23:36
- */
-@Mapper
-public interface FavlistMapper extends BaseMapper<Favlist> {
-    Favlist findByContentType(@Param("contentType") int contentType, @Param("userId") long userId);
-
-    Favlist findByFavlistId(long favlistId);
-    List<Favlist> findByCreateBy(int contentType, long userId);
-}

+ 0 - 27
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/po/Favlist.java

@@ -1,27 +0,0 @@
-package cn.reghao.tnb.content.app.vod.model.po;
-
-import cn.reghao.jutil.jdk.db.BaseObject;
-import cn.reghao.tnb.common.auth.UserContext;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-/**
- * @author reghao
- * @date 2023-10-11 14:21:00
- */
-@NoArgsConstructor
-@Getter
-@Deprecated
-public class Favlist extends BaseObject<Integer> {
-    private Long favlistId;
-    private String favlistName;
-    private Integer contentType;
-    private Long createBy;
-
-    public Favlist(long favlistId, String favlistName, int contentType) {
-        this.favlistId = favlistId;
-        this.favlistName = favlistName;
-        this.contentType = contentType;
-        this.createBy = UserContext.getUserId();
-    }
-}

+ 0 - 26
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/po/FavlistContent.java

@@ -1,26 +0,0 @@
-package cn.reghao.tnb.content.app.vod.model.po;
-
-import cn.reghao.jutil.jdk.db.BaseObject;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-import java.time.LocalDateTime;
-
-/**
- * @author reghao
- * @date 2023-10-11 14:19:47
- */
-@NoArgsConstructor
-@Getter
-@Deprecated
-public class FavlistContent extends BaseObject<Integer> {
-    private Long favlistId;
-    private String contentId;
-    private LocalDateTime collectAt;
-
-    public FavlistContent(long favlistId, String contentId) {
-        this.favlistId = favlistId;
-        this.contentId = contentId;
-        this.collectAt = LocalDateTime.now();
-    }
-}

+ 0 - 37
content/content-service/src/main/resources/mapper/vod/FavlistContentMapper.xml

@@ -1,37 +0,0 @@
-<?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="cn.reghao.tnb.content.app.vod.db.mapper.FavlistContentMapper">
-    <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into favlist_content
-        (`id`,`favlist_id`,`content_id`,`collect_at`)
-        values 
-        (#{id},#{favlistId},#{contentId},#{collectAt})
-    </insert>
-
-    <delete id="deleteByContentId">
-        delete from favlist_content
-        where content_id=#{contentId} and favlist_id=#{favlistId}
-    </delete>
-
-    <select id="findByContentId" resultType="cn.reghao.tnb.content.app.vod.model.po.FavlistContent">
-        select *
-        from favlist_content
-        where favlist_id in (
-            select favlist_id
-            from favlist
-            where content_type=#{contentType} and create_by=#{userId})
-          and content_id=#{contentId}
-    </select>
-
-    <select id="countByFavlistId" resultType="java.lang.Integer">
-        select count(*)
-        from favlist_content
-        where favlist_id=#{favlistId}
-    </select>
-    <select id="findByFavlistIdByPage" resultType="cn.reghao.tnb.content.app.vod.model.po.FavlistContent">
-        select *
-        from favlist_content
-        where favlist_id=#{favlistId}
-    </select>
-</mapper>

+ 0 - 30
content/content-service/src/main/resources/mapper/vod/FavlistMapper.xml

@@ -1,30 +0,0 @@
-<?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="cn.reghao.tnb.content.app.vod.db.mapper.FavlistMapper">
-    <insert id="save" useGeneratedKeys="true" keyProperty="id">
-        insert into favlist
-        (`id`,`deleted`,`create_time`,`update_time`,`favlist_id`,`favlist_name`,`content_type`,`create_by`)
-        values 
-        (#{id},#{deleted},#{createTime},#{updateTime},#{favlistId},#{favlistName},#{contentType},#{createBy})
-    </insert>
-
-    <select id="findByContentType" resultType="cn.reghao.tnb.content.app.vod.model.po.Favlist">
-        select *
-        from favlist
-        where content_type=#{contentType} and create_by=#{userId}
-        order by id asc
-        limit 1
-    </select>
-
-    <select id="findByFavlistId" resultType="cn.reghao.tnb.content.app.vod.model.po.Favlist">
-        select *
-        from favlist
-        where favlist_id=#{favlistId}
-    </select>
-    <select id="findByCreateBy" resultType="cn.reghao.tnb.content.app.vod.model.po.Favlist">
-        select *
-        from favlist
-        where content_type=#{contentType} and create_by=#{userId}
-    </select>
-</mapper>