package com.fdkankan.platform.api.feign;

import com.fdkankan.common.response.ResultData;
import com.fdkankan.common.user.SSOUser;
import com.fdkankan.platform.api.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "4dkankan-center-platform",contextId = "platformUserClient")
@RequestMapping("/platform/feign/user")
public interface PlatformUserClient {
    /**
     *
     * @return SSOUser
     */
    @PostMapping("/getSSOUserByUserId")
    ResultData<SSOUser> getSSOUserByUserId(@RequestParam(value = "userId", required = false) Long userId) ;

    /**
     *
     * @return company
     */
    @PostMapping("/getCompanyById")
    ResultData<Company> getCompanyById(@RequestParam(value = "companyId", required = false) Long companyId) ;
    /**
     *
     * @return user
     */
    @PostMapping("/getUserByName")
    ResultData<User> getUserByName(@RequestParam(value = "userName", required = false) String userName) ;
    /**
     *
     * @return UserIncrement
     */
    @PostMapping("/getUserIncrementByCameraId")
    ResultData<UserIncrement> getUserIncrementByCameraId(@RequestParam(value = "cameraId", required = false) Long cameraId);
    /**
     *
     * @return User
     */
    @PostMapping("/getUserByUserId")
    ResultData<User> getUserByUserId(@RequestParam(value = "userId") Long userId);

    /**
     * @param searchKey 模糊查询
     */
    @PostMapping("/getUserLikeUserName")
    ResultData<List<User>> getUserLikeUserName(@RequestParam(value = "searchKey") String searchKey);

    /**
     * 更改用户场景已下载次数
     * @param userId
     * @param downLoadNum
     * @return
     */
    @PostMapping("/updateDownloadNum")
    ResultData updateDownloadNum(@RequestParam(value = "userId") long userId,
        @RequestParam(value = "downLoadNum") int downLoadNum);
}
