package com.red.circle.other.inner.endpoint.user.user.api;

import com.red.circle.common.business.core.enums.SysOriginPlatformEnum;
import com.red.circle.framework.core.dto.PageCommand;
import com.red.circle.framework.dto.PageResult;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.inner.model.cmd.user.PhotoWallApprovalTableQryCmd;
import com.red.circle.other.inner.model.cmd.user.UpdateUserAvatarBatchCmd;
import com.red.circle.other.inner.model.cmd.user.UpdateUserNicknameBatchCmd;
import com.red.circle.other.inner.model.cmd.user.UserAccountQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserBaseInfoCmd;
import com.red.circle.other.inner.model.cmd.user.UserProfileListQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserRemoveUsePropsCmd;
import com.red.circle.other.inner.model.cmd.user.UserSwitchUsePropsCmd;
import com.red.circle.other.inner.model.dto.user.UserPhotoWallDTO;
import com.red.circle.other.inner.model.dto.user.UserProfileDTO;
import com.red.circle.other.inner.model.dto.user.UserRegisterInfoDTO;
import com.red.circle.other.inner.model.dto.user.UserRunProfileDTO;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.validation.annotation.Validated;
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;

/**
 * 用户资料服务.
 *
 * @author pengliang on 2023/6/5
 */
public interface UserProfileClientApi {

  String API_PREFIX = "/user-profile/client";

  /**
   * 移除用户缓存(所有).
   */
  @GetMapping("/removeCacheAll")
  ResultResponse<Void> removeCacheAll(@RequestParam("userId") Long userId);

  /**
   * 移除用户缓存-批量.
   */
  @PostMapping("/removeCacheAll/userIds")
  ResultResponse<Void> removeCacheAll(@RequestBody Set<Long> userIds);

  /**
   * 移除用户缓存(redis).
   */
  @PostMapping("/removeCache/userIds")
  ResultResponse<Void> removeCache(@RequestBody Set<Long> userIds);

  /**
   * 获取rtcToken信息(redis).
   */
  @PostMapping("/getToken")
  ResultResponse<String> getToken(@RequestParam("userId") Long userId,@RequestParam("roomId") String roomId);

  /**
   * 移除用户缓存(redis).
   */
  @GetMapping("/removeCache/userId")
  ResultResponse<Void> removeCache(@RequestParam("userId") Long userId);

  /**
   * 获取用户资料.
   */
  @GetMapping("/getByUserId")
  ResultResponse<UserProfileDTO> getByUserId(@RequestParam("userId") Long userId);

  /**
   * 根据账号获取资料信息.
   */
  @GetMapping("/getByAccount")
  ResultResponse<UserProfileDTO> getByAccount(
      @RequestParam("sysOrigin") String sysOrigin,
      @RequestParam("account") String account
  );

  /**
   * 根据账号获取资料信息.
   */
  @GetMapping("/getByAccount/list")
  ResultResponse<List<UserProfileDTO>> getByAccount(@RequestParam("account") String account);

  /**
   * 根据账号获取用户基础信息
   */
  @GetMapping("/getByAccountOne")
  ResultResponse<UserProfileDTO> getByAccountOne(@RequestParam("account") String account);

  /**
   * 分页查询用户信息
   */
  @PostMapping("/pageListQuery")
  ResultResponse<PageResult<UserProfileDTO>> pageListQuery(@RequestBody UserProfileListQryCmd query);

  /**
   * 获取用户资料集合.
   */
  @PostMapping("/mapByUserIds")
  ResultResponse<Map<Long, UserProfileDTO>> mapByUserIds(@RequestBody Set<Long> userIds);

  /**
   * 根据id查询用户集合
   */
  @PostMapping("/listByUserId")
  ResultResponse<List<UserProfileDTO>> listByUserId(@RequestBody Set<Long> userIds);

  /**
   * 查询同系统指定account一组用户
   */
  @PostMapping("/listByAccount")
  ResultResponse<List<UserProfileDTO>> listByAccount(
      @RequestBody @Validated UserAccountQryCmd qryCmd);

  /**
   * 获取用户语言.
   */
  @GetMapping("/getLanguage")
  ResultResponse<String> getLanguage(@RequestParam("userId") Long userId);

  /**
   * 获取用户语言.
   */
  @PostMapping("/mapLanguage")
  ResultResponse<Map<Long, String>> mapLanguage(@RequestBody Set<Long> userIds);

