13 changed files with 177 additions and 8 deletions
@ -0,0 +1,19 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
@Data |
|||
public class ThirdPlatformFormDTO { |
|||
|
|||
// 列出注册关系分组
|
|||
public static interface ListRegRelsGroups {} |
|||
|
|||
@NotBlank(message = "客户ID不能为空", groups = { ListRegRelsGroups.class }) |
|||
private String customerId; |
|||
|
|||
@NotBlank(message = "客户ID不能为空", groups = { ListRegRelsGroups.class }) |
|||
private String actionKey; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class ThirdplatformCustomerRegisterResultDTO { |
|||
/** |
|||
* |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String platformId; |
|||
|
|||
private String platformName; |
|||
} |
@ -1,4 +1,13 @@ |
|||
package com.epmet.apiservice.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class LZGridPlatformProjectAssistResult { |
|||
|
|||
/** |
|||
* 事件id |
|||
*/ |
|||
private String eventId; |
|||
|
|||
} |
|||
|
@ -0,0 +1,43 @@ |
|||
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.service.ThirdPlatformService; |
|||
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; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 第三方平台维护相关api |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("thirdplatform") |
|||
public class ThirdPlatformController { |
|||
|
|||
|
|||
@Autowired |
|||
private ThirdPlatformService thirdPlatformService; |
|||
|
|||
/** |
|||
* 列出第三方平台注册关系 |
|||
* @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("register")
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,11 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.dto.result.ThirdplatformCustomerRegisterResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ThirdPlatformService { |
|||
|
|||
List<ThirdplatformCustomerRegisterResultDTO> listByCustomerId(String customerId, String actionKey); |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.dao.ThirdplatformCustomerRegisterDao; |
|||
import com.epmet.dto.result.ThirdplatformCustomerRegisterResultDTO; |
|||
import com.epmet.service.ThirdPlatformService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class ThirdPlatformServiceImpl implements ThirdPlatformService { |
|||
|
|||
@Autowired |
|||
private ThirdplatformCustomerRegisterDao thirdplatformCustomerRegisterDao; |
|||
|
|||
@Override |
|||
public List<ThirdplatformCustomerRegisterResultDTO> listByCustomerId(String customerId, String actionKey) { |
|||
return thirdplatformCustomerRegisterDao.listDTOS(customerId, actionKey); |
|||
} |
|||
} |
Loading…
Reference in new issue