package com.ytpm.question.base;


import com.ytpm.agent.param.AdRecordListParam;
import com.ytpm.agent.param.AuditCheckParam;
import com.ytpm.agent.view.AgentAdGroupStaticsVO;
import com.ytpm.agent.view.AgentTopCountView;
import com.ytpm.app.model.YtAppDefaultConfig;
import com.ytpm.app.model.YtDyzAdRecord;
import com.ytpm.app.model.YtDyzUser;
import com.ytpm.app.param.AppConfigUpdateParam;
import com.ytpm.app.param.AppQueryUserTodayTimeParam;
import com.ytpm.app.param.AppUserParam;
import com.ytpm.app.param.AppUserQueryParam;
import com.ytpm.app.param.AppUserTodayBannedParam;
import com.ytpm.app.param.YtAppUserListParam;
import com.ytpm.app.view.WxDefaultConfig;
import com.ytpm.app.view.YtAppUserListView;
import com.ytpm.app.view.YtUserEcpmStatisticView;
import com.ytpm.general.Result;
import com.ytpm.general.ResultTable;
import com.ytpm.middle.view.DashboardRankingListVO;
import com.ytpm.middle.view.DashboardRevenueVO;
import com.ytpm.middle.view.DashboardRiskVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author lih
 * @date 2025-09-19 16:21
 */
public interface BaseFeign {

    @GetMapping("/visitor/getLoginDitchCount")
    int getLoginDitchCount(@RequestParam("deviceId") String deviceId, @RequestParam("hours") Integer hours);

    @GetMapping("/visitor/getDitchCount")
    int getDitchCount(@RequestParam("deviceId") String deviceId, @RequestParam("hours") Integer hours);

    @GetMapping("/user/getMonthRegistryUser")
    List<YtDyzUser> getMonthRegistryUser(@RequestParam("appIds") String appIds, @RequestParam("type") Integer type);

    @PostMapping("/user/queryAll")
    ResultTable<YtAppUserListView> queryAll(@RequestBody YtAppUserListParam param);

    @GetMapping("/user/getUserInfo")
    Result<YtDyzUser> getUserInfo(@RequestParam("userId") String userId);

    @PostMapping("/user/getUserList")
    ResultTable<YtDyzUser> getUserList(@RequestBody AppUserParam param);

    @PostMapping("/user/getUserAll")
    ResultTable<YtDyzUser> getUserAll(@RequestBody AppUserParam param);

    @PostMapping("/user/updateUserInfo")
    Result<?> updateUserInfo(@RequestBody YtDyzUser dyzUser);

    @GetMapping("/user/adRecords")
    ResultTable<YtDyzAdRecord> adRecords(@RequestParam(name = "userId", required = true) String userId,
                                         @RequestParam(name = "adsourceType", required = false) Integer adsourceType);

    @PostMapping("/user/adRecords/page")
    ResultTable<YtDyzAdRecord> adRecordsPage(@RequestBody AdRecordListParam param);

    @PostMapping("/user/adRecords/statistic")
    Result<YtUserEcpmStatisticView> adRecordsStatistic(@RequestBody AdRecordListParam param);

    @GetMapping("/user/adRecords/count/month")
    Result<Integer> queryRecordMonthCount(@RequestParam(name = "userId") String userId,
                                          @RequestParam(name = "adSourceType", required = false) Integer adSourceType,
                                          @RequestParam(name = "startTime", required = false) String startTime);

    @PostMapping("/user/queryUserByTime")
    List<YtDyzUser> queryUserByTime(@RequestBody AppUserQueryParam appUserQueryParam);

    @PostMapping("/user/queryUserByTodayTime")
    int[] queryUserByTodayTime(@RequestBody AppQueryUserTodayTimeParam appQueryUserTodayTimeParam);

    @PostMapping("/user/queryLoginRecords")
    List<String> queryLoginRecords(@RequestBody AppUserQueryParam appUserQueryParam);

    @GetMapping("/user/queryByOpenid")
    List<YtDyzUser> queryByOpenid(@RequestParam("openid") String openid);

    @PostMapping("/wx/saveAppConfig")
    Result<String> saveAppConfig(@RequestBody YtAppDefaultConfig defaultConfig);

    @PostMapping("/wx/updateAppConfig")
    Result<String> updateAppConfig(@RequestBody YtAppDefaultConfig defaultConfig);

    @PostMapping("/wx/updateAppsConfig")
    void updateAppsConfig(@RequestBody AppConfigUpdateParam param);

    @GetMapping("/wx/getConfigs")
    List<WxDefaultConfig> getConfigs(@RequestParam(name = "appIds") String appIds);

    @PostMapping("/user/queryTodayBanned")
    List<YtDyzUser> queryTodayBanned(@RequestBody AppUserTodayBannedParam appUserTodayBannedParam);

    @GetMapping("/ad/getAdCount")
    Map<String, BigDecimal> getAdCount(@RequestParam(name = "appIds") String appIds);

    @GetMapping("/ad/getAppTopCount")
    AgentTopCountView getAppTopCount(@RequestParam(name = "appIds") String appIds);

    @GetMapping("/ad/getAppRankingList")
    DashboardRankingListVO queryRankingList(@RequestParam(name = "sortBy") Integer sortBy, @RequestParam(name = "limit") Integer limit);

    @GetMapping("/ad/revenueStatics")
    DashboardRevenueVO revenueStatics(@RequestParam(name = "apkIds") String apkIds);

    @GetMapping("/ad/userStatics")
    DashboardRiskVO userStatics(@RequestParam(name = "appId") String appId);

    @GetMapping("/ad/getAgentProfit")
    List<AgentAdGroupStaticsVO> getAgentProfit(@RequestParam(name = "appIds") String appIds);

    @PostMapping("/user/getRevenueByTime")
    BigDecimal getRevenueByTime(@RequestBody YtAppUserListParam param);

    @GetMapping("/wx/delDefaultConfig")
    void delAppConfig(@RequestParam("appId") String appId);

    @PostMapping("/user/unLockUser")
    void unLockUser(@RequestParam("userIds") String userIds);

    /**
     * 锁定用户
     */
    @GetMapping("/user/lockUser")
    YtDyzUser lockUser(@RequestParam(name = "userId") String userId, @RequestParam("userStatus") Integer userStatus);

    /**
     * 批量审核用户
     */
    @PostMapping("/user/batchAudit")
    void batchAudit(@RequestBody AuditCheckParam auditCheckParam);

    /**
     * 批量查询用户下所有渠道
     */
    @GetMapping("/user/queryAllDitchUser")
    List<YtDyzUser> queryAllDitchUser(@RequestParam("userIds") String userIds);
}
