29 changed files with 612 additions and 129 deletions
@ -0,0 +1,38 @@ |
|||||
|
package com.elink.esua.epdc.constant; |
||||
|
|
||||
|
/** |
||||
|
* @Description 爱心互助模块发送消息常量 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/2/7 20:14 |
||||
|
*/ |
||||
|
public interface HeartNoticeConstant { |
||||
|
/** |
||||
|
* 活动报名审核未通过 |
||||
|
*/ |
||||
|
String NOTICE_SIGN_UP_NOT_PASSED = "您报名的活动【审核未通过】"; |
||||
|
|
||||
|
/** |
||||
|
* 活动报名审核通过 |
||||
|
*/ |
||||
|
String NOTICE_SIGN_UP_PASSED = "您报名的活动【审核通过】"; |
||||
|
|
||||
|
/** |
||||
|
* 活动取消 |
||||
|
*/ |
||||
|
String NOTICE_CANCEL_ACT = "您报名的活动【已经取消】"; |
||||
|
|
||||
|
/** |
||||
|
* 消息所属业务类型:activity活动 |
||||
|
*/ |
||||
|
String NOTICE__BUSINESS_TYPE_ACTIVITY = "activity"; |
||||
|
|
||||
|
/** |
||||
|
* 我的消息类型:0审核通知 |
||||
|
*/ |
||||
|
String NOTICE_TYPE_AUDIT_NOTICE = "0"; |
||||
|
|
||||
|
/** |
||||
|
* 我的消息类型:1互动通知 |
||||
|
*/ |
||||
|
String NOTICE_TYPE_INTERACTIVE_NOTICE = "1"; |
||||
|
} |
||||
@ -0,0 +1,47 @@ |
|||||
|
package com.elink.esua.epdc.modules.async; |
||||
|
|
||||
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.NewsFeignClient; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.scheduling.annotation.Async; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 新闻通知消息模块 线程任务 |
||||
|
* |
||||
|
* @author yujintao |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/10 10:02 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class NewsTask { |
||||
|
|
||||
|
@Autowired |
||||
|
private NewsFeignClient newsFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* 给用户发送消息 |
||||
|
* |
||||
|
* @param informationDto |
||||
|
* @return void |
||||
|
* @author yujintao |
||||
|
* @date 2019/9/10 10:33 |
||||
|
*/ |
||||
|
@Async |
||||
|
public void insertUserInformation(EpdcInformationFormDTO informationDto) { |
||||
|
newsFeignClient.saveInformation(informationDto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @param epdcInformationFormDTOList |
||||
|
* @return void |
||||
|
* @Author yinzuomei |
||||
|
* @Description 批量给用户发消息 |
||||
|
* @Date 2020/2/7 21:01 |
||||
|
**/ |
||||
|
public void insertBatchUserInformation(List<EpdcInformationFormDTO> epdcInformationFormDTOList) { |
||||
|
newsFeignClient.saveInformationList(epdcInformationFormDTOList); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,43 @@ |
|||||
|
package com.elink.esua.epdc.modules.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.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.fallback.NewsFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 消息模块 |
||||
|
* |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:37 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class) |
||||
|
public interface NewsFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 给用户发消息 |
||||
|
* |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:40 |
||||
|
*/ |
||||
|
@PostMapping(value = "news/epdc-app/information/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
||||
|
Result saveInformation(@RequestBody EpdcInformationFormDTO formDto); |
||||
|
|
||||
|
/** |
||||
|
* @param epdcInformationFormDTOList |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @Author yinzuomei |
||||
|
* @Description 批量给用户发消息 |
||||
|
* @Date 2020/2/7 21:00 |
||||
|
**/ |
||||
|
@PostMapping(value = "news/epdc-app/information/saveList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
||||
|
Result saveInformationList(List<EpdcInformationFormDTO> epdcInformationFormDTOList); |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.elink.esua.epdc.modules.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.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.NewsFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:38 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class NewsFeignClientFallback implements NewsFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result saveInformation(EpdcInformationFormDTO formDto) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformation", formDto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Result saveInformationList(List<EpdcInformationFormDTO> epdcInformationFormDTOList) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformationList", epdcInformationFormDTOList); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,28 @@ |
|||||
|
package com.elink.esua.epdc.constant; |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分商城模块发送消息常量 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/2/7 20:14 |
||||
|
*/ |
||||
|
public interface PointsNoticeConstant { |
||||
|
/** |
||||
|
* 减积分 |
||||
|
*/ |
||||
|
String SUBTRACT_POINTS_NOTICE = "积分变更【扣减积分】-"; |
||||
|
|
||||
|
/** |
||||
|
* 加积分 |
||||
|
*/ |
||||
|
String ADD_POINTS_NOTICE = "积分变更【增加积分】+"; |
||||
|
|
||||
|
/** |
||||
|
* 消息所属业务类型:points积分商城 |
||||
|
*/ |
||||
|
String NOTICE__BUSINESS_TYPE_ACTIVITY = "points"; |
||||
|
|
||||
|
/** |
||||
|
* 我的消息类型:1互动通知 |
||||
|
*/ |
||||
|
String NOTICE_TYPE_INTERACTIVE_NOTICE = "1"; |
||||
|
} |
||||
@ -0,0 +1,34 @@ |
|||||
|
package com.elink.esua.epdc.modules.async; |
||||
|
|
||||
|
import com.elink.esua.epdc.dto.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.NewsFeignClient; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.scheduling.annotation.Async; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* 新闻通知消息模块 线程任务 |
||||
|
* |
||||
|
* @author yujintao |
||||
|
* @email yujintao@elink-cn.com |
||||
|
* @date 2019/9/10 10:02 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class NewsTask { |
||||
|
|
||||
|
@Autowired |
||||
|
private NewsFeignClient newsFeignClient; |
||||
|
|
||||
|
/** |
||||
|
* 给用户发送消息 |
||||
|
* |
||||
|
* @param informationDto |
||||
|
* @return void |
||||
|
* @author yujintao |
||||
|
* @date 2019/9/10 10:33 |
||||
|
*/ |
||||
|
@Async |
||||
|
public void insertUserInformation(EpdcInformationFormDTO informationDto) { |
||||
|
newsFeignClient.saveInformation(informationDto); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,31 @@ |
|||||
|
package com.elink.esua.epdc.modules.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.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.fallback.NewsFeignClientFallback; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.http.MediaType; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
/** |
||||
|
* 消息模块 |
||||
|
* |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:37 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.EPDC_NEWS_SERVER, fallback = NewsFeignClientFallback.class) |
||||
|
public interface NewsFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 给用户发消息 |
||||
|
* |
||||
|
* @param formDto |
||||
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:40 |
||||
|
*/ |
||||
|
@PostMapping(value = "news/epdc-app/information/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
||||
|
Result saveInformation(@RequestBody EpdcInformationFormDTO formDto); |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
package com.elink.esua.epdc.modules.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.epdc.form.EpdcInformationFormDTO; |
||||
|
import com.elink.esua.epdc.modules.feign.NewsFeignClient; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author work@yujt.net.cn |
||||
|
* @date 2019/9/18 15:38 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class NewsFeignClientFallback implements NewsFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result saveInformation(EpdcInformationFormDTO formDto) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.EPDC_NEWS_SERVER, "saveInformation", formDto); |
||||
|
} |
||||
|
} |
||||
@ -1,22 +0,0 @@ |
|||||
package com.elink.esua.epdc.constant; |
|
||||
|
|
||||
/** |
|
||||
* 志愿者审批结果 推送信息常量 |
|
||||
*/ |
|
||||
public interface VolunteerInfoConsant { |
|
||||
|
|
||||
/** |
|
||||
* 标题:志愿者审批被拉入黑名单 |
|
||||
*/ |
|
||||
String NOTICE_TITLE_VOLUNTEER_BLACKLIST = "您已被解除志愿者身份"; |
|
||||
|
|
||||
/** |
|
||||
* 标题:志愿者审批不通过 |
|
||||
*/ |
|
||||
String NOTICE_TITLE_VOLUNTEER_NOT_PASSED = "您志愿者身份审核未通过"; |
|
||||
|
|
||||
/** |
|
||||
* 消息所属业务类型 : 志愿者审核 |
|
||||
*/ |
|
||||
String NOTICE_BUSINESSTYPE_VOLUNTEER_CHECK = "volunteerCheck"; |
|
||||
} |
|
||||
@ -0,0 +1,22 @@ |
|||||
|
package com.elink.esua.epdc.constant; |
||||
|
|
||||
|
/** |
||||
|
* @Description 志愿者审批发送消息常量 |
||||
|
* @Author yinzuomei |
||||
|
* @Date 2020/2/7 12:20 |
||||
|
*/ |
||||
|
public interface VolunteerInfoNoticeConstant { |
||||
|
/** |
||||
|
* 志愿者审核未通过 |
||||
|
*/ |
||||
|
String NOTICE_CERTIFICATION_NOT_PASSED = "您的志愿者认证【审核未通过】"; |
||||
|
/** |
||||
|
* 消息所属业务类型:volunteer志愿者审核 |
||||
|
*/ |
||||
|
String NOTICE__BUSINESS_TYPE_VOLUNTEER = "volunteer"; |
||||
|
|
||||
|
/** |
||||
|
* 我的消息类型:0审核通知 |
||||
|
*/ |
||||
|
String NOTICE_TYPE_AUDIT_NOTICE = "0"; |
||||
|
} |
||||
Loading…
Reference in new issue