33 changed files with 2049 additions and 15 deletions
@ -0,0 +1,126 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.resi.group.dto.act; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
public class ActCommentAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 活动Id[group_act_info.id] |
|||
*/ |
|||
private String groupActId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String actCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.epmet.resi.group.dto.group.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 话题、通知、活动评论附件 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class CommentFileDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3930520724652521552L; |
|||
private String name; |
|||
private String url; |
|||
private String type; |
|||
private String format; |
|||
private Integer size; |
|||
private Integer duration; |
|||
@JsonIgnore |
|||
private String userId; |
|||
} |
@ -0,0 +1,126 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.resi.group.dto.notice; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
public class NoticeCommentAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 通知Id |
|||
*/ |
|||
private String noticeId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String noticeCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,126 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.resi.group.dto.topic; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
public class ResiTopicCommentAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String topicCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.act.controller; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.modules.act.service.ActCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("actcommentattachment") |
|||
public class ActCommentAttachmentController { |
|||
|
|||
@Autowired |
|||
private ActCommentAttachmentService actCommentAttachmentService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ActCommentAttachmentDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ActCommentAttachmentDTO> page = actCommentAttachmentService.page(params); |
|||
return new Result<PageData<ActCommentAttachmentDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ActCommentAttachmentDTO> get(@PathVariable("id") String id){ |
|||
ActCommentAttachmentDTO data = actCommentAttachmentService.get(id); |
|||
return new Result<ActCommentAttachmentDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ActCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
actCommentAttachmentService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ActCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
actCommentAttachmentService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
actCommentAttachmentService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.act.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.act.entity.ActCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Mapper |
|||
public interface ActCommentAttachmentDao extends BaseDao<ActCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> selectActComFile(@Param("groupActId") String groupActId); |
|||
|
|||
} |
@ -0,0 +1,93 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.act.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("act_comment_attachment") |
|||
public class ActCommentAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 活动Id[group_act_info.id] |
|||
*/ |
|||
private String groupActId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String actCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,103 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.act.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.modules.act.entity.ActCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
public interface ActCommentAttachmentService extends BaseService<ActCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ActCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
PageData<ActCommentAttachmentDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ActCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
List<ActCommentAttachmentDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ActCommentAttachmentDTO |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
ActCommentAttachmentDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void save(ActCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void update(ActCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询活动评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> getActComFile(String groupActId); |
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.act.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.modules.act.dao.ActCommentAttachmentDao; |
|||
import com.epmet.modules.act.entity.ActCommentAttachmentEntity; |
|||
import com.epmet.modules.act.service.ActCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.act.ActCommentAttachmentDTO; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 活动评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Service |
|||
public class ActCommentAttachmentServiceImpl extends BaseServiceImpl<ActCommentAttachmentDao, ActCommentAttachmentEntity> implements ActCommentAttachmentService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<ActCommentAttachmentDTO> page(Map<String, Object> params) { |
|||
IPage<ActCommentAttachmentEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ActCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ActCommentAttachmentDTO> list(Map<String, Object> params) { |
|||
List<ActCommentAttachmentEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ActCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ActCommentAttachmentEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ActCommentAttachmentEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ActCommentAttachmentDTO get(String id) { |
|||
ActCommentAttachmentEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ActCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ActCommentAttachmentDTO dto) { |
|||
ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ActCommentAttachmentDTO dto) { |
|||
ActCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ActCommentAttachmentEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
@Override |
|||
public List<CommentFileDTO> getActComFile(String groupActId) { |
|||
return baseDao.selectActComFile(groupActId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.notice.controller; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.modules.notice.service.NoticeCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("noticecommentattachment") |
|||
public class NoticeCommentAttachmentController { |
|||
|
|||
@Autowired |
|||
private NoticeCommentAttachmentService noticeCommentAttachmentService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<NoticeCommentAttachmentDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<NoticeCommentAttachmentDTO> page = noticeCommentAttachmentService.page(params); |
|||
return new Result<PageData<NoticeCommentAttachmentDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<NoticeCommentAttachmentDTO> get(@PathVariable("id") String id){ |
|||
NoticeCommentAttachmentDTO data = noticeCommentAttachmentService.get(id); |
|||
return new Result<NoticeCommentAttachmentDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody NoticeCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
noticeCommentAttachmentService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody NoticeCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
noticeCommentAttachmentService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
noticeCommentAttachmentService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.notice.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Mapper |
|||
public interface NoticeCommentAttachmentDao extends BaseDao<NoticeCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> selectNoticeComFile(@Param("noticeId") String noticeId); |
|||
|
|||
} |
@ -0,0 +1,93 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.notice.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("notice_comment_attachment") |
|||
public class NoticeCommentAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 通知Id |
|||
*/ |
|||
private String noticeId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String noticeCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,103 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.notice.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
public interface NoticeCommentAttachmentService extends BaseService<NoticeCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<NoticeCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
PageData<NoticeCommentAttachmentDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<NoticeCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
List<NoticeCommentAttachmentDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return NoticeCommentAttachmentDTO |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
NoticeCommentAttachmentDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void save(NoticeCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void update(NoticeCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> getNoticeComFile(String noticeId); |
|||
|
|||
} |
@ -0,0 +1,110 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.notice.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.modules.notice.dao.NoticeCommentAttachmentDao; |
|||
import com.epmet.modules.notice.entity.NoticeCommentAttachmentEntity; |
|||
import com.epmet.modules.notice.service.NoticeCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.epmet.resi.group.dto.notice.NoticeCommentAttachmentDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 通知评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Service |
|||
public class NoticeCommentAttachmentServiceImpl extends BaseServiceImpl<NoticeCommentAttachmentDao, NoticeCommentAttachmentEntity> implements NoticeCommentAttachmentService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<NoticeCommentAttachmentDTO> page(Map<String, Object> params) { |
|||
IPage<NoticeCommentAttachmentEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, NoticeCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<NoticeCommentAttachmentDTO> list(Map<String, Object> params) { |
|||
List<NoticeCommentAttachmentEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, NoticeCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<NoticeCommentAttachmentEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<NoticeCommentAttachmentEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public NoticeCommentAttachmentDTO get(String id) { |
|||
NoticeCommentAttachmentEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, NoticeCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(NoticeCommentAttachmentDTO dto) { |
|||
NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(NoticeCommentAttachmentDTO dto) { |
|||
NoticeCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, NoticeCommentAttachmentEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
@Override |
|||
public List<CommentFileDTO> getNoticeComFile(String noticeId) { |
|||
return baseDao.selectNoticeComFile(noticeId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,85 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.topic.controller; |
|||
|
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("resitopiccommentattachment") |
|||
public class ResiTopicCommentAttachmentController { |
|||
|
|||
@Autowired |
|||
private ResiTopicCommentAttachmentService resiTopicCommentAttachmentService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<ResiTopicCommentAttachmentDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<ResiTopicCommentAttachmentDTO> page = resiTopicCommentAttachmentService.page(params); |
|||
return new Result<PageData<ResiTopicCommentAttachmentDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<ResiTopicCommentAttachmentDTO> get(@PathVariable("id") String id){ |
|||
ResiTopicCommentAttachmentDTO data = resiTopicCommentAttachmentService.get(id); |
|||
return new Result<ResiTopicCommentAttachmentDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody ResiTopicCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
resiTopicCommentAttachmentService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody ResiTopicCommentAttachmentDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
resiTopicCommentAttachmentService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
resiTopicCommentAttachmentService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.topic.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Mapper |
|||
public interface ResiTopicCommentAttachmentDao extends BaseDao<ResiTopicCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> selectTopicComFile(@Param("topicId") String topicId); |
|||
|
|||
} |
@ -0,0 +1,93 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.topic.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("resi_topic_comment_attachment") |
|||
public class ResiTopicCommentAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 话题Id |
|||
*/ |
|||
private String topicId; |
|||
|
|||
/** |
|||
* 评论Id |
|||
*/ |
|||
private String topicCommentId; |
|||
|
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
|
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
|
|||
/** |
|||
* 文件大小,单位b |
|||
*/ |
|||
private Integer attachmentSize; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String attachmentFormat; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,102 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.topic.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
public interface ResiTopicCommentAttachmentService extends BaseService<ResiTopicCommentAttachmentEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<ResiTopicCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
PageData<ResiTopicCommentAttachmentDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<ResiTopicCommentAttachmentDTO> |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
List<ResiTopicCommentAttachmentDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return ResiTopicCommentAttachmentDTO |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
ResiTopicCommentAttachmentDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void save(ResiTopicCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void update(ResiTopicCommentAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2021-09-06 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询话题评论所有人员的附件信息 |
|||
**/ |
|||
List<CommentFileDTO> getTopicComFile(String topicId); |
|||
} |
@ -0,0 +1,110 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.modules.topic.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.modules.topic.dao.ResiTopicCommentAttachmentDao; |
|||
import com.epmet.modules.topic.entity.ResiTopicCommentAttachmentEntity; |
|||
import com.epmet.modules.topic.service.ResiTopicCommentAttachmentService; |
|||
import com.epmet.resi.group.dto.group.result.CommentFileDTO; |
|||
import com.epmet.resi.group.dto.topic.ResiTopicCommentAttachmentDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 话题评论附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-09-06 |
|||
*/ |
|||
@Service |
|||
public class ResiTopicCommentAttachmentServiceImpl extends BaseServiceImpl<ResiTopicCommentAttachmentDao, ResiTopicCommentAttachmentEntity> implements ResiTopicCommentAttachmentService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<ResiTopicCommentAttachmentDTO> page(Map<String, Object> params) { |
|||
IPage<ResiTopicCommentAttachmentEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, ResiTopicCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<ResiTopicCommentAttachmentDTO> list(Map<String, Object> params) { |
|||
List<ResiTopicCommentAttachmentEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, ResiTopicCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<ResiTopicCommentAttachmentEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<ResiTopicCommentAttachmentEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public ResiTopicCommentAttachmentDTO get(String id) { |
|||
ResiTopicCommentAttachmentEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, ResiTopicCommentAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(ResiTopicCommentAttachmentDTO dto) { |
|||
ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(ResiTopicCommentAttachmentDTO dto) { |
|||
ResiTopicCommentAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicCommentAttachmentEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询通知评论所有人员的附件信息 |
|||
**/ |
|||
@Override |
|||
public List<CommentFileDTO> getTopicComFile(String topicId) { |
|||
return baseDao.selectTopicComFile(topicId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.modules.act.dao.ActCommentAttachmentDao"> |
|||
|
|||
<select id="selectActComFile" resultType="com.epmet.resi.group.dto.group.result.CommentFileDTO"> |
|||
SELECT |
|||
file_name name, |
|||
attachment_size size, |
|||
attachment_format format, |
|||
attachment_type type, |
|||
attachment_url url, |
|||
sort sort, |
|||
duration duration, |
|||
created_by userId |
|||
FROM |
|||
act_comment_attachment |
|||
WHERE |
|||
del_flag = '0' |
|||
AND group_act_id = #{groupActId} |
|||
ORDER BY |
|||
created_by, sort ASC |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.modules.notice.dao.NoticeCommentAttachmentDao"> |
|||
|
|||
<select id="selectNoticeComFile" resultType="com.epmet.resi.group.dto.group.result.CommentFileDTO"> |
|||
SELECT |
|||
file_name name, |
|||
attachment_size size, |
|||
attachment_format format, |
|||
attachment_type type, |
|||
attachment_url url, |
|||
sort sort, |
|||
duration duration, |
|||
created_by userId |
|||
FROM |
|||
notice_comment_attachment |
|||
WHERE |
|||
del_flag = '0' |
|||
AND notice_id = #{noticeId} |
|||
ORDER BY |
|||
created_by, sort ASC<!-- 同一个人各类型文件靠在一起,按sort升序 --> |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,25 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.modules.topic.dao.ResiTopicCommentAttachmentDao"> |
|||
|
|||
<select id="selectTopicComFile" resultType="com.epmet.resi.group.dto.group.result.CommentFileDTO"> |
|||
SELECT |
|||
file_name name, |
|||
attachment_size size, |
|||
attachment_format format, |
|||
attachment_type type, |
|||
attachment_url url, |
|||
sort sort, |
|||
duration duration, |
|||
created_by userId |
|||
FROM |
|||
resi_topic_comment_attachment |
|||
WHERE |
|||
del_flag = '0' |
|||
AND topic_id = #{topicId} |
|||
ORDER BY |
|||
created_by, sort ASC |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue