|
|
@ -1,11 +1,14 @@ |
|
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.SaveOrUpdateCustSelPlatformFormDTO; |
|
|
|
import com.epmet.dto.form.ThirdPlatformFormDTO; |
|
|
|
import com.epmet.dto.ThirdPlatformDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.ThirdplatformResultDTO; |
|
|
|
import com.epmet.service.ThirdPlatformService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestBody; |
|
|
@ -89,4 +92,115 @@ public class ThirdPlatformController { |
|
|
|
thirdPlatformService.saveOrUpdateSelectedPlatformInfo(input.getCustomerId(), input.getActionKey(), input.getPlatforms()); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-平台列表模糊查询 |
|
|
|
* |
|
|
|
* @param formsDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 17:13 2021-04-08 |
|
|
|
**/ |
|
|
|
@PostMapping("list-platforms") |
|
|
|
public Result<List<ThirdPlatformDTO>> listPlatforms(@RequestBody PlatformNameFormDTO formsDTO) { |
|
|
|
ValidatorUtils.validateEntity(formsDTO); |
|
|
|
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listPlatforms(formsDTO.getPlatformName())); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-修改平台 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 17:31 2021-04-08 |
|
|
|
**/ |
|
|
|
@PostMapping("update-platform") |
|
|
|
public Result updatePlatform(@RequestBody ThirdPlatformDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
if (StringUtils.isBlank(formDTO.getId())) { |
|
|
|
throw new RenException("主键不能为空"); |
|
|
|
} |
|
|
|
thirdPlatformService.updatePlatform(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-新增平台 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.ThirdPlatformDTO> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 17:31 2021-04-08 |
|
|
|
**/ |
|
|
|
@PostMapping("add-platform") |
|
|
|
public Result<ThirdPlatformDTO> addPlatform(@RequestBody ThirdPlatformDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
return new Result<ThirdPlatformDTO>().ok(thirdPlatformService.addPlatform(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-客户可接入的平台列表 |
|
|
|
* 注:该客户还没有注册的平台列表。从thirdplatform表中找该客户没注册的(不在thirdplatform_customer_register中,或者在其中,但是del_flag为1的)返回 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 09:46 2021-04-09 |
|
|
|
**/ |
|
|
|
@PostMapping("customer/registrable-platform-list") |
|
|
|
public Result<List<ThirdPlatformDTO>> registrablePlatformList(@RequestBody CustomerFormDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listRegistrablePlatform(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-客户已经接入的平台列表 |
|
|
|
* 注:在thirdplatform_customer_register中的记录 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.ThirdPlatformDTO>> |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 09:46 2021-04-09 |
|
|
|
**/ |
|
|
|
@PostMapping("customer/registered-platform-list") |
|
|
|
public Result<List<ThirdPlatformDTO>> registeredPlatformList(@RequestBody CustomerFormDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
return new Result<List<ThirdPlatformDTO>>().ok(thirdPlatformService.listRegisteredPlatform(formDTO)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-解除客户接入的平台 |
|
|
|
* 注:单个解除thirdplatform_customer_register表del_flag状态置为1 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 09:46 2021-04-09 |
|
|
|
**/ |
|
|
|
@PostMapping("customer/unregister-platform") |
|
|
|
public Result unregisterPlatform(@RequestBody PlatformUnregisterFormDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
thirdPlatformService.unregisterPlatformCustomer(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 第三方平台-新增客户接入的第三方平台 |
|
|
|
* 注:新增该客户要接入的第三方平台。thirdplatform_customer_register表新增数据。customized_xxx默认从thirdplatform表取过来 |
|
|
|
* |
|
|
|
* @param formDTO |
|
|
|
* @return com.epmet.commons.tools.utils.Result |
|
|
|
* @Author zhangyong |
|
|
|
* @Date 10:34 2021-04-09 |
|
|
|
**/ |
|
|
|
@PostMapping("customer/register-platform") |
|
|
|
public Result registerPlatform(@RequestBody PlatformRegisterFormDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
|
if (formDTO.getPlatformIdList().size() == NumConstant.ZERO) { |
|
|
|
throw new RenException("formDTO.getPlatformIdList().size() == 0;平台id列表不能为空"); |
|
|
|
} |
|
|
|
thirdPlatformService.registerThirdPlatformCustomer(formDTO); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
} |
|
|
|