package com.crm.manager.controller;

import com.crm.manager.service.follow.FollowWalletFeignService;
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.follow.wallet.FollowWalletSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.follow.wallet.FollowWalletSearchEntity;
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;

@RestController
@RequestMapping("/follow/wallet")
public class FollowWalletController {

    @Autowired
    private FollowWalletFeignService service;

    @PostMapping("/search/list")
    public BaseResultWithPagerDto<FollowWalletSearchDto> single(@RequestBody FollowWalletSearchEntity entity) throws Exception {
        BaseResultWithPagerDto<FollowWalletSearchDto> resultDto = service.list(entity);
        return resultDto;
    }

    @PostMapping("/search/single")
    public BaseResultDto<FollowWalletSearchDto> single(@RequestBody SingleLongEntity entity) throws Exception {
        BaseResultDto<FollowWalletSearchDto> resultDto = service.single(entity);
        return resultDto;
    }
}
