package com.crm.manager.controller;

import com.crm.manager.service.activity.ActivityRaceRankingFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.model.dto.activity.ActivityRaceRankingDto;
import com.crm.rely.backend.model.entity.activity.ActivityRaceRankingListEntity;
import com.crm.rely.backend.model.entity.activity.ActivityRaceRankingManualEntity;
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;

/**
 *
 * @author y
 * @create 2022/7/21
 */
@RestController
@RequestMapping("/activity/race/ranking")
public class ActivityRaceRankingController {

    @Autowired
    private ActivityRaceRankingFeignService activityRaceRankingFeignService;

    @PostMapping("/search/list")
    public BaseResultWithPagerDto<List<ActivityRaceRankingDto>> searchList(@RequestBody ActivityRaceRankingListEntity entity) throws Exception {
        return activityRaceRankingFeignService.searchList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<ActivityRaceRankingDto> searchSingle(@RequestBody SingleLongEntity entity) throws Exception {
        return activityRaceRankingFeignService.searchSingle(entity);
    }

    @PostMapping("/update/manual")
    public BaseResultDto<Boolean> updateManual(@RequestBody ActivityRaceRankingManualEntity entity) throws Exception {
        return activityRaceRankingFeignService.updateManual(entity);
    }

}