  /**
   * 用户归属系统.
   */
  @GetMapping("/getSysOrigin")
  ResultResponse<SysOriginPlatformEnum> getSysOrigin(@RequestParam("userId") Long userId);

  /**
   * 切换用户使用的道具.
   */
  @PostMapping("/switchUseProps")
  ResultResponse<Void> switchUseProps(@RequestBody UserSwitchUsePropsCmd cmd);

  /**
   * 移除使用道具.
   */
  @PostMapping("/removeUseProps")
  ResultResponse<Void> removeUseProps(@RequestBody UserRemoveUsePropsCmd cmd);

  /**
   * 用户贵族权益.
   */
  @GetMapping("/listUserPropsVipActualEquity")
  ResultResponse<List<String>> listUserPropsVipActualEquity(@RequestParam("userId") Long userId);

  /**
   * 修改头像.
   */
  @GetMapping("/updateUserAvatar")
  ResultResponse<Void> updateUserAvatar(
      @RequestParam("id") Long id,
      @RequestParam("avatar") String avatar
  );

  /**
   * 修改头像.
   */
  @PostMapping("/updateUserAvatar/batch")
  ResultResponse<Void> updateUserAvatarBatch(@RequestBody @Validated UpdateUserAvatarBatchCmd cmd);

  /**
   * 修改昵称，批量.
   */
  @PostMapping("/updateUserNickname/batch")
  ResultResponse<Void> updateUserNicknameBatch(@RequestBody List<UpdateUserNicknameBatchCmd> cmd);

  /**
   * 修改用户签名为空.
   */
  @PostMapping("/updateBatchUserAutographEmpty")
  ResultResponse<Void> updateBatchUserAutographEmpty(@RequestBody Collection<Long> ids);

  @GetMapping("/test")
  ResultResponse<Void> test();

  @PostMapping("/mapRegisterInfo")
  ResultResponse<Map<Long, UserRegisterInfoDTO>> mapRegisterInfo(@RequestBody Set<Long> userIds);

  @GetMapping("/getRegisterInfo")
  ResultResponse<UserRegisterInfoDTO> getRegisterInfo(@RequestParam("userId") Long userId);

  @GetMapping("/getRunProfileById")
  ResultResponse<UserRunProfileDTO> getRunProfileById(@RequestParam("id") Long id);

  @GetMapping("/updateRunProfileById")
  ResultResponse<Void> updateRunProfileById(@RequestParam("id") Long id, @RequestParam("accountStatus") String accountStatus);

  @GetMapping("/removeRunProfileById")
  ResultResponse<Void> removeRunProfileById(@RequestParam("id") Long id);

  @PostMapping("/updateSelectiveById")
  ResultResponse<Void> updateSelectiveById(@RequestBody UserBaseInfoCmd cmd);

  @GetMapping("/restoreDelById")
  ResultResponse<Void> restoreDelById(@RequestParam("id") Long id);

  @GetMapping("/deletePhotoWall")
  ResultResponse<Void> deletePhotoWall(@RequestParam("id") Long id);

  @PostMapping("/pageUserPhotoWall")
  ResultResponse<PageResult<UserPhotoWallDTO>> pageUserPhotoWall(
      @RequestBody PageCommand command);

  @GetMapping("/listUserPhotoWall")
  ResultResponse<List<UserPhotoWallDTO>> listUserPhotoWall(@RequestParam("userId") Long userId);

  @GetMapping("/userPhotoWall")
  ResultResponse<UserPhotoWallDTO> userPhotoWall(@RequestParam("id") Long id);

  @GetMapping("/listUserPhotoWallNormal")
  ResultResponse<List<UserPhotoWallDTO>> listUserPhotoWallNormal(
      @RequestParam("userId") Long userId);

  @PostMapping("/pageUserDetailsPhotoWall")
  ResultResponse<PageResult<UserPhotoWallDTO>> pageUserDetailsPhotoWall(
      @RequestBody PhotoWallApprovalTableQryCmd cmd);

  /**
   * 随机获得马甲数量.
   */
  @GetMapping("/listRandomVest")
  ResultResponse<List<UserProfileDTO>> listRandomVest(@RequestParam("size") int size);

  /**
   * 还原注销登录权限.
   */
  @GetMapping("/restoreAuth")
  ResultResponse<Void> restoreAuthDelByUserId(@RequestParam("userId") Long userId);
}
