Browse Source

议题分享生成文件添加

master
zxc 5 years ago
parent
commit
0133c8526b
  1. 97
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueShareLinkRecordDTO.java
  2. 96
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueShareLinkVisitRecordDTO.java
  3. 84
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkRecordController.java
  4. 67
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkVisitRecordController.java
  5. 33
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkRecordDao.java
  6. 33
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkVisitRecordDao.java
  7. 63
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueShareLinkRecordEntity.java
  8. 66
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueShareLinkVisitRecordEntity.java
  9. 95
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkRecordService.java
  10. 95
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkVisitRecordService.java
  11. 82
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java
  12. 99
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java
  13. 7
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkRecordDao.xml
  14. 7
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml

97
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueShareLinkRecordDTO.java

@ -0,0 +1,97 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 议题分享链接表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
@Data
public class IssueShareLinkRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 议题所属网格ID
*/
private String gridId;
/**
* 议题ID
*/
private String issueId;
/**
* 分享人当前用户id
*/
private String shareUserId;
/**
* 邀请内容
*/
private String inviteContent;
/**
* 删除状态 0正常1:删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

96
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueShareLinkVisitRecordDTO.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-12-18
*/
@Data
public class IssueShareLinkVisitRecordDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 分享人邀请人ID
*/
private String shareUserId;
/**
* 被邀请人ID
*/
private String inviteeUserId;
/**
* 议题分享链接表.id
*/
private String shareLinkRecId;
/**
* 是否邀请注册0:1:不是
*/
private Integer isInviteRegister;
/**
* 删除状态0:正常1删除
*/
private Integer delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

84
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkRecordController.java

@ -0,0 +1,84 @@
/**
* 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.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.dto.IssueShareLinkRecordDTO;
import com.epmet.service.IssueShareLinkRecordService;
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 2020-12-18
*/
@RestController
@RequestMapping("issuesharelinkrecord")
public class IssueShareLinkRecordController {
@Autowired
private IssueShareLinkRecordService issueShareLinkRecordService;
@GetMapping("page")
public Result<PageData<IssueShareLinkRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IssueShareLinkRecordDTO> page = issueShareLinkRecordService.page(params);
return new Result<PageData<IssueShareLinkRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueShareLinkRecordDTO> get(@PathVariable("id") String id){
IssueShareLinkRecordDTO data = issueShareLinkRecordService.get(id);
return new Result<IssueShareLinkRecordDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IssueShareLinkRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
issueShareLinkRecordService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IssueShareLinkRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
issueShareLinkRecordService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
issueShareLinkRecordService.delete(ids);
return new Result();
}
}

67
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueShareLinkVisitRecordController.java

@ -0,0 +1,67 @@
package com.epmet.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.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.service.IssueShareLinkVisitRecordService;
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 2020-12-18
*/
@RestController
@RequestMapping("issuesharelinkvisitrecord")
public class IssueShareLinkVisitRecordController {
@Autowired
private IssueShareLinkVisitRecordService issueShareLinkVisitRecordService;
@GetMapping("page")
public Result<PageData<IssueShareLinkVisitRecordDTO>> page(@RequestParam Map<String, Object> params){
PageData<IssueShareLinkVisitRecordDTO> page = issueShareLinkVisitRecordService.page(params);
return new Result<PageData<IssueShareLinkVisitRecordDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<IssueShareLinkVisitRecordDTO> get(@PathVariable("id") String id){
IssueShareLinkVisitRecordDTO data = issueShareLinkVisitRecordService.get(id);
return new Result<IssueShareLinkVisitRecordDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody IssueShareLinkVisitRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
issueShareLinkVisitRecordService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody IssueShareLinkVisitRecordDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
issueShareLinkVisitRecordService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
issueShareLinkVisitRecordService.delete(ids);
return new Result();
}
}

33
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkRecordDao.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.IssueShareLinkRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 议题分享链接表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
@Mapper
public interface IssueShareLinkRecordDao extends BaseDao<IssueShareLinkRecordEntity> {
}

33
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueShareLinkVisitRecordDao.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.IssueShareLinkVisitRecordEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 议题分享链接访问记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
@Mapper
public interface IssueShareLinkVisitRecordDao extends BaseDao<IssueShareLinkVisitRecordEntity> {
}

63
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueShareLinkRecordEntity.java

@ -0,0 +1,63 @@
/**
* 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;
/**
* 议题分享链接表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_share_link_record")
public class IssueShareLinkRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 议题所属网格ID
*/
private String gridId;
/**
* 议题ID
*/
private String issueId;
/**
* 分享人当前用户id
*/
private String shareUserId;
/**
* 邀请内容
*/
private String inviteContent;
}

66
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueShareLinkVisitRecordEntity.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-12-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_share_link_visit_record")
public class IssueShareLinkVisitRecordEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 分享人邀请人ID
*/
private String shareUserId;
/**
* 被邀请人ID
*/
private String inviteeUserId;
/**
* 议题分享链接表.id
*/
private String shareLinkRecId;
/**
* 是否邀请注册0:1:不是
*/
private Integer isInviteRegister;
}

