Browse Source

话题相关代码

dev
wangchao 5 years ago
parent
commit
b52b1e5305
  1. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml
  2. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  3. 96
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java
  4. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiCommentFormDTO.java
  5. 10
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java
  6. 33
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java
  7. 66
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java
  8. 95
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicAttachmentService.java
  9. 104
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicAttachmentServiceImpl.java
  10. 22
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml
  11. 4
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml
  12. 22
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml
  13. 15
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicOperationDao.xml

2
epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml

@ -4,6 +4,8 @@ server:
context-path: /oss
spring:
main:
allow-bean-definition-overriding: true
application:
name: epmet-oss-server
#环境 dev|test|prod

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -0,0 +1,10 @@
package com.epmet.resi.group.constant;
/**
* @Description
* @IntefaceName TopicConstant
* @Author wangc
* @date 2020.03.31 17:18
*/
public interface TopicConstant {
}

96
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java

@ -0,0 +1,96 @@
/**
* 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.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-31
*/
@Data
public class ResiTopicAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 话题Id关联resi_topic的id
*/
private String topicId;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - figure 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiCommentFormDTO.java

@ -0,0 +1,10 @@
package com.epmet.resi.group.dto.topic.form;
/**
* @Description
* @ClassName ResiCommentFormDTO
* @Author wangc
* @date 2020.03.31 17:32
*/
public class ResiCommentFormDTO {
}

10
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java

@ -0,0 +1,10 @@
package com.epmet.resi.group.dto.topic.result;
/**
* @Description
* @ClassName ResiTopicInfoResultDTO
* @Author wangc
* @date 2020.04.01 08:46
*/
public class ResiTopicInfoResultDTO {
}

33
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiTopicAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-31
*/
@Mapper
public interface ResiTopicAttachmentDao extends BaseDao<ResiTopicAttachmentEntity> {
}

66
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java

@ -0,0 +1,66 @@
/**
* 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.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("resi_topic_attachment")
public class ResiTopicAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 话题Id关联resi_topic的id
*/
private String topicId;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - figure 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
}

95
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicAttachmentService.java

@ -0,0 +1,95 @@
/**
* 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.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ResiTopicAttachmentDTO;
import com.epmet.entity.ResiTopicAttachmentEntity;
import java.util.List;
import java.util.Map;
/**
* 话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-31
*/
public interface ResiTopicAttachmentService extends BaseService<ResiTopicAttachmentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ResiTopicAttachmentDTO>
* @author generator
* @date 2020-03-31
*/
PageData<ResiTopicAttachmentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ResiTopicAttachmentDTO>
* @author generator
* @date 2020-03-31
*/
List<ResiTopicAttachmentDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ResiTopicAttachmentDTO
* @author generator
* @date 2020-03-31
*/
ResiTopicAttachmentDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-03-31
*/
void save(ResiTopicAttachmentDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-03-31
*/
void update(ResiTopicAttachmentDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-03-31
*/
void delete(String[] ids);
}

104
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicAttachmentServiceImpl.java

@ -0,0 +1,104 @@
/**
* 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.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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.ResiTopicAttachmentDao;
import com.epmet.dto.ResiTopicAttachmentDTO;
import com.epmet.entity.ResiTopicAttachmentEntity;
import com.epmet.redis.ResiTopicAttachmentRedis;
import com.epmet.service.ResiTopicAttachmentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
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 2020-03-31
*/
@Service
public class ResiTopicAttachmentServiceImpl extends BaseServiceImpl<ResiTopicAttachmentDao, ResiTopicAttachmentEntity> implements ResiTopicAttachmentService {
@Autowired
private ResiTopicAttachmentRedis resiTopicAttachmentRedis;
@Override
public PageData<ResiTopicAttachmentDTO> page(Map<String, Object> params) {
IPage<ResiTopicAttachmentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ResiTopicAttachmentDTO.class);
}
@Override
public List<ResiTopicAttachmentDTO> list(Map<String, Object> params) {
List<ResiTopicAttachmentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ResiTopicAttachmentDTO.class);
}
private QueryWrapper<ResiTopicAttachmentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ResiTopicAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ResiTopicAttachmentDTO get(String id) {
ResiTopicAttachmentEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ResiTopicAttachmentDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ResiTopicAttachmentDTO dto) {
ResiTopicAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicAttachmentEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ResiTopicAttachmentDTO dto) {
ResiTopicAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ResiTopicAttachmentEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

22
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml

@ -0,0 +1,22 @@
<?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.dao.ResiTopicAttachmentDao">
<resultMap type="com.epmet.entity.ResiTopicAttachmentEntity" id="resiTopicAttachmentMap">
<result property="id" column="ID"/>
<result property="topicId" column="TOPIC_ID"/>
<result property="attachmentName" column="ATTACHMENT_NAME"/>
<result property="attachmentFormat" column="ATTACHMENT_FORMAT"/>
<result property="attachmentType" column="ATTACHMENT_TYPE"/>
<result property="attachmentUrl" column="ATTACHMENT_URL"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

4
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml

@ -1,9 +1,9 @@
<?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.dao.ResiTopicCommentDao">
<mapper namespace="com.epmet.modules.topic.dao.ResiTopicCommentDao">
</mapper>
</mapper>

22
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml

@ -1,26 +1,8 @@
<?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.dao.ResiTopicDao">
<mapper namespace="com.epmet.modules.topic.dao.ResiTopicDao">
<resultMap type="com.epmet.entity.ResiTopicEntity" id="resiTopicMap">
<result property="id" column="ID"/>
<result property="groupId" column="GROUP_ID"/>
<result property="topicContent" column="TOPIC_CONTENT"/>
<result property="status" column="STATUS"/>
<result property="province" column="PROVINCE"/>
<result property="city" column="CITY"/>
<result property="area" column="AREA"/>
<result property="address" column="ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="dimension" column="DIMENSION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
</mapper>

15
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicOperationDao.xml

@ -1,19 +1,8 @@
<?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.dao.ResiTopicOperationDao">
<mapper namespace="com.epmet.modules.topic.dao.ResiTopicOperationDao">
<resultMap type="com.epmet.entity.ResiTopicOperationEntity" id="resiTopicOperationMap">
<result property="id" column="ID"/>
<result property="topicId" column="TOPIC_ID"/>
<result property="operationType" column="OPERATION_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
</mapper>

Loading…
Cancel
Save