package ink.wgink.login.oauth2.client.remote.user;

import ink.wgink.annotation.rpc.rest.RemoteService;
import ink.wgink.annotation.rpc.rest.method.RemoteGetMethod;
import ink.wgink.annotation.rpc.rest.method.RemotePostMethod;
import ink.wgink.annotation.rpc.rest.method.RemotePutMethod;
import ink.wgink.annotation.rpc.rest.params.*;
import ink.wgink.pojo.dtos.user.UserDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.pojo.vos.IdsVO;
import ink.wgink.pojo.vos.UpdatePasswordVO;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: IUserRemoteService
 * @Description: 用户远程业务
 * @Author: wanggeng
 * @Date: 2021/9/22 5:30 下午
 * @Version: 1.0
 */
@RemoteService("/resource/user")
public interface IUserRemoteService {

    @RemotePostMethod("/save-default-user")
    SuccessResultData<String> saveDefaultUser(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams Map<String, Object> params);

    @RemoteGetMethod("/get/{userId}")
    UserDTO get(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/get/username/{username}")
    UserDTO getByUsername(@RemoteServerParams String userCenter, @RemotePathParams("username") String username, @RemoteQueryParams("access_token") String accessToken);

    @RemotePostMethod("/list/ids")
    List<UserDTO> listByIds(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);

    @RemotePostMethod("/list/username")
    List<UserDTO> listByUsernames(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);

    @RemoteGetMethod("/list")
    List<UserDTO> list(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken, @RemoteQueryParamsMap Map<String, Object> queryParamsMap);

    @RemoteGetMethod("/listpage")
    SuccessResultList<List<UserDTO>> listPage(@RemoteServerParams String userCenter, @RemoteQueryParams("page") Integer page, @RemoteQueryParams("rows") Integer rows, @RemoteQueryParams("access_token") String accessToken, @RemoteQueryParamsMap Map<String, Object> queryParamsMap);

    @RemoteGetMethod("/count-date-range/{startDate}/{endDate}")
    SuccessResultData<Integer> countDateRange(@RemoteServerParams String userCenter, @RemotePathParams("startDate") String startDate, @RemotePathParams("endDate") String endDate, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/count")
    SuccessResultData<Integer> count(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/count-type/{type}")
    SuccessResultData<Integer> countType(@RemoteServerParams String userCenter, @RemotePathParams("type") Integer type, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/count-error-type")
    SuccessResultData<Integer> countErrorType(@RemoteServerParams String userCenter, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/count-state/{state}")
    SuccessResultData<Integer> countState(@RemoteServerParams String userCenter, @RemotePathParams("state") Integer state, @RemoteQueryParams("access_token") String accessToken);

    @RemoteGetMethod("/get-password-status/{userId}")
    SuccessResultData<String> getPasswordStatus(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken);

    @RemotePutMethod("/update-password/{userId}")
    SuccessResult updatePassword(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams UpdatePasswordVO updatePasswordVO);

    @RemotePostMethod("/list/phones/{phones}")
    List<UserDTO> listByUserPhones(@RemoteServerParams String userCenter, @RemotePathParams("userId") String userId, @RemoteQueryParams("access_token") String accessToken, @RemoteJsonBodyParams IdsVO idsVO);
}