95
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkRecordService.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.IssueShareLinkRecordDTO;
import com.epmet.entity.IssueShareLinkRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 议题分享链接表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
public interface IssueShareLinkRecordService extends BaseService<IssueShareLinkRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueShareLinkRecordDTO>
* @author generator
* @date 2020-12-18
*/
PageData<IssueShareLinkRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueShareLinkRecordDTO>
* @author generator
* @date 2020-12-18
*/
List<IssueShareLinkRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IssueShareLinkRecordDTO
* @author generator
* @date 2020-12-18
*/
IssueShareLinkRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-18
*/
void save(IssueShareLinkRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-18
*/
void update(IssueShareLinkRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-18
*/
void delete(String[] ids);
}

95
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueShareLinkVisitRecordService.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.IssueShareLinkVisitRecordDTO;
import com.epmet.entity.IssueShareLinkVisitRecordEntity;
import java.util.List;
import java.util.Map;
/**
* 议题分享链接访问记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-18
*/
public interface IssueShareLinkVisitRecordService extends BaseService<IssueShareLinkVisitRecordEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<IssueShareLinkVisitRecordDTO>
* @author generator
* @date 2020-12-18
*/
PageData<IssueShareLinkVisitRecordDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<IssueShareLinkVisitRecordDTO>
* @author generator
* @date 2020-12-18
*/
List<IssueShareLinkVisitRecordDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return IssueShareLinkVisitRecordDTO
* @author generator
* @date 2020-12-18
*/
IssueShareLinkVisitRecordDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-18
*/
void save(IssueShareLinkVisitRecordDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-18
*/
void update(IssueShareLinkVisitRecordDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-18
*/
void delete(String[] ids);
}

82
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkRecordServiceImpl.java

@ -0,0 +1,82 @@
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.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IssueShareLinkRecordDao;
import com.epmet.dto.IssueShareLinkRecordDTO;
import com.epmet.entity.IssueShareLinkRecordEntity;
import com.epmet.service.IssueShareLinkRecordService;
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 2020-12-18
*/
@Service
public class IssueShareLinkRecordServiceImpl extends BaseServiceImpl<IssueShareLinkRecordDao, IssueShareLinkRecordEntity> implements IssueShareLinkRecordService {
@Override
public PageData<IssueShareLinkRecordDTO> page(Map<String, Object> params) {
IPage<IssueShareLinkRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IssueShareLinkRecordDTO.class);
}
@Override
public List<IssueShareLinkRecordDTO> list(Map<String, Object> params) {
List<IssueShareLinkRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IssueShareLinkRecordDTO.class);
}
private QueryWrapper<IssueShareLinkRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IssueShareLinkRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IssueShareLinkRecordDTO get(String id) {
IssueShareLinkRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IssueShareLinkRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IssueShareLinkRecordDTO dto) {
IssueShareLinkRecordEntity entity = ConvertUtils.sourceToTarget(dto, IssueShareLinkRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IssueShareLinkRecordDTO dto) {
IssueShareLinkRecordEntity entity = ConvertUtils.sourceToTarget(dto, IssueShareLinkRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

99
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueShareLinkVisitRecordServiceImpl.java

@ -0,0 +1,99 @@
/**
* 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.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IssueShareLinkVisitRecordDao;
import com.epmet.dto.IssueShareLinkVisitRecordDTO;
import com.epmet.entity.IssueShareLinkVisitRecordEntity;
import com.epmet.service.IssueShareLinkVisitRecordService;
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 2020-12-18
*/
@Service
public class IssueShareLinkVisitRecordServiceImpl extends BaseServiceImpl<IssueShareLinkVisitRecordDao, IssueShareLinkVisitRecordEntity> implements IssueShareLinkVisitRecordService {
@Override
public PageData<IssueShareLinkVisitRecordDTO> page(Map<String, Object> params) {
IPage<IssueShareLinkVisitRecordEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, IssueShareLinkVisitRecordDTO.class);
}
@Override
public List<IssueShareLinkVisitRecordDTO> list(Map<String, Object> params) {
List<IssueShareLinkVisitRecordEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, IssueShareLinkVisitRecordDTO.class);
}
private QueryWrapper<IssueShareLinkVisitRecordEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IssueShareLinkVisitRecordEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IssueShareLinkVisitRecordDTO get(String id) {
IssueShareLinkVisitRecordEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, IssueShareLinkVisitRecordDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IssueShareLinkVisitRecordDTO dto) {
IssueShareLinkVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, IssueShareLinkVisitRecordEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IssueShareLinkVisitRecordDTO dto) {
IssueShareLinkVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, IssueShareLinkVisitRecordEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

7
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkRecordDao.xml

@ -0,0 +1,7 @@
<?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.IssueShareLinkRecordDao">
</mapper>

7
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml

@ -0,0 +1,7 @@
<?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.IssueShareLinkVisitRecordDao">
</mapper>
Loading…
Cancel
Save