25 changed files with 394 additions and 28 deletions
@ -0,0 +1,40 @@ |
|||
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.epdc.result.EpdcGetVolunteerRankDTO; |
|||
import com.elink.esua.epdc.feign.fallback.HeartFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* |
|||
* 调用用户模块 |
|||
* |
|||
* @Author:wanggongfeng |
|||
* @Date:2019/12/16 17:36 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_HEART_SERVER, fallback = HeartFeignClientFallback.class,url = "http://127.0.0.1:9060") |
|||
public interface HeartFeignClient { |
|||
|
|||
/** |
|||
* 更新当日排行榜 |
|||
* |
|||
* @return |
|||
*/ |
|||
@PostMapping("heart/volunteer/generateRankingList") |
|||
Result generateRankingList(List<EpdcGetVolunteerRankDTO> list); |
|||
|
|||
/** |
|||
* 活动时间到自动审核通过未审核的报名人员 |
|||
* |
|||
* @return |
|||
*/ |
|||
@GetMapping("heart/appactuserrelation/AutoAuditActUser/{actId}") |
|||
Result AutoAuditActUser(@PathVariable("actId") String actId); |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
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.epdc.result.EpdcGetVolunteerRankDTO; |
|||
import com.elink.esua.epdc.feign.HeartFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author:wanggongfeng |
|||
* @Date:2019/12/16 15:11 |
|||
*/ |
|||
@Component |
|||
public class HeartFeignClientFallback implements HeartFeignClient { |
|||
|
|||
/** |
|||
* 更新排行榜 |
|||
* |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Result generateRankingList(List<EpdcGetVolunteerRankDTO> list) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "generateRankingList",list); |
|||
} |
|||
|
|||
/** |
|||
* 活动时间到自动审核通过未审核的报名人员 |
|||
* |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Result AutoAuditActUser(String actId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "AutoAuditActUser",actId); |
|||
} |
|||
|
|||
} |
@ -1,10 +1,10 @@ |
|||
package com.elink.esua.epdc.modules.feign.fallback; |
|||
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.epdc.result.EpdcGetVolunteerRankDTO; |
|||
import com.elink.esua.epdc.modules.feign.UserFeignClient; |
|||
import com.elink.esua.epdc.feign.UserFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import java.util.List; |
@ -0,0 +1,27 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
|
|||
/** |
|||
* 定时更新排行榜 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
*/ |
|||
public interface ActivityService { |
|||
|
|||
/** |
|||
* 活动时间到自动审核通过未审核的报名人员 |
|||
* @Author wanggongfeng |
|||
* @return |
|||
*/ |
|||
Result AutoAuditActUser(String actId); |
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
|
|||
/** |
|||
* 定时更新排行榜 |
|||
* |
|||
* @author Mark sunlightcs@gmail.com |
|||
*/ |
|||
public interface VolunteerService { |
|||
|
|||
/** |
|||
* 生成排行榜 |
|||
* @Author wanggongfeng |
|||
* @return |
|||
*/ |
|||
Result generateRankingList(); |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.feign.HeartFeignClient; |
|||
import com.elink.esua.epdc.feign.UserFeignClient; |
|||
import com.elink.esua.epdc.service.ActivityService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
public class ActivityServiceImpl implements ActivityService { |
|||
|
|||
@Autowired |
|||
private UserFeignClient userFeignClient; |
|||
|
|||
@Autowired |
|||
private HeartFeignClient heartFeignClient; |
|||
|
|||
/** |
|||
* 活动时间到自动审核通过未审核的报名人员 |
|||
* @Author wanggongfeng |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Result AutoAuditActUser(String actId){ |
|||
return heartFeignClient.AutoAuditActUser(actId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,42 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* |
|||
* https://www.renren.io
|
|||
* |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.elink.esua.epdc.service.impl; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO; |
|||
import com.elink.esua.epdc.feign.HeartFeignClient; |
|||
import com.elink.esua.epdc.feign.UserFeignClient; |
|||
import com.elink.esua.epdc.service.VolunteerService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class VolunteerServiceImpl implements VolunteerService { |
|||
|
|||
@Autowired |
|||
private UserFeignClient userFeignClient; |
|||
|
|||
@Autowired |
|||
private HeartFeignClient heartFeignClient; |
|||
|
|||
/** |
|||
* 更新排行榜 |
|||
* @Author wanggongfeng |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public Result generateRankingList(){ |
|||
Result<List<EpdcGetVolunteerRankDTO>> result = userFeignClient.getRankingList(); |
|||
List<EpdcGetVolunteerRankDTO> list = result.getData(); |
|||
return heartFeignClient.generateRankingList(list); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
/** |
|||
* 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.task.activity; |
|||
|
|||
/** |
|||
* 志愿者排名 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
public interface AutoAuditActUserTask { |
|||
|
|||
void run(String actId); |
|||
|
|||
|
|||
} |
@ -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.elink.esua.epdc.task.activity; |
|||
|
|||
import com.elink.esua.epdc.service.ActivityService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 自动审核通过未审核的报名人员 |
|||
* |
|||
* @author qu qu@elink-cn.com |
|||
* @since v1.0.0 2019-12-19 |
|||
*/ |
|||
@Component("AutoAuditActUserTask") |
|||
public class AutoAuditActUserTaskImpl implements AutoAuditActUserTask { |
|||
|
|||
@Autowired |
|||
private ActivityService activityService; |
|||
|
|||
@Override |
|||
public void run(String actId){ |
|||
//活动时间到自动审核通过未审核的报名人员
|
|||
activityService.AutoAuditActUser(actId); |
|||
} |
|||
|
|||
|
|||
} |
Loading…
Reference in new issue