package com.crm.manager.controller;

import com.crm.manager.service.ib.PammInfoFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
import com.crm.rely.backend.core.dto.ib.account.AccountInfoDto;
import com.crm.rely.backend.core.dto.pamm.PammInfoDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.pamm.PammInfoListEntity;
import com.crm.rely.backend.exception.ServiceException;
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;

/**
 * @ClassName PammInfoController
 * @Description
 * @Author y
 * @Date 2023/12/28 16:56
 */
@RestController
@RequestMapping("/pamm")
public class PammInfoController {

    @Autowired
    private PammInfoFeignService pammInfoFeignService;


    @PostMapping("/list")
    public BaseResultWithPagerDto<List<PammInfoDto>> list(@RequestBody PammInfoListEntity entity) throws Exception {
        return pammInfoFeignService.list(entity);
    }

    @PostMapping("/subs")
    public BaseResultDto<List<AccountInfoDto>> subs(@RequestBody SingleLongEntity entity) throws ServiceException {
        return pammInfoFeignService.subs(entity);
    }

}
