Browse Source
# Conflicts: # esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiIssueController.java # esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/IssueFeignClient.java # esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/IssueFeignClientFallback.java # esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/IssueService.java # esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/IssueServiceImpl.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/dao/EpdcEventsDao.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/EpdcEventsService.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/controller/EpdcAppIssueController.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/dao/IssueDao.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/events/EpdcEventsDao.xml # esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/issue/IssueDao.xmldev
54 changed files with 1457 additions and 132 deletions
@ -0,0 +1,25 @@ |
|||
package com.elink.esua.epdc.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 用户登录,获取token |
|||
* |
|||
* @author yujintao |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2019/9/9 10:48 |
|||
*/ |
|||
@Data |
|||
public class EpdcAppUserTokenFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5143037207300507252L; |
|||
|
|||
/** |
|||
* 微信code |
|||
*/ |
|||
@NotBlank(message = "微信code不能为空") |
|||
private String wxCode; |
|||
} |
|||
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 授权信息 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
* @since 1.0.0 |
|||
*/ |
|||
@Data |
|||
public class EpdcAppAuthorizationDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3908231797102233188L; |
|||
|
|||
/** |
|||
* 令牌 |
|||
*/ |
|||
private String token; |
|||
/** |
|||
* token超时时间,秒 |
|||
*/ |
|||
private Long expire; |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
/** |
|||
* 用户状态[AppUserStateEnum] |
|||
*/ |
|||
private String userState; |
|||
|
|||
} |
|||
@ -1,28 +0,0 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|||
import com.elink.esua.epdc.feign.fallback.SysDeptFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
/** |
|||
* 系统服务模块 |
|||
* @Author LC |
|||
* @Date 2019/9/8 16:00 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_ADMIN_SERVER, fallback = SysDeptFeignClientFallback.class) |
|||
public interface SysDeptFeignClient { |
|||
|
|||
/** |
|||
* 通过网格ID获取该网格所有上级机构 |
|||
* @Params: [gridId] |
|||
* @Return: com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CompleteDeptDTO> |
|||
* @Author: liuchuang |
|||
* @Date: 2019/9/8 16:11 |
|||
*/ |
|||
@GetMapping(value = "sys/dept/getCompleteDept/{gridId}") |
|||
Result<CompleteDeptDTO> getCompleteDept(@PathVariable("gridId") Long gridId); |
|||
} |
|||
@ -1,22 +0,0 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.CompleteDeptDTO; |
|||
import com.elink.esua.epdc.feign.SysDeptFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
/** |
|||
* @Author LC |
|||
* @Date 2019/9/8 16:00 |
|||
*/ |
|||
@Component |
|||
public class SysDeptFeignClientFallback implements SysDeptFeignClient { |
|||
|
|||
@Override |
|||
public Result<CompleteDeptDTO> getCompleteDept(@PathVariable("gridId") Long gridId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ADMIN_SERVER, "getCompleteDept", gridId); |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.dto.issue.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 议题分类统计表单DTO |
|||
* @Author LC |
|||
* @Date 2019/9/9 12:28 |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryStatisticsFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -6382725012003300283L; |
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
@NotBlank(message = "网格ID不能为空") |
|||
private Long gridId; |
|||
/** |
|||
* 议题类别ID |
|||
*/ |
|||
@NotBlank(message = "议题类别ID不能为空") |
|||
private String categoryId; |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.elink.esua.epdc.dto.issue.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 议题详情DTO |
|||
* @Author LC |
|||
* @Date 2019/9/9 11:11 |
|||
*/ |
|||
@Data |
|||
public class IssueDetailFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3193376894926069344L; |
|||
/** |
|||
* 议题ID |
|||
*/ |
|||
@NotBlank(message = "议题ID不能为空") |
|||
private String issueId; |
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
@NotBlank(message = "用户ID不能为空") |
|||
private String userId; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package com.elink.esua.epdc.dto.issue.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 议题分类统计DTO |
|||
* @Author LC |
|||
* @Date 2019/9/9 12:22 |
|||
*/ |
|||
@Data |
|||
public class IssueCategoryStatisticsResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 4793536739383889544L; |
|||
|
|||
/** |
|||
* 类别ID |
|||
*/ |
|||
private String categoryId; |
|||
/** |
|||
* 类别名称 |
|||
*/ |
|||
private String categoryName; |
|||
/** |
|||
* 议题个数 |
|||
*/ |
|||
private String caseNum; |
|||
/** |
|||
* 态度总数 |
|||
*/ |
|||
private String attitudeNum; |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
package com.elink.esua.epdc.dto.issue.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 议题处理进度DTO |
|||
* @Author LC |
|||
* @Date 2019/9/9 13:11 |
|||
*/ |
|||
@Data |
|||
public class IssueHandleProgressResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 2179111743827985376L; |
|||
|
|||
/** |
|||
* 处理状态 |
|||
*/ |
|||
private String stateName; |
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private String createdTime; |
|||
/** |
|||
* 处理描述 |
|||
*/ |
|||
private String advice; |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Data |
|||
public class NewsUserAttitudeDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 新闻ID |
|||
*/ |
|||
private String epdcNewsId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户点赞点踩标识 0:点赞,1:踩 |
|||
*/ |
|||
private String attitudeFlag; |
|||
|
|||
/** |
|||
* 删除标识 0:未删除,1:删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.dto.enums; |
|||
|
|||
/** |
|||
* 用户审核状态枚举 |
|||
* |
|||
* @author yujintao |
|||
* @email yujintao@elink-cn.com |
|||
* @date 2019/9/7 10:50 |
|||
*/ |
|||
public enum AppNewsLikeEnum { |
|||
|
|||
/** |
|||
* 0-点赞 |
|||
*/ |
|||
LIKE("0"), |
|||
/** |
|||
* 1-踩 |
|||
*/ |
|||
UNLIKE("1"); |
|||
|
|||
private String value; |
|||
|
|||
AppNewsLikeEnum(String value) { |
|||
this.value = value; |
|||
} |
|||
|
|||
public String value() { |
|||
return value; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,94 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.commons.tools.validator.AssertUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; |
|||
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; |
|||
import com.elink.esua.epdc.dto.NewsUserAttitudeDTO; |
|||
import com.elink.esua.epdc.excel.NewsUserAttitudeExcel; |
|||
import com.elink.esua.epdc.service.NewsUserAttitudeService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("newsuserattitude") |
|||
public class NewsUserAttitudeController { |
|||
|
|||
@Autowired |
|||
private NewsUserAttitudeService newsUserAttitudeService; |
|||
|
|||
@GetMapping("page") |
|||
public Result<PageData<NewsUserAttitudeDTO>> page(@RequestParam Map<String, Object> params){ |
|||
PageData<NewsUserAttitudeDTO> page = newsUserAttitudeService.page(params); |
|||
return new Result<PageData<NewsUserAttitudeDTO>>().ok(page); |
|||
} |
|||
|
|||
@GetMapping("{id}") |
|||
public Result<NewsUserAttitudeDTO> get(@PathVariable("id") String id){ |
|||
NewsUserAttitudeDTO data = newsUserAttitudeService.get(id); |
|||
return new Result<NewsUserAttitudeDTO>().ok(data); |
|||
} |
|||
|
|||
@PostMapping |
|||
public Result save(@RequestBody NewsUserAttitudeDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
newsUserAttitudeService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PutMapping |
|||
public Result update(@RequestBody NewsUserAttitudeDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
newsUserAttitudeService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@DeleteMapping |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
newsUserAttitudeService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
@GetMapping("export") |
|||
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception { |
|||
List<NewsUserAttitudeDTO> list = newsUserAttitudeService.list(params); |
|||
ExcelUtils.exportExcelToTarget(response, null, list, NewsUserAttitudeExcel.class); |
|||
} |
|||
|
|||
} |
|||
@ -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.elink.esua.epdc.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.entity.NewsUserAttitudeEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Mapper |
|||
public interface NewsUserAttitudeDao extends BaseDao<NewsUserAttitudeEntity> { |
|||
|
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("epdc_news_user_attitude") |
|||
public class NewsUserAttitudeEntity extends BaseEpdcEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 新闻ID |
|||
*/ |
|||
private String epdcNewsId; |
|||
|
|||
/** |
|||
* 用户ID |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 用户点赞点踩标识 0:点赞,1:踩 |
|||
*/ |
|||
private String attitudeFlag; |
|||
|
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.excel; |
|||
|
|||
import cn.afterturn.easypoi.excel.annotation.Excel; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Data |
|||
public class NewsUserAttitudeExcel { |
|||
|
|||
@Excel(name = "ID") |
|||
private String id; |
|||
|
|||
@Excel(name = "新闻ID") |
|||
private String epdcNewsId; |
|||
|
|||
@Excel(name = "用户ID") |
|||
private String userId; |
|||
|
|||
@Excel(name = "用户点赞点踩标识 0:点赞,1:踩") |
|||
private String attitudeFlag; |
|||
|
|||
@Excel(name = "删除标识 0:未删除,1:删除") |
|||
private String delFlag; |
|||
|
|||
@Excel(name = "乐观锁") |
|||
private Integer revision; |
|||
|
|||
@Excel(name = "创建人") |
|||
private String createdBy; |
|||
|
|||
@Excel(name = "创建时间") |
|||
private Date createdTime; |
|||
|
|||
@Excel(name = "更新人") |
|||
private String updatedBy; |
|||
|
|||
@Excel(name = "更新时间") |
|||
private Date updatedTime; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
/** |
|||
* 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.elink.esua.epdc.redis; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.redis.RedisUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Component |
|||
public class NewsUserAttitudeRedis { |
|||
@Autowired |
|||
private RedisUtils redisUtils; |
|||
|
|||
public void delete(Object[] ids) { |
|||
|
|||
} |
|||
|
|||
public void set(){ |
|||
|
|||
} |
|||
|
|||
public String get(String id){ |
|||
return null; |
|||
} |
|||
|
|||
} |
|||
@ -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.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.BaseService; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.dto.NewsUserAttitudeDTO; |
|||
import com.elink.esua.epdc.entity.NewsUserAttitudeEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 新闻点赞点踩表 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
public interface NewsUserAttitudeService extends BaseService<NewsUserAttitudeEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<NewsUserAttitudeDTO> |
|||
* @author |
|||
* @date |
|||
*/ |
|||
PageData<NewsUserAttitudeDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<NewsUserAttitudeDTO> |
|||
* @author |
|||
* @date |
|||
*/ |
|||
List<NewsUserAttitudeDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return NewsUserAttitudeDTO |
|||
* @author |
|||
* @date |
|||
*/ |
|||
NewsUserAttitudeDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author |
|||
* @date |
|||
*/ |
|||
void save(NewsUserAttitudeDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author |
|||
* @date |
|||
*/ |
|||
void update(NewsUserAttitudeDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author |
|||
* @date |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
|||
@ -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.elink.esua.epdc.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.page.PageData; |
|||
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|||
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|||
import com.elink.esua.epdc.dao.NewsUserAttitudeDao; |
|||
import com.elink.esua.epdc.dto.NewsUserAttitudeDTO; |
|||
import com.elink.esua.epdc.entity.NewsUserAttitudeEntity; |
|||
import com.elink.esua.epdc.redis.NewsUserAttitudeRedis; |
|||
import com.elink.esua.epdc.service.NewsUserAttitudeService; |
|||
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 qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-09-09 |
|||
*/ |
|||
@Service |
|||
public class NewsUserAttitudeServiceImpl extends BaseServiceImpl<NewsUserAttitudeDao, NewsUserAttitudeEntity> implements NewsUserAttitudeService { |
|||
|
|||
@Autowired |
|||
private NewsUserAttitudeRedis newsUserAttitudeRedis; |
|||
|
|||
@Override |
|||
public PageData<NewsUserAttitudeDTO> page(Map<String, Object> params) { |
|||
IPage<NewsUserAttitudeEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, NewsUserAttitudeDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<NewsUserAttitudeDTO> list(Map<String, Object> params) { |
|||
List<NewsUserAttitudeEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, NewsUserAttitudeDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<NewsUserAttitudeEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<NewsUserAttitudeEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public NewsUserAttitudeDTO get(String id) { |
|||
NewsUserAttitudeEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, NewsUserAttitudeDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(NewsUserAttitudeDTO dto) { |
|||
NewsUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, NewsUserAttitudeEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(NewsUserAttitudeDTO dto) { |
|||
NewsUserAttitudeEntity entity = ConvertUtils.sourceToTarget(dto, NewsUserAttitudeEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<?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.elink.esua.epdc.dao.NewsUserAttitudeDao"> |
|||
|
|||
<resultMap type="com.elink.esua.epdc.entity.NewsUserAttitudeEntity" id="newsUserAttitudeMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="epdcNewsId" column="EPDC_NEWS_ID"/> |
|||
<result property="userId" column="USER_ID"/> |
|||
<result property="attitudeFlag" column="ATTITUDE_FLAG"/> |
|||
<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> |
|||
Loading…
Reference in new issue