package com.yd.csf.feign.client.csfclientuser;

import com.yd.common.result.Result;
import com.yd.csf.feign.fallback.csfclientuser.ApiCsfClientUserFeignFallbackFactory;
import com.yd.csf.feign.request.csfclientuser.ApiCsfClientUserAddRequest;
import com.yd.csf.feign.request.csfclientuser.ApiCsfClientUserPageRequest;
import com.yd.csf.feign.response.csfclientuser.ApiCsfClientUserDetailResponse;
import com.yd.csf.feign.response.csfclientuser.ApiCsfClientUserPageResponse;
import org.springframework.cloud.openfeign.FeignClient;
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;

import javax.validation.constraints.NotBlank;

/**
 * 香港保险服务-CSF客户端用户信息接口Feign客户端
 */
@FeignClient(name = "yd-csf-api", fallbackFactory = ApiCsfClientUserFeignFallbackFactory.class)
public interface ApiCsfClientUserFeignClient {

    /**
     * 分页查询-人员信息
     * @param request
     * @return
     */
    @PostMapping("/page")
    Result page(@Validated @RequestBody ApiCsfClientUserPageRequest request);

    /**
     * 详情-人员信息
     * @param csfClientUserBizId
     * @return
     */
    @GetMapping("/detail")
    Result<ApiCsfClientUserDetailResponse> detail(@NotBlank(message = "CSF客户端用户表唯一业务ID不能为空") @RequestParam(value = "csfClientUserBizId") String csfClientUserBizId);

    /**
     * 新增-人员信息
     * @param request
     * @return
     */
    @PostMapping("/add")
    Result add(@Validated @RequestBody ApiCsfClientUserAddRequest request);
}
