forked from rongchao/epmet-cloud-rizhao
26 changed files with 483 additions and 17 deletions
@ -0,0 +1,26 @@ |
|||
package com.epmet.modules.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.result.ResiRegisterResultDTO; |
|||
import com.epmet.modules.feign.fallback.ResiPartymemberFeignClientFallBack; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
|
|||
/** |
|||
* @Description 居民端陌生人导览 调用epmet-user服务 |
|||
* @Author sun |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.RESI_PARTYMEMBER_SERVER, fallback = ResiPartymemberFeignClientFallBack.class,url="http://localhost:8096") |
|||
public interface ResiPartymemberFeignClient { |
|||
|
|||
/** |
|||
* @return com.epmet.dto.result.ResiWarmheartedResultDTO |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
**/ |
|||
@PostMapping(value = "resi/partymember/resiwarmheartedapply/init") |
|||
Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO); |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.modules.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.dto.form.ResiRegisterFormDTO; |
|||
import com.epmet.dto.result.LatestGridInfoResultDTO; |
|||
import com.epmet.dto.result.ResiRegisterResultDTO; |
|||
import com.epmet.modules.feign.EpmetUserFeignClient; |
|||
import com.epmet.modules.feign.ResiPartymemberFeignClient; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Description 居民端-陌生人导览 调用epmet-user服务 |
|||
* @Author sun |
|||
* @Date 2020/3/16 |
|||
*/ |
|||
@Component |
|||
public class ResiPartymemberFeignClientFallBack implements ResiPartymemberFeignClient { |
|||
|
|||
/** |
|||
* @return com.epmet.dto.result.ResiWarmheartedResultDTO |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
* @Date 2020/3/30 |
|||
**/ |
|||
@Override |
|||
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "init", formDTO); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.modules.warmhearted.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.warmhearted.service.ResiWarmheartedService; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @Description 居民端热心居民申请接口入口 |
|||
* @Author sun |
|||
* @since v1.0.0 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("warmhearted") |
|||
public class ResiWarmheartedController { |
|||
@Autowired |
|||
private ResiWarmheartedService resiWarmheartedService; |
|||
|
|||
/** |
|||
* @param |
|||
* @Author sun |
|||
* @Description 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
**/ |
|||
@PostMapping("init") |
|||
public Result<ResiWarmheartedResultDTO> init(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedFormDTO resiWarmheartedFormDTO) { |
|||
return resiWarmheartedService.init(tokenDTO, resiWarmheartedFormDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.modules.warmhearted.service; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
|
|||
/** |
|||
* @Description 居民端居民注册信息service |
|||
* @Author sun |
|||
*/ |
|||
public interface ResiWarmheartedService { |
|||
|
|||
|
|||
/** |
|||
* 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据 |
|||
* |
|||
* @param |
|||
* @return void |
|||
* @author sun |
|||
*/ |
|||
Result<ResiWarmheartedResultDTO> init(TokenDto tokenDTO, ResiWarmheartedFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.modules.warmhearted.service.impl; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.modules.feign.ResiPartymemberFeignClient; |
|||
import com.epmet.modules.utils.ModuleConstant; |
|||
import com.epmet.modules.warmhearted.service.ResiWarmheartedService; |
|||
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|||
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @Description 居民端居民注册信息service |
|||
* @Author sun |
|||
* @Date 2020/3/30 |
|||
*/ |
|||
@Service |
|||
public class ResiWarmheartedServiceImpl implements ResiWarmheartedService { |
|||
|
|||
@Autowired |
|||
private ResiPartymemberFeignClient resiPartymemberFeignClient; |
|||
|
|||
@Override |
|||
public Result<ResiWarmheartedResultDTO> init(TokenDto tokenDTO, ResiWarmheartedFormDTO formDTO) { |
|||
if (null == tokenDTO || StringUtils.isBlank(tokenDTO.getUserId())) { |
|||
return new Result<ResiWarmheartedResultDTO>().error(ModuleConstant.USER_NOT_NULL); |
|||
} |
|||
formDTO.setUserId(tokenDTO.getUserId()); |
|||
return resiPartymemberFeignClient.init(formDTO); |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
/** |
|||
* 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.resi.partymember.dto.warmhearted.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 居民端-居民注册页面初始化-居民访问记录表新增数据-配置入参 |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class ResiWarmheartedFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户Id CUSTOMER.id |
|||
*/ |
|||
@NotBlank(message = "客户ID不能为空") |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
@NotBlank(message = "网格ID不能为空") |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 访问来源 指的是用户点的那个功能进入到的注册页面,就是一个功能模块的Id(value:feature+action) |
|||
*/ |
|||
@NotBlank(message = "访问来源不能为空") |
|||
private String visitFrom; |
|||
|
|||
/** |
|||
* 用户Id |
|||
*/ |
|||
@NotBlank(message = "用户ID不能为空") |
|||
private String userId; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
/** |
|||
* 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.resi.partymember.dto.warmhearted.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 居民端-热心居民申请页面初始化-查询有无申请、新增访问行为记录数据-配置入参 |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class ResiWarmheartedResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 是否已申请热心居民 0:否, 1:是 |
|||
*/ |
|||
private String isApplied; |
|||
|
|||
/** |
|||
* 热心居民申请访问记录表(resi_warmhearted_visit)Id |
|||
*/ |
|||
private String resiWarmheartedVisitId; |
|||
|
|||
} |
@ -0,0 +1,32 @@ |
|||
/** |
|||
* Copyright (c) 2018 人人开源 All rights reserved. |
|||
* <p> |
|||
* https://www.renren.io
|
|||
* <p> |
|||
* 版权所有,侵权必究! |
|||
*/ |
|||
|
|||
package com.epmet.modules.warmhearted.constant; |
|||
|
|||
/** |
|||
* 常量 |
|||
* @author sun |
|||
* @since 1.0.0 |
|||
*/ |
|||
public interface ResiWarmheartedVisitConstant { |
|||
|
|||
/** |
|||
* 最后一次操作行为-初始化 |
|||
*/ |
|||
String INITIALIZE = "initialize"; |
|||
|
|||
/** |
|||
* 最后一次操作行为-提交成功 |
|||
*/ |
|||
String SUCCESS = "success"; |
|||
|
|||
/** |
|||
* 最后一次操作行为-提交失败 |
|||
*/ |
|||
String FAILD="faild"; |
|||
} |
Loading…
Reference in new issue