清理优化无关代码
This commit is contained in:
parent
21500680bc
commit
651bf29e91
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.common.response;
|
||||
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author linfeng
|
||||
* @date 2022/1/28 16:47
|
||||
*/
|
||||
@Data
|
||||
public class ChatMessageListResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer count;
|
||||
|
||||
private AppUserEntity userInfo;
|
||||
|
||||
private MessageEntity msg;
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.common.response;
|
||||
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Data
|
||||
public class MessageListResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 消息id
|
||||
*/
|
||||
private Integer mId;
|
||||
/**
|
||||
* 发送者uid
|
||||
*/
|
||||
private Integer fromUid;
|
||||
/**
|
||||
* 接收者uid
|
||||
*/
|
||||
private Integer toUid;
|
||||
/**
|
||||
* 帖子id
|
||||
*/
|
||||
private Integer postId;
|
||||
/**
|
||||
* 推送标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 0未读,1已读
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 1为点赞,2为评论 3为收藏 4为关注 5为推送文章 6私聊
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
private AppUserEntity userInfo;
|
||||
|
||||
/**
|
||||
* 帖子的内容
|
||||
*/
|
||||
private String postContent;
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.common.response;
|
||||
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author linfeng
|
||||
* @date 2022/2/8 21:25
|
||||
*/
|
||||
@Data
|
||||
public class MessageNoticeResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer mId;
|
||||
/**
|
||||
* 发送者uid
|
||||
*/
|
||||
private Integer fromUid;
|
||||
/**
|
||||
* 接收者uid
|
||||
*/
|
||||
private Integer toUid;
|
||||
/**
|
||||
* 帖子id
|
||||
*/
|
||||
private Integer postId;
|
||||
/**
|
||||
* 推送标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 0未读,1已读
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 1为点赞,2为评论 3为收藏 4为关注 5为推送文章 6私聊
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
private AppUserEntity userInfo;
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.common.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class MessageNumberResponse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 总消息数量
|
||||
*/
|
||||
private Integer allCount;
|
||||
/**
|
||||
* 评论数
|
||||
*/
|
||||
private Integer comment;
|
||||
/**
|
||||
* 关注数
|
||||
*/
|
||||
private Integer follow;
|
||||
/**
|
||||
* 帖子评论点赞数
|
||||
*/
|
||||
private Integer thumbCount;
|
||||
|
||||
/**
|
||||
* 推送通知消息
|
||||
*/
|
||||
private List<MessageNoticeResponse> articleMsgList;
|
||||
|
||||
|
||||
private List<ChatMessageListResponse> chatMsgList;
|
||||
|
||||
|
||||
}
|
@ -108,10 +108,6 @@ public class PostDetailResponse implements Serializable {
|
||||
*/
|
||||
private Boolean isThumb;
|
||||
|
||||
/**
|
||||
* 圈子信息
|
||||
*/
|
||||
private TopicDetailResponse topicInfo;
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
|
@ -1,132 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.common.response;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.DiscussEntity;
|
||||
import io.linfeng.modules.app.entity.TopicTopEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author linfeng
|
||||
* @date 2022/1/23 17:28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="TopicDetailResponse", description="圈子详情响应对象")
|
||||
public class TopicDetailResponse implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* 圈子id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 创建用户id
|
||||
*/
|
||||
private Integer uid;
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
private Integer cateId;
|
||||
/**
|
||||
* 圈子名称
|
||||
*/
|
||||
private String topicName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String coverImage;
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
private String bgImage;
|
||||
/**
|
||||
* 推荐类型:0 不推荐, 1首页推荐, 2圈子页推荐
|
||||
*/
|
||||
private Integer topType;
|
||||
/**
|
||||
* 圈子状态:0 正常 ,1禁用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否首页推荐圈子内容
|
||||
*/
|
||||
private Integer indexRecommend;
|
||||
/**
|
||||
* 加入人数
|
||||
*/
|
||||
private Integer userNum;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 用户详情
|
||||
*/
|
||||
private AppUserEntity userInfo;
|
||||
|
||||
|
||||
/**
|
||||
* 圈子的内容数量
|
||||
*/
|
||||
private Integer postCount;
|
||||
/**
|
||||
* 已加入圈子的人数
|
||||
*/
|
||||
private Integer userCount;
|
||||
|
||||
/**
|
||||
* $topicPostCount = Db::name("post")->where("topic_id",$topicId)->count();
|
||||
* $topicUserCount = Db::name("user_topic")->where("topic_id",$topicId)->count();
|
||||
*/
|
||||
|
||||
/**
|
||||
* 圈子的管理员
|
||||
*/
|
||||
private List<AppUserEntity> adminList;
|
||||
|
||||
/**
|
||||
* 是否为圈主或管理员
|
||||
*/
|
||||
private Boolean isAdmin;
|
||||
|
||||
/**
|
||||
* 圈子话题
|
||||
*/
|
||||
private List<DiscussEntity> discussList;
|
||||
/**
|
||||
* 是否加入
|
||||
*/
|
||||
private Boolean isJoin;
|
||||
/**
|
||||
* 置顶内容
|
||||
*/
|
||||
private List<TopicTopEntity> topPost;
|
||||
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import io.linfeng.common.exception.LinfengException;
|
||||
import io.linfeng.modules.admin.entity.PostEntity;
|
||||
import io.linfeng.modules.admin.service.PostService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.linfeng.modules.admin.entity.DiscussEntity;
|
||||
import io.linfeng.modules.admin.service.DiscussService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 2445465217@qq.com
|
||||
* @date 2022-01-24 13:44:37
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/discuss")
|
||||
public class DiscussController {
|
||||
|
||||
@Autowired
|
||||
private DiscussService discussService;
|
||||
@Autowired
|
||||
private PostService postService;
|
||||
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("admin:discuss:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = discussService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("admin:discuss:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
DiscussEntity discuss = discussService.getById(id);
|
||||
|
||||
return R.ok().put("discuss", discuss);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("admin:discuss:save")
|
||||
public R save(@RequestBody DiscussEntity discuss){
|
||||
discussService.save(discuss);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("admin:discuss:update")
|
||||
public R update(@RequestBody DiscussEntity discuss){
|
||||
discussService.updateById(discuss);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("admin:discuss:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
List<Integer> list = Arrays.asList(ids);
|
||||
list.forEach(id->{
|
||||
List<PostEntity> entityList = postService.lambdaQuery().eq(PostEntity::getDiscussId, id).list();
|
||||
if(entityList.size()>0){
|
||||
throw new LinfengException("请先删除该话题下的帖子");
|
||||
}
|
||||
discussService.removeById(id);
|
||||
});
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import io.linfeng.modules.admin.service.MessageService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 消息管理
|
||||
* @author linfeng
|
||||
* @email 2445465217@qq.com
|
||||
* @date 2022-01-26 13:15:30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/message")
|
||||
public class MessageController {
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("admin:message:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = messageService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{mId}")
|
||||
@RequiresPermissions("admin:message:info")
|
||||
public R info(@PathVariable("mId") Integer mId){
|
||||
MessageEntity message = messageService.getById(mId);
|
||||
|
||||
return R.ok().put("message", message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("admin:message:save")
|
||||
public R save(@RequestBody MessageEntity message){
|
||||
messageService.save(message);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("admin:message:update")
|
||||
public R update(@RequestBody MessageEntity message){
|
||||
messageService.updateById(message);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("admin:message:delete")
|
||||
public R delete(@RequestBody Integer[] mIds){
|
||||
messageService.removeByIds(Arrays.asList(mIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.linfeng.modules.admin.entity.SensitiveEntity;
|
||||
import io.linfeng.modules.admin.service.SensitiveService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 敏感词库信息表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 2445465217@qq.com
|
||||
* @date 2022-01-28 13:40:57
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/sensitive")
|
||||
public class SensitiveController {
|
||||
@Autowired
|
||||
private SensitiveService sensitiveService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("admin:sensitive:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = sensitiveService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("admin:sensitive:info")
|
||||
public R info(@PathVariable("id") Long id){
|
||||
SensitiveEntity sensitive = sensitiveService.getById(id);
|
||||
|
||||
return R.ok().put("sensitive", sensitive);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("admin:sensitive:update")
|
||||
public R update(@RequestBody SensitiveEntity sensitive){
|
||||
sensitiveService.updateById(sensitive);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.linfeng.modules.admin.entity.TopicEntity;
|
||||
import io.linfeng.modules.admin.service.TopicService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 2445465217@qq.com
|
||||
* @date 2022-01-21 17:01:12
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("admin/topic")
|
||||
public class TopicController {
|
||||
@Autowired
|
||||
private TopicService topicService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@RequiresPermissions("admin:topic:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = topicService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
@RequiresPermissions("admin:topic:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
TopicEntity topic = topicService.getById(id);
|
||||
|
||||
return R.ok().put("topic", topic);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
@RequiresPermissions("admin:topic:save")
|
||||
public R save(@RequestBody TopicEntity topic){
|
||||
topicService.save(topic);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("admin:topic:update")
|
||||
public R update(@RequestBody TopicEntity topic){
|
||||
topicService.updateById(topic);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
@RequiresPermissions("admin:topic:delete")
|
||||
public R delete(@RequestBody Integer[] ids){
|
||||
topicService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.dao;
|
||||
|
||||
import io.linfeng.modules.admin.entity.DiscussEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-24 13:44:37
|
||||
*/
|
||||
@Mapper
|
||||
public interface DiscussDao extends BaseMapper<DiscussEntity> {
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.dao;
|
||||
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-26 13:15:30
|
||||
*/
|
||||
@Mapper
|
||||
public interface MessageDao extends BaseMapper<MessageEntity> {
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.dao;
|
||||
|
||||
import io.linfeng.modules.admin.entity.SensitiveEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 敏感词库信息表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-28 13:40:57
|
||||
*/
|
||||
@Mapper
|
||||
public interface SensitiveDao extends BaseMapper<SensitiveEntity> {
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得转卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.dao;
|
||||
|
||||
import io.linfeng.modules.admin.entity.TopicEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-21 17:01:12
|
||||
*/
|
||||
@Mapper
|
||||
public interface TopicDao extends BaseMapper<TopicEntity> {
|
||||
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-24 13:44:37
|
||||
*/
|
||||
@Data
|
||||
@TableName("lf_discuss")
|
||||
public class DiscussEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 话题标签id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer uid;
|
||||
/**
|
||||
* 圈子id
|
||||
*/
|
||||
private Integer topicId;
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String introduce;
|
||||
/**
|
||||
* 浏览量
|
||||
*/
|
||||
private Integer readCount;
|
||||
/**
|
||||
* 推荐位置:0 不推荐 1 首页推荐
|
||||
*/
|
||||
private Integer topType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-26 13:15:30
|
||||
*/
|
||||
@Data
|
||||
@TableName("lf_message")
|
||||
public class MessageEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 消息id
|
||||
*/
|
||||
@TableId
|
||||
private Integer mId;
|
||||
/**
|
||||
* 发送者uid
|
||||
*/
|
||||
private Integer fromUid;
|
||||
/**
|
||||
* 接收者uid
|
||||
*/
|
||||
private Integer toUid;
|
||||
/**
|
||||
* 帖子id
|
||||
*/
|
||||
private Integer postId;
|
||||
/**
|
||||
* 推送标题
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 0未读,1已读
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 1为点赞,2为评论 3为收藏 4为关注 5为推送文章 6私聊
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 敏感词库信息表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-28 13:40:57
|
||||
*/
|
||||
@Data
|
||||
@TableName("lf_sensitive")
|
||||
public class SensitiveEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 敏感词库
|
||||
*/
|
||||
private String sensitiveWord;
|
||||
/**
|
||||
* 是否开启 1-是 0-否
|
||||
*/
|
||||
private Integer state;
|
||||
/**
|
||||
* 处理措施 1-禁止发布 2-需审核
|
||||
*/
|
||||
private Integer handleMeasures;
|
||||
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-21 17:01:12
|
||||
*/
|
||||
@Data
|
||||
@TableName("lf_topic")
|
||||
public class TopicEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 圈子id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 创建用户id
|
||||
*/
|
||||
private Integer uid;
|
||||
/**
|
||||
* 分类id
|
||||
*/
|
||||
private Integer cateId;
|
||||
/**
|
||||
* 圈子名称
|
||||
*/
|
||||
private String topicName;
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* logo
|
||||
*/
|
||||
private String coverImage;
|
||||
/**
|
||||
* 背景图
|
||||
*/
|
||||
private String bgImage;
|
||||
/**
|
||||
* 推荐类型:0 不推荐, 1首页推荐, 2圈子页推荐
|
||||
*/
|
||||
private Integer topType;
|
||||
/**
|
||||
* 圈子状态:0 正常 ,1禁用
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 是否首页推荐圈子内容
|
||||
*/
|
||||
private Integer indexRecommend;
|
||||
/**
|
||||
* 加入人数
|
||||
*/
|
||||
private Integer userNum;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
@ -20,7 +20,6 @@ import io.linfeng.common.response.HomeRateResponse;
|
||||
import io.linfeng.common.utils.AppPageUtils;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import io.linfeng.modules.app.form.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -1,41 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.response.DiscussDetailResponse;
|
||||
import io.linfeng.common.utils.AppPageUtils;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.DiscussEntity;
|
||||
import io.linfeng.modules.app.form.DiscussAddForm;
|
||||
import io.linfeng.modules.app.form.DiscussDeleteForm;
|
||||
import io.linfeng.modules.app.form.DiscussListForm;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-24 13:44:37
|
||||
*/
|
||||
public interface DiscussService extends IService<DiscussEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,41 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.response.MessageListResponse;
|
||||
import io.linfeng.common.response.MessageNumberResponse;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.admin.entity.AppUserEntity;
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import io.linfeng.modules.app.form.UpdateChatStatusForm;
|
||||
import io.linfeng.modules.app.form.UpdateSystemNoticeStatusForm;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-26 13:15:30
|
||||
*/
|
||||
public interface MessageService extends IService<MessageEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.admin.entity.SensitiveEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 敏感词库信息表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-28 13:40:57
|
||||
*/
|
||||
public interface SensitiveService extends IService<SensitiveEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
@ -1,35 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.admin.entity.TopicEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-21 17:01:12
|
||||
*/
|
||||
public interface TopicService extends IService<TopicEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,49 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.Query;
|
||||
|
||||
import io.linfeng.modules.admin.dao.DiscussDao;
|
||||
import io.linfeng.modules.admin.entity.DiscussEntity;
|
||||
import io.linfeng.modules.admin.service.DiscussService;
|
||||
|
||||
|
||||
@Service("discussService")
|
||||
public class DiscussServiceImpl extends ServiceImpl<DiscussDao, DiscussEntity> implements DiscussService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<DiscussEntity> page = this.page(
|
||||
new Query<DiscussEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service.impl;
|
||||
|
||||
import io.linfeng.common.utils.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import io.linfeng.modules.admin.dao.MessageDao;
|
||||
import io.linfeng.modules.admin.entity.MessageEntity;
|
||||
import io.linfeng.modules.admin.service.MessageService;
|
||||
|
||||
|
||||
@Service("messageService")
|
||||
public class MessageServiceImpl extends ServiceImpl<MessageDao, MessageEntity> implements MessageService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<MessageEntity> page = this.page(
|
||||
new Query<MessageEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -52,8 +52,6 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
||||
@Autowired
|
||||
private CommentService commentService;
|
||||
@Autowired
|
||||
private DiscussService discussService;
|
||||
@Autowired
|
||||
private LocalUser localUser;
|
||||
@Autowired
|
||||
private FollowService followService;
|
||||
@ -84,12 +82,6 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
||||
data.forEach(l->{
|
||||
PostListResponse response=new PostListResponse();
|
||||
BeanUtils.copyProperties(l,response);
|
||||
if(ObjectUtil.isNotNull(response.getDiscussId())&&response.getDiscussId()>0){
|
||||
DiscussEntity discussEntity = discussService.getById(response.getDiscussId());
|
||||
if(ObjectUtil.isNotNull(discussEntity)){
|
||||
response.setDiscussTitle(discussEntity.getTitle());
|
||||
}
|
||||
}
|
||||
response.setCollectionCount(postCollectionService.collectCount(response.getId()));
|
||||
response.setCommentCount(commentService.getCountByTopicId(response.getId()));
|
||||
response.setUserInfo(appUserService.getById(response.getUid()));
|
||||
|
@ -1,45 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.Query;
|
||||
|
||||
import io.linfeng.modules.admin.dao.SensitiveDao;
|
||||
import io.linfeng.modules.admin.entity.SensitiveEntity;
|
||||
import io.linfeng.modules.admin.service.SensitiveService;
|
||||
|
||||
|
||||
@Service("sensitiveService")
|
||||
public class SensitiveServiceImpl extends ServiceImpl<SensitiveDao, SensitiveEntity> implements SensitiveService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<SensitiveEntity> page = this.page(
|
||||
new Query<SensitiveEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 商业版演示站点: https://www.linfeng.tech
|
||||
* 商业版购买联系技术客服
|
||||
* QQ: 3582996245
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.admin.service.impl;
|
||||
|
||||
import io.linfeng.common.utils.*;
|
||||
import io.linfeng.modules.admin.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import io.linfeng.modules.admin.dao.TopicDao;
|
||||
import io.linfeng.modules.admin.entity.TopicEntity;
|
||||
|
||||
|
||||
@Service("topicService")
|
||||
public class TopicServiceImpl extends ServiceImpl<TopicDao, TopicEntity> implements TopicService {
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<TopicEntity> page = this.page(
|
||||
new Query<TopicEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点: https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.dao;
|
||||
|
||||
import io.linfeng.modules.app.entity.MomentEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 动态表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-05 14:23:11
|
||||
*/
|
||||
@Mapper
|
||||
public interface MomentDao extends BaseMapper<MomentEntity> {
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点: https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.dao;
|
||||
|
||||
import io.linfeng.modules.app.entity.TopicAdminEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-23 20:33:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface TopicAdminDao extends BaseMapper<TopicAdminEntity> {
|
||||
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点: https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得专卖或非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有 ,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.dao;
|
||||
|
||||
import io.linfeng.modules.app.entity.TopicTopEntity;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-23 20:33:29
|
||||
*/
|
||||
@Mapper
|
||||
public interface TopicTopDao extends BaseMapper<TopicTopEntity> {
|
||||
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 动态表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-05 14:23:11
|
||||
*/
|
||||
@Data
|
||||
@TableName("tb_moment")
|
||||
public class MomentEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 发送者id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 类型(TEXT:纯文本,IMAGE:图片,VIDEO:视频)
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 文本内容
|
||||
*/
|
||||
private String textContent;
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long activityId;
|
||||
/**
|
||||
* 点赞数量
|
||||
*/
|
||||
private Integer likeCount;
|
||||
/**
|
||||
* 评论数量
|
||||
*/
|
||||
private Integer commentCount;
|
||||
/**
|
||||
* 转发数量
|
||||
*/
|
||||
private Integer repostCount;
|
||||
/**
|
||||
* 分享数量
|
||||
*/
|
||||
private Integer shareCount;
|
||||
/**
|
||||
* 查看次数
|
||||
*/
|
||||
private Integer viewCount;
|
||||
/**
|
||||
* 转发的动态id
|
||||
*/
|
||||
private Long repostMomentId;
|
||||
/**
|
||||
* 状态(0:已屏蔽,1:正常,2:已删除)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long artistId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.app.entity.MomentEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 动态表
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-05 14:23:11
|
||||
*/
|
||||
public interface MomentService extends IService<MomentEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.app.entity.TopicAdminEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-23 20:33:29
|
||||
*/
|
||||
public interface TopicAdminService extends IService<TopicAdminEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
Boolean isAdmin(Integer uid, Integer id);
|
||||
}
|
||||
|
@ -1,34 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.modules.app.entity.TopicTopEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author linfeng
|
||||
* @email 3582996245@qq.com
|
||||
* @date 2022-01-23 20:33:29
|
||||
*/
|
||||
public interface TopicTopService extends IService<TopicTopEntity> {
|
||||
|
||||
PageUtils queryPage(Map<String, Object> params);
|
||||
|
||||
List<TopicTopEntity> findByTopicId(Integer id);
|
||||
}
|
||||
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.Query;
|
||||
|
||||
import io.linfeng.modules.app.dao.MomentDao;
|
||||
import io.linfeng.modules.app.entity.MomentEntity;
|
||||
import io.linfeng.modules.app.service.MomentService;
|
||||
|
||||
|
||||
@Service("momentService")
|
||||
public class MomentServiceImpl extends ServiceImpl<MomentDao, MomentEntity> implements MomentService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<MomentEntity> page = this.page(
|
||||
new Query<MomentEntity>().getPage(params),
|
||||
new QueryWrapper<MomentEntity>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.Query;
|
||||
|
||||
import io.linfeng.modules.app.dao.TopicAdminDao;
|
||||
import io.linfeng.modules.app.entity.TopicAdminEntity;
|
||||
import io.linfeng.modules.app.service.TopicAdminService;
|
||||
|
||||
|
||||
@Service("topicAdminService")
|
||||
public class TopicAdminServiceImpl extends ServiceImpl<TopicAdminDao, TopicAdminEntity> implements TopicAdminService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<TopicAdminEntity> page = this.page(
|
||||
new Query<TopicAdminEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isAdmin(Integer uid, Integer id) {
|
||||
LambdaQueryWrapper<TopicAdminEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(TopicAdminEntity::getUid, uid);
|
||||
lambdaQueryWrapper.eq(TopicAdminEntity::getTopicId, id);
|
||||
Integer num = baseMapper.selectCount(lambdaQueryWrapper);
|
||||
return num > 0;
|
||||
}
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
* -----------------------------------
|
||||
* 林风社交论坛开源版本请务必保留此注释头信息
|
||||
* 开源地址: https://gitee.com/virus010101/linfeng-community
|
||||
* 可正常分享和学习源码,不得用于非法牟利!
|
||||
* 商业版购买联系技术客服 QQ: 3582996245
|
||||
* Copyright (c) 2021-2023 linfeng all rights reserved.
|
||||
* 演示站点:https://www.linfeng.tech
|
||||
* 版权所有,侵权必究!
|
||||
* -----------------------------------
|
||||
*/
|
||||
package io.linfeng.modules.app.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import io.linfeng.common.utils.PageUtils;
|
||||
import io.linfeng.common.utils.Query;
|
||||
|
||||
import io.linfeng.modules.app.dao.TopicTopDao;
|
||||
import io.linfeng.modules.app.entity.TopicTopEntity;
|
||||
import io.linfeng.modules.app.service.TopicTopService;
|
||||
|
||||
|
||||
@Service("topicTopService")
|
||||
public class TopicTopServiceImpl extends ServiceImpl<TopicTopDao, TopicTopEntity> implements TopicTopService {
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<TopicTopEntity> page = this.page(
|
||||
new Query<TopicTopEntity>().getPage(params),
|
||||
new QueryWrapper<>()
|
||||
);
|
||||
|
||||
return new PageUtils(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TopicTopEntity> findByTopicId(Integer topicId) {
|
||||
LambdaQueryWrapper<TopicTopEntity> lambdaQueryWrapper = Wrappers.lambdaQuery();
|
||||
lambdaQueryWrapper.eq(TopicTopEntity::getTopicId, topicId);
|
||||
return baseMapper.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
}
|
@ -1,19 +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="io.linfeng.modules.admin.dao.DiscussDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.admin.entity.DiscussEntity" id="discussMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="uid" column="uid"/>
|
||||
<result property="topicId" column="topic_id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="introduce" column="introduce"/>
|
||||
<result property="readCount" column="read_count"/>
|
||||
<result property="topType" column="top_type"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,20 +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="io.linfeng.modules.admin.dao.MessageDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.admin.entity.MessageEntity" id="messageMap">
|
||||
<result property="mId" column="m_id"/>
|
||||
<result property="fromUid" column="from_uid"/>
|
||||
<result property="toUid" column="to_uid"/>
|
||||
<result property="postId" column="post_id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,15 +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="io.linfeng.modules.admin.dao.SensitiveDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.admin.entity.SensitiveEntity" id="sensitiveMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="sensitiveWord" column="sensitive_word"/>
|
||||
<result property="state" column="state"/>
|
||||
<result property="handleMeasures" column="handle_measures"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,23 +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="io.linfeng.modules.admin.dao.TopicDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.admin.entity.TopicEntity" id="topicMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="uid" column="uid"/>
|
||||
<result property="cateId" column="cate_id"/>
|
||||
<result property="topicName" column="topic_name"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="coverImage" column="cover_image"/>
|
||||
<result property="bgImage" column="bg_image"/>
|
||||
<result property="topType" column="top_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="indexRecommend" column="index_recommend"/>
|
||||
<result property="userNum" column="user_num"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,26 +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="io.linfeng.modules.app.dao.MomentDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.app.entity.MomentEntity" id="momentMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="textContent" column="text_content"/>
|
||||
<result property="activityId" column="activity_id"/>
|
||||
<result property="likeCount" column="like_count"/>
|
||||
<result property="commentCount" column="comment_count"/>
|
||||
<result property="repostCount" column="repost_count"/>
|
||||
<result property="shareCount" column="share_count"/>
|
||||
<result property="viewCount" column="view_count"/>
|
||||
<result property="repostMomentId" column="repost_moment_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="artistId" column="artist_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,15 +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="io.linfeng.modules.app.dao.TopicAdminDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.app.entity.TopicAdminEntity" id="topicAdminMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="topicId" column="topic_id"/>
|
||||
<result property="uid" column="uid"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,15 +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="io.linfeng.modules.app.dao.TopicTopDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="io.linfeng.modules.app.entity.TopicTopEntity" id="topicTopMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="topicId" column="topic_id"/>
|
||||
<result property="postId" column="post_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
@ -11,13 +11,7 @@
|
||||
<!-- 分类 -->
|
||||
<view @click="chooseClass" class="choose-item">
|
||||
<u-icon class="icon add-icon" name="file-text-fill" color="#999" size="40"></u-icon>
|
||||
<text class="txt">{{ cateName || '选择分类' }}</text>
|
||||
<u-icon class="u-icon" name="arrow-right"></u-icon>
|
||||
</view>
|
||||
<!-- 所在位置 -->
|
||||
<view @click="chooseLocation" class="choose-item">
|
||||
<u-icon class="icon add-icon" name="map" color="#999" size="40"></u-icon>
|
||||
<text class="txt">{{ form.address || '所在位置' }}</text>
|
||||
<text class="txt">{{ cateName || '选择帖子分类' }}</text>
|
||||
<u-icon class="u-icon" name="arrow-right"></u-icon>
|
||||
</view>
|
||||
<view class="button-style">
|
||||
@ -56,8 +50,7 @@
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.form.longitude = location.longitude;
|
||||
this.form.latitude = location.latitude;
|
||||
|
||||
},
|
||||
methods: {
|
||||
chooseClass() {
|
||||
@ -82,16 +75,7 @@
|
||||
});
|
||||
this.$refs.uUpload.upload();
|
||||
},
|
||||
chooseLocation() {
|
||||
let that = this;
|
||||
uni.chooseLocation({
|
||||
success: function(res) {
|
||||
that.form.address = res.name;
|
||||
that.form.latitude = res.latitude;
|
||||
that.form.longitude = res.longitude;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
submit(e) {
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
|
@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<!-- <el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<!-- <el-button v-if="isAuth('admin:comment:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> -->
|
||||
<el-button v-if="isAuth('admin:comment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -83,7 +78,6 @@
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> -->
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -1,138 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="用户id" prop="uid">
|
||||
<el-input v-model="dataForm.uid" placeholder="用户id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="圈子id" prop="topicId">
|
||||
<el-input v-model="dataForm.topicId" placeholder="圈子id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="introduce">
|
||||
<el-input v-model="dataForm.introduce" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="浏览量" prop="readCount">
|
||||
<el-input v-model="dataForm.readCount" placeholder="浏览量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="推荐位置:0 不推荐 1 首页推荐" prop="topType">
|
||||
<el-input v-model="dataForm.topType" placeholder="推荐位置:0 不推荐 1 首页推荐"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
uid: '',
|
||||
topicId: '',
|
||||
title: '',
|
||||
introduce: '',
|
||||
readCount: '',
|
||||
topType: '',
|
||||
createTime: ''
|
||||
},
|
||||
dataRule: {
|
||||
uid: [
|
||||
{ required: true, message: '用户id不能为空', trigger: 'blur' }
|
||||
],
|
||||
topicId: [
|
||||
{ required: true, message: '圈子id不能为空', trigger: 'blur' }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: '标题不能为空', trigger: 'blur' }
|
||||
],
|
||||
introduce: [
|
||||
{ required: true, message: '描述不能为空', trigger: 'blur' }
|
||||
],
|
||||
readCount: [
|
||||
{ required: true, message: '浏览量不能为空', trigger: 'blur' }
|
||||
],
|
||||
topType: [
|
||||
{ required: true, message: '推荐位置:0 不推荐 1 首页推荐不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/admin/discuss/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.uid = data.discuss.uid
|
||||
this.dataForm.topicId = data.discuss.topicId
|
||||
this.dataForm.title = data.discuss.title
|
||||
this.dataForm.introduce = data.discuss.introduce
|
||||
this.dataForm.readCount = data.discuss.readCount
|
||||
this.dataForm.topType = data.discuss.topType
|
||||
this.dataForm.createTime = data.discuss.createTime
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/admin/discuss/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'uid': this.dataForm.uid,
|
||||
'topicId': this.dataForm.topicId,
|
||||
'title': this.dataForm.title,
|
||||
'introduce': this.dataForm.introduce,
|
||||
'readCount': this.dataForm.readCount,
|
||||
'topType': this.dataForm.topType,
|
||||
'createTime': this.dataForm.createTime
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,199 +0,0 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<!-- <el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<!-- <el-button v-if="isAuth('admin:discuss:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> -->
|
||||
<el-button v-if="isAuth('admin:discuss:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="话题标签id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="uid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="用户id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="topicId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="圈子id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="标题">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="introduce"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="readCount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="浏览量">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="topType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="推荐位置:0 不推荐 1 首页推荐">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> -->
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './discuss-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/admin/discuss/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/admin/discuss/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -7,12 +7,6 @@
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="标题"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="路径" prop="url">
|
||||
<el-input v-model="dataForm.url" placeholder="路径"></el-input>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="图片" prop="img">
|
||||
<el-input v-model="dataForm.img" placeholder="图片"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="图片" prop="coverImage">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
@ -29,12 +23,6 @@
|
||||
</el-upload>
|
||||
<p class="formInfo">建议尺寸:500*250像素,jpg、png图片类型</p>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="3圈子页轮播图" prop="type">
|
||||
<el-input v-model="dataForm.type" placeholder="3圈子页轮播图"></el-input>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
|
@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<!-- <el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<el-button v-if="isAuth('admin:link:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('admin:link:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
@ -34,12 +30,6 @@
|
||||
align="center"
|
||||
label="标题">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="url"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="路径">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="img"
|
||||
header-align="center"
|
||||
@ -49,12 +39,6 @@
|
||||
<img style="width: 40px; height: 40px" :src="scope.row.img" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="type"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="3圈子页轮播图">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
|
@ -1,130 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.mId ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<!-- <el-form-item label="发送者uid" prop="fromUid">
|
||||
<el-input v-model="dataForm.fromUid" placeholder="发送者uid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="接收者uid" prop="toUid">
|
||||
<el-input v-model="dataForm.toUid" placeholder="接收者uid"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="帖子id" prop="postId">
|
||||
<el-input v-model="dataForm.postId" placeholder="帖子id"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="推送标题" prop="title">
|
||||
<el-input v-model="dataForm.title" placeholder="推送标题"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="消息内容" prop="content">
|
||||
<el-input v-model="dataForm.content" placeholder="消息内容"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="0未读,1已读" prop="status">
|
||||
<el-input v-model="dataForm.status" placeholder="0未读,1已读"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="1为点赞,2为评论 3为收藏 4为关注 5为推送文章 6私聊" prop="type">
|
||||
<el-input v-model="dataForm.type" placeholder="1为点赞,2为评论 3为收藏 4为关注 5为推送文章 6私聊"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
mId: 0,
|
||||
fromUid: 0,
|
||||
toUid: 0,
|
||||
postId: 0,
|
||||
title: '',
|
||||
content: '',
|
||||
status: 0,
|
||||
type: 5,
|
||||
createTime: ''
|
||||
},
|
||||
dataRule: {
|
||||
title: [
|
||||
{ required: true, message: '推送标题不能为空', trigger: 'blur' }
|
||||
],
|
||||
content: [
|
||||
{ required: true, message: '消息内容不能为空', trigger: 'blur' }
|
||||
],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.mId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.mId) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/admin/message/info/${this.dataForm.mId}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.fromUid = data.message.fromUid
|
||||
this.dataForm.toUid = data.message.toUid
|
||||
this.dataForm.postId = data.message.postId
|
||||
this.dataForm.title = data.message.title
|
||||
this.dataForm.content = data.message.content
|
||||
this.dataForm.status = data.message.status
|
||||
this.dataForm.type = data.message.type
|
||||
this.dataForm.createTime = data.message.createTime
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/admin/message/${!this.dataForm.mId ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'mId': this.dataForm.mId || undefined,
|
||||
'fromUid': this.dataForm.fromUid,
|
||||
'toUid': this.dataForm.toUid,
|
||||
'postId': this.dataForm.postId,
|
||||
'title': this.dataForm.title,
|
||||
'content': this.dataForm.content,
|
||||
'status': this.dataForm.status,
|
||||
'type': this.dataForm.type,
|
||||
'createTime': this.dataForm.createTime
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,278 +0,0 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<!-- <el-form-item>
|
||||
<el-input
|
||||
v-model="dataForm.key"
|
||||
placeholder="参数名"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<!-- <el-button
|
||||
v-if="isAuth('admin:message:save')"
|
||||
type="primary"
|
||||
@click="addOrUpdateHandle()"
|
||||
>发布公告</el-button
|
||||
> -->
|
||||
<el-button
|
||||
v-if="isAuth('admin:message:delete')"
|
||||
type="danger"
|
||||
@click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
>批量删除</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="mid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="消息id"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fromUid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="发送者uid"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="toUid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="接收者uid"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="postId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="帖子id"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="title"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="推送标题"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="content"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="消息内容"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="是否已读"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.status == 0" type="success">未读</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 1" type="danger"
|
||||
>已读</el-tag
|
||||
>
|
||||
<el-tag v-else type="danger">圈子推荐</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="消息类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.type == 1" type="success">点赞</el-tag>
|
||||
<el-tag v-else-if="scope.row.type == 2" type="warning">评论</el-tag>
|
||||
<el-tag v-else-if="scope.row.type == 3" type="info">收藏</el-tag>
|
||||
<el-tag v-else-if="scope.row.type == 4" type="danger">关注</el-tag>
|
||||
<el-tag v-else-if="scope.row.type == 5" type="danger"
|
||||
>推送文章</el-tag
|
||||
>
|
||||
<el-tag v-else type="danger">私聊</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row.mid)"
|
||||
>修改</el-button
|
||||
> -->
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.mid)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./message-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: "",
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
activated() {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/admin/message/list"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key,
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list;
|
||||
this.totalPage = data.page.totalCount;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map((item) => {
|
||||
return item.mid;
|
||||
});
|
||||
this.$confirm(
|
||||
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/admin/message/delete"),
|
||||
method: "post",
|
||||
data: this.$http.adornData(ids, false),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -1,138 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="敏感词库" prop="sensitiveWord">
|
||||
<el-input
|
||||
v-model="dataForm.sensitiveWord"
|
||||
placeholder="敏感词库"
|
||||
></el-input>
|
||||
<p class="formInfo">敏感词请用英文逗号","隔开</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启" prop="state">
|
||||
<el-radio-group v-model="dataForm.state">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="处理措施" prop="handleMeasures">
|
||||
<el-radio-group v-model="dataForm.handleMeasures">
|
||||
<el-radio :label="1">禁止发布</el-radio>
|
||||
<el-radio :label="2">需要审核</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
sensitiveWord: "",
|
||||
state: "",
|
||||
handleMeasures: "",
|
||||
},
|
||||
dataRule: {
|
||||
sensitiveWord: [
|
||||
{ required: true, message: "敏感词库不能为空", trigger: "blur" },
|
||||
],
|
||||
state: [
|
||||
{
|
||||
required: true,
|
||||
message: "是否开启 1-是 0-否不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
handleMeasures: [
|
||||
{
|
||||
required: true,
|
||||
message: "处理措施 1-禁止发布 2-需审核不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`/admin/sensitive/info/${this.dataForm.id}`
|
||||
),
|
||||
method: "get",
|
||||
params: this.$http.adornParams(),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.sensitiveWord = data.sensitive.sensitiveWord;
|
||||
this.dataForm.state = data.sensitive.state;
|
||||
this.dataForm.handleMeasures = data.sensitive.handleMeasures;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`/admin/sensitive/${!this.dataForm.id ? "save" : "update"}`
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: this.dataForm.id || undefined,
|
||||
sensitiveWord: this.dataForm.sensitiveWord,
|
||||
state: this.dataForm.state,
|
||||
handleMeasures: this.dataForm.handleMeasures,
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.formInfo {
|
||||
line-height: 0px;
|
||||
color: #f14a4a;
|
||||
}
|
||||
|
||||
</style>
|
@ -1,180 +0,0 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<!-- <el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="主键">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="sensitiveWord"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="敏感词库">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="state"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="是否开启">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.state == 1" type="success">是</el-tag>
|
||||
<el-tag v-else type="danger">否</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="handleMeasures"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="处理措施">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.state == 2" type="warning">需要审核</el-tag>
|
||||
<el-tag v-else type="danger">禁止发布</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<!-- <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination> -->
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './sensitive-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/admin/sensitive/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/admin/sensitive/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,279 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="创建用户id" prop="uid">
|
||||
<el-input v-model="dataForm.uid" placeholder="创建用户id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类id" prop="cateId">
|
||||
<el-input v-model="dataForm.cateId" placeholder="分类id"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="圈子名称" prop="topicName">
|
||||
<el-input
|
||||
v-model="dataForm.topicName"
|
||||
placeholder="圈子名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="description">
|
||||
<el-input v-model="dataForm.description" placeholder="描述"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="logo" prop="coverImage">
|
||||
<el-input v-model="dataForm.coverImage" placeholder="logo"></el-input>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="背景图" prop="bgImage">
|
||||
<el-input v-model="dataForm.bgImage" placeholder="背景图"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="背景图" prop="bgImage">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleBgImageSuccess"
|
||||
>
|
||||
<img v-if="dataForm.bgImage" :src="dataForm.bgImage" class="avatar" />
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||
</el-upload>
|
||||
<p class="formInfo">建议尺寸:400*300像素,jpg、png图片类型</p>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="圈子头像" prop="coverImage">
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleLogoSuccess"
|
||||
>
|
||||
<img v-if="dataForm.coverImage" :src="dataForm.coverImage" class="avatar" />
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon" />
|
||||
</el-upload>
|
||||
<p class="formInfo">建议尺寸:100*100像素,jpg、png图片类型</p>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="推荐类型" prop="topType">
|
||||
<el-radio-group v-model="dataForm.topType">
|
||||
<el-radio :label="1">首页推荐</el-radio>
|
||||
<el-radio :label="0">不推荐</el-radio>
|
||||
<el-radio :label="2">圈子页推荐</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="圈子状态" prop="status">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio :label="0">正常</el-radio>
|
||||
<el-radio :label="1">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="是否首页推荐圈子内容" prop="indexRecommend">
|
||||
<el-input
|
||||
v-model="dataForm.indexRecommend"
|
||||
placeholder="是否首页推荐圈子内容"
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="加入人数" prop="userNum">
|
||||
<el-input v-model="dataForm.userNum" placeholder="加入人数"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="创建时间" prop="createTime">
|
||||
<el-input
|
||||
v-model="dataForm.createTime"
|
||||
placeholder="创建时间"
|
||||
></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
url: "",
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: 0,
|
||||
uid: "",
|
||||
cateId: "",
|
||||
topicName: "",
|
||||
description: "",
|
||||
coverImage: "",
|
||||
bgImage: "",
|
||||
topType: 0,
|
||||
status: 1,
|
||||
indexRecommend: 1,
|
||||
userNum: 0,
|
||||
createTime: "",
|
||||
},
|
||||
dataRule: {
|
||||
uid: [
|
||||
{ required: true, message: "创建用户id不能为空", trigger: "blur" },
|
||||
],
|
||||
cateId: [
|
||||
{ required: true, message: "分类id不能为空", trigger: "blur" },
|
||||
],
|
||||
topicName: [
|
||||
{ required: true, message: "圈子名称不能为空", trigger: "blur" },
|
||||
],
|
||||
description: [
|
||||
{ required: true, message: "描述不能为空", trigger: "blur" },
|
||||
],
|
||||
coverImage: [
|
||||
{ required: true, message: "logo不能为空", trigger: "blur" },
|
||||
],
|
||||
bgImage: [
|
||||
{ required: true, message: "背景图不能为空", trigger: "blur" },
|
||||
],
|
||||
topType: [
|
||||
{
|
||||
required: true,
|
||||
message: "推荐类型不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
message: "圈子状态不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
// indexRecommend: [
|
||||
// {
|
||||
// required: true,
|
||||
// message: "是否首页推荐圈子内容不能为空",
|
||||
// trigger: "blur",
|
||||
// },
|
||||
// ],
|
||||
// userNum: [
|
||||
// { required: true, message: "加入人数不能为空", trigger: "blur" },
|
||||
// ],
|
||||
// createTime: [
|
||||
// { required: true, message: "创建时间不能为空", trigger: "blur" },
|
||||
// ],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.url = this.$http.adornUrl(
|
||||
`/sys/oss/upload?token=${this.$cookie.get("token")}`
|
||||
);
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["dataForm"].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/admin/topic/info/${this.dataForm.id}`),
|
||||
method: "get",
|
||||
params: this.$http.adornParams(),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.uid = data.topic.uid;
|
||||
this.dataForm.cateId = data.topic.cateId;
|
||||
this.dataForm.topicName = data.topic.topicName;
|
||||
this.dataForm.description = data.topic.description;
|
||||
this.dataForm.coverImage = data.topic.coverImage;
|
||||
this.dataForm.bgImage = data.topic.bgImage;
|
||||
this.dataForm.topType = data.topic.topType;
|
||||
this.dataForm.status = data.topic.status;
|
||||
this.dataForm.indexRecommend = data.topic.indexRecommend;
|
||||
this.dataForm.userNum = data.topic.userNum;
|
||||
this.dataForm.createTime = data.topic.createTime;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`/admin/topic/${!this.dataForm.id ? "save" : "update"}`
|
||||
),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: this.dataForm.id || undefined,
|
||||
uid: this.dataForm.uid,
|
||||
cateId: this.dataForm.cateId,
|
||||
topicName: this.dataForm.topicName,
|
||||
description: this.dataForm.description,
|
||||
coverImage: this.dataForm.coverImage,
|
||||
bgImage: this.dataForm.bgImage,
|
||||
topType: this.dataForm.topType,
|
||||
status: this.dataForm.status,
|
||||
indexRecommend: this.dataForm.indexRecommend,
|
||||
userNum: this.dataForm.userNum,
|
||||
createTime: this.dataForm.createTime,
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleBgImageSuccess(response) {
|
||||
this.dataForm.bgImage = response.url;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
handleLogoSuccess(response) {
|
||||
this.dataForm.coverImage = response.url;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.formInfo {
|
||||
line-height: 0px;
|
||||
color: #999999;
|
||||
}
|
||||
.avatar-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.avatar-uploader .el-upload:hover {
|
||||
border-color: #409eff;
|
||||
}
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
.avatar {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
@ -1,303 +0,0 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item>
|
||||
<!-- <el-input
|
||||
v-model="dataForm.key"
|
||||
placeholder="参数名"
|
||||
clearable
|
||||
></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="getDataList()">查询</el-button> -->
|
||||
<!-- <el-button
|
||||
v-if="isAuth('admin:topic:save')"
|
||||
type="primary"
|
||||
@click="addOrUpdateHandle()"
|
||||
>新增</el-button> -->
|
||||
<el-button
|
||||
v-if="isAuth('admin:topic:delete')"
|
||||
type="danger"
|
||||
@click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0"
|
||||
>批量删除</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="圈子id"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="uid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建用户id"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="cateId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分类id"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="topicName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="圈子名称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="description"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="描述"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="coverImage"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="100"
|
||||
label="圈子头像"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img style="width: 40px; height: 40px" :src="scope.row.coverImage" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="bgImage"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="100"
|
||||
label="背景图"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img style="width: 80px; height: 50px" :src="scope.row.bgImage" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="topType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="推荐类型"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.topType == 1" type="success"
|
||||
>首页推荐</el-tag
|
||||
>
|
||||
<el-tag v-else-if="scope.row.topType == 2" type="warning"
|
||||
>未知</el-tag
|
||||
>
|
||||
<el-tag v-else type="danger">圈子推荐</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="status"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="圈子状态"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.status == 0" type="success">正常</el-tag>
|
||||
<el-tag v-else type="danger">禁用</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="indexRecommend"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="首页推荐"
|
||||
>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="userNum"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="加入人数"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="170"
|
||||
label="创建时间"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row.id)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="deleteHandle(scope.row.id)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./topic-add-or-update";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: "",
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
activated() {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/admin/topic/list"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key,
|
||||
}),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list;
|
||||
this.totalPage = data.page.totalCount;
|
||||
} else {
|
||||
this.dataList = [];
|
||||
this.totalPage = 0;
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map((item) => {
|
||||
return item.id;
|
||||
});
|
||||
this.$confirm(
|
||||
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}
|
||||
).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/admin/topic/delete"),
|
||||
method: "post",
|
||||
data: this.$http.adornData(ids, false),
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user