30 changed files with 151 additions and 272 deletions
@ -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.dto.result.resi; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 活动内容 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-19 |
|||
*/ |
|||
@Data |
|||
public class ResiActRegistrationResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 编码 |
|||
*/ |
|||
private Integer flag; |
|||
|
|||
/** |
|||
* 提示信息 |
|||
*/ |
|||
private String tip; |
|||
} |
@ -1,116 +0,0 @@ |
|||
package com.epmet.feign; |
|||
|
|||
import com.epmet.commons.tools.constant.ServiceConstant; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.UserWechatDTO; |
|||
import com.epmet.dto.form.RegisterFormDTO; |
|||
import com.epmet.dto.form.SaveUserVisitedFormDTO; |
|||
import com.epmet.dto.form.WxLoginFormDTO; |
|||
import com.epmet.dto.result.*; |
|||
import com.epmet.feign.fallback.EpmetThirdFeignClientFallback; |
|||
import me.chanjar.weixin.mp.bean.result.WxMpUser; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* 本服务对外开放的API,其他服务通过引用此client调用该服务 |
|||
* |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/5 14:45 |
|||
* ,url="localhost:8110" |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = EpmetThirdFeignClientFallback.class) |
|||
|
|||
public interface EpmetThirdFeignClient { |
|||
|
|||
/** |
|||
* @param wxMpUser |
|||
* @return |
|||
* @Author sun |
|||
* @Description 根据openId新增或更新用户信息 |
|||
**/ |
|||
@PostMapping(value = "third/pauser/saveuser", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
|||
Result<SaveUserResultDTO> saveUser(@RequestBody WxMpUser wxMpUser); |
|||
|
|||
/** |
|||
* @param phone |
|||
* @return |
|||
* @Author sun |
|||
* @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 |
|||
**/ |
|||
@PostMapping(value = "third/pauser/checkpauser/{phone}") |
|||
Result<CustomerUserResultDTO> checkPaUser(@PathVariable("phone") String phone); |
|||
|
|||
/** |
|||
* @param visited |
|||
* @return |
|||
* @Author sun |
|||
* @Description 用户登陆,新增访问记录数据 |
|||
**/ |
|||
@PostMapping(value = "third/pauservisited/saveuservisited") |
|||
Result saveUserVisited(@RequestBody SaveUserVisitedFormDTO visited); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @return |
|||
* @Author sun |
|||
* @Description 根据客户Id查询各项注册信息 |
|||
**/ |
|||
@PostMapping(value = "third/pacustomer/getcustomeragencyuser/{customerId}") |
|||
Result<InitCustomerResultDTO> getCustomerAgencyUser(@PathVariable("customerId") String customerId); |
|||
|
|||
/** |
|||
* @param customerId |
|||
* @return |
|||
* @Author sun |
|||
* @Description 修改客户数据状态为已完成初始化 |
|||
**/ |
|||
@PostMapping(value = "third/pacustomer/updatecustomer/{customerId}") |
|||
Result updateCustomer(@PathVariable("customerId") String customerId); |
|||
|
|||
/** |
|||
* @Description 获取【component_access_token】的定时任务 10min/次 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping(value = "third/wechatthird/componentaccesstoken") |
|||
Result getComponentAccessTokenJob(); |
|||
|
|||
/** |
|||
* @Description 获取/刷新接口调用令牌 10min/次 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping(value = "third/wechatthird/refreshtoken") |
|||
Result refreshAuthorizerAccessTokenJob(); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @Author sun |
|||
* @Description 校验appId是否有效以及是否授权,校验通过的调用微信API获取用户基本信息 |
|||
**/ |
|||
@PostMapping(value = "third/customermp/resiandworklogin") |
|||
Result<UserWechatDTO> resiAndWorkLogin(@RequestBody WxLoginFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param appId |
|||
* @return |
|||
* @Author sun |
|||
* @Description 根据appId查询公众号注册的客户信息 |
|||
**/ |
|||
@PostMapping(value = "third/customermp/getcustomermsg/{appId}") |
|||
Result<PublicCustomerResultDTO> getCustomerMsg(@PathVariable("appId") String appId); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return |
|||
* @Author sun |
|||
* @Description 用户登陆,新增访问记录数据 |
|||
**/ |
|||
@PostMapping(value = "third/pacustomer/register") |
|||
Result<RegisterResultDTO> register(@RequestBody RegisterFormDTO formDTO); |
|||
} |
@ -1,71 +0,0 @@ |
|||
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.dto.UserWechatDTO; |
|||
import com.epmet.dto.form.RegisterFormDTO; |
|||
import com.epmet.dto.form.SaveUserVisitedFormDTO; |
|||
import com.epmet.dto.form.WxLoginFormDTO; |
|||
import com.epmet.dto.result.*; |
|||
import com.epmet.feign.EpmetThirdFeignClient; |
|||
import me.chanjar.weixin.mp.bean.result.WxMpUser; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/5 14:46 |
|||
*/ |
|||
@Component |
|||
public class EpmetThirdFeignClientFallback implements EpmetThirdFeignClient { |
|||
|
|||
@Override |
|||
public Result<SaveUserResultDTO> saveUser(WxMpUser wxMpUser) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUser", wxMpUser); |
|||
} |
|||
|
|||
@Override |
|||
public Result<CustomerUserResultDTO> checkPaUser(String phone) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "checkPaUser", phone); |
|||
} |
|||
|
|||
@Override |
|||
public Result saveUserVisited(SaveUserVisitedFormDTO visited) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUserVisited", visited); |
|||
} |
|||
|
|||
@Override |
|||
public Result<InitCustomerResultDTO> getCustomerAgencyUser(String customerId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getCustomerAgencyUser", customerId); |
|||
} |
|||
|
|||
@Override |
|||
public Result updateCustomer(String customerId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "updateCustomer", customerId); |
|||
} |
|||
|
|||
@Override |
|||
public Result getComponentAccessTokenJob() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getComponentAccessTokenJob"); |
|||
} |
|||
|
|||
@Override |
|||
public Result refreshAuthorizerAccessTokenJob() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "refreshAuthorizerAccessTokenJob"); |
|||
} |
|||
|
|||
@Override |
|||
public Result<UserWechatDTO> resiAndWorkLogin(WxLoginFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "resiAndWorkLogin", formDTO); |
|||
} |
|||
|
|||
@Override |
|||
public Result<PublicCustomerResultDTO> getCustomerMsg(String appId) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "getCustomerMsg", appId); |
|||
} |
|||
|
|||
@Override |
|||
public Result<RegisterResultDTO> register(RegisterFormDTO formDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "register", formDTO); |
|||
} |
|||
} |
Loading…
Reference in new issue