forked from luyan/epmet-cloud-lingshan
12 changed files with 254 additions and 1 deletions
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.resi.group.dto.group.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/5/21 15:39 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RecommendedListFormDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -4205042052361059952L; |
||||
|
/** |
||||
|
* 客户ID |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
/** |
||||
|
* 用户ID |
||||
|
*/ |
||||
|
private String userId; |
||||
|
/** |
||||
|
* 客户定制化显示几条,传入几条 |
||||
|
*/ |
||||
|
private Integer pageSize; |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.epmet.resi.group.dto.group.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/5/21 15:41 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class RecommendedListResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -8909027543795476302L; |
||||
|
/** |
||||
|
* 小组id |
||||
|
*/ |
||||
|
private String groupId; |
||||
|
/** |
||||
|
* 小组名称 |
||||
|
*/ |
||||
|
private String groupName; |
||||
|
/** |
||||
|
* 小组头像 |
||||
|
*/ |
||||
|
private String groupHeadPhoto; |
||||
|
/** |
||||
|
* 总成员数 |
||||
|
*/ |
||||
|
private String totalMember; |
||||
|
/** |
||||
|
* 党员总数 |
||||
|
*/ |
||||
|
private String totalPartyMember; |
||||
|
/** |
||||
|
* 组长名 |
||||
|
*/ |
||||
|
private String leaderName; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.epmet.feign; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.feign.fallback.ResiGroupFeignClientFallBack; |
||||
|
import com.epmet.resi.group.dto.group.form.RecommendedListFormDTO; |
||||
|
import com.epmet.resi.group.dto.group.result.RecommendedListResultDTO; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/4/17 15:24 |
||||
|
*/ |
||||
|
@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupFeignClientFallBack.class) |
||||
|
public interface ResiGroupFeignClient { |
||||
|
|
||||
|
/** |
||||
|
* 党建园地-推荐小组 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/5/21 15:50 |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.group.dto.group.result.RecommendedListResultDTO>> |
||||
|
*/ |
||||
|
@PostMapping("/resi/group/group/recommendedlist") |
||||
|
Result<List<RecommendedListResultDTO>> recommendedList(@RequestBody RecommendedListFormDTO formDTO); |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.epmet.feign.fallback; |
||||
|
|
||||
|
import com.epmet.commons.tools.constant.ServiceConstant; |
||||
|
import com.epmet.commons.tools.utils.ModuleUtils; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.feign.ResiGroupFeignClient; |
||||
|
import com.epmet.resi.group.dto.group.form.*; |
||||
|
import com.epmet.resi.group.dto.group.result.*; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/4/17 15:27 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class ResiGroupFeignClientFallBack implements ResiGroupFeignClient { |
||||
|
|
||||
|
@Override |
||||
|
public Result<List<RecommendedListResultDTO>> recommendedList(RecommendedListFormDTO formDTO) { |
||||
|
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "recommendedList", formDTO); |
||||
|
} |
||||
|
} |
@ -1,8 +1,23 @@ |
|||||
package com.epmet.service; |
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.resi.group.dto.group.form.RecommendedListFormDTO; |
||||
|
import com.epmet.resi.group.dto.group.result.RecommendedListResultDTO; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
/** |
/** |
||||
* @dscription 党建园地-小组Service |
* @dscription 党建园地-小组Service |
||||
* @author sun |
* @author sun |
||||
*/ |
*/ |
||||
public interface GroupService { |
public interface GroupService { |
||||
|
/** |
||||
|
* 党建园地-推荐小组 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/5/21 16:35 |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.resi.group.dto.group.result.RecommendedListResultDTO> |
||||
|
*/ |
||||
|
List<RecommendedListResultDTO> recommendedList(TokenDto tokenDto, RecommendedListFormDTO formDTO); |
||||
} |
} |
||||
|
@ -1,12 +1,26 @@ |
|||||
package com.epmet.service.impl; |
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.epmet.commons.tools.security.dto.TokenDto; |
||||
|
import com.epmet.feign.ResiGroupFeignClient; |
||||
|
import com.epmet.resi.group.dto.group.form.RecommendedListFormDTO; |
||||
|
import com.epmet.resi.group.dto.group.result.RecommendedListResultDTO; |
||||
import com.epmet.service.GroupService; |
import com.epmet.service.GroupService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
/** |
/** |
||||
* @dscription 党建园地-小组ServiceImpl |
* @dscription 党建园地-小组ServiceImpl |
||||
* @author sun |
* @author sun |
||||
*/ |
*/ |
||||
@Service |
@Service |
||||
public class GroupServiceImpl implements GroupService { |
public class GroupServiceImpl implements GroupService { |
||||
|
@Autowired |
||||
|
ResiGroupFeignClient resiGroupFeignClient; |
||||
|
@Override |
||||
|
public List<RecommendedListResultDTO> recommendedList(TokenDto tokenDto, RecommendedListFormDTO formDTO) { |
||||
|
formDTO.setUserId(tokenDto.getUserId()); |
||||
|
return resiGroupFeignClient.recommendedList(formDTO).getData(); |
||||
|
} |
||||
} |
} |
||||
|
Loading…
Reference in new issue