|
|
@ -3,7 +3,7 @@ package com.epmet.controller; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.validator.ValidatorUtils; |
|
|
|
import com.epmet.dto.form.ThirdPlatformFormDTO; |
|
|
|
import com.epmet.dto.result.ThirdplatformCustomerRegisterResultDTO; |
|
|
|
import com.epmet.dto.result.ThirdplatformResultDTO; |
|
|
|
import com.epmet.service.ThirdPlatformService; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.PostMapping; |
|
|
@ -20,20 +20,32 @@ import java.util.List; |
|
|
|
@RequestMapping("thirdplatform") |
|
|
|
public class ThirdPlatformController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ThirdPlatformService thirdPlatformService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 列出第三方平台注册关系 |
|
|
|
* 根据客户id和动作,列出客户开通可用的第三方平台 |
|
|
|
* @param input |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("list-reg-rels") |
|
|
|
public Result<List<ThirdplatformCustomerRegisterResultDTO>> listRegsteredPlatforms(@RequestBody ThirdPlatformFormDTO input) { |
|
|
|
ValidatorUtils.validateEntity(input); |
|
|
|
List<ThirdplatformCustomerRegisterResultDTO> platformRegs = thirdPlatformService.listByCustomerId(input.getCustomerId(), input.getActionKey()); |
|
|
|
return new Result<List<ThirdplatformCustomerRegisterResultDTO>>().ok(platformRegs); |
|
|
|
@PostMapping("customer/list-platforms-by-action") |
|
|
|
public Result<List<ThirdplatformResultDTO>> listPlatformsByCustomerAndAction(@RequestBody ThirdPlatformFormDTO input) { |
|
|
|
ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListByCustomerAndActionGroup.class); |
|
|
|
List<ThirdplatformResultDTO> platformRegs = thirdPlatformService.listDTOS(input.getCustomerId(), input.getActionKey()); |
|
|
|
return new Result<List<ThirdplatformResultDTO>>().ok(platformRegs); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 根据动作列出平台列表 |
|
|
|
* @return |
|
|
|
* @author wxz |
|
|
|
* @date 2021.03.18 10:54 |
|
|
|
*/ |
|
|
|
@PostMapping("list-platforms-by-action") |
|
|
|
public Result<List<ThirdplatformResultDTO >> listPlatformsByAction(@RequestBody ThirdPlatformFormDTO input) { |
|
|
|
ValidatorUtils.validateEntity(input, ThirdPlatformFormDTO.ListByActionGroup.class); |
|
|
|
List<ThirdplatformResultDTO > platformRegs = thirdPlatformService.listDTOS(null, input.getActionKey()); |
|
|
|
return new Result<List<ThirdplatformResultDTO >>().ok(platformRegs); |
|
|
|
} |
|
|
|
|
|
|
|
//@PostMapping("register")
|
|
|
|