package com.friday.custody.api.feignclient;

import com.friday.custody.api.dto.gjdf.*;
import com.friday.custody.api.feignconfig.GJDFConfig;
import com.friday.custody.api.constant.GJDFConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@FeignClient(value = "gjdf-api",
        url = "https://mgrapi.gjdf.com.cn",
        configuration = GJDFConfig.class)
public interface GJDFApi {



    /**
     * 获取token
     * @param admin 管理人
     * @param tokenReq 账号密码
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.MGRAPI_LOGIN,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String getToken(@RequestHeader String admin, @RequestBody TokenReq tokenReq);
    /**
     * 判断token是否过期
     * @param admin 管理人
     * @param doesTheTokenExpireReq token
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.MGRAPI_IS_SESSOIN_TIMEOUT,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String doesTheTokenExpire(@RequestHeader String admin,@RequestBody DoesTheTokenExpireReq doesTheTokenExpireReq);

    /**
     * * 基金信息
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_PARAMINFO_FUNDINFO,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String fundInformation(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);
    
    /*
     * 客户账户信息数据
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_ACCOINFO_ACCO,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String customerAccountInfo(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 基金静态份额
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */

    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_SHARE_SHARE,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String fundStaticShares(@RequestHeader("Cookie") String cookie,@RequestHeader String admin, @RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 基金份额明细
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_SHARE_SHAREDETAIL,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String fundShareDetails(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 交易确认结果
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_TRADE_CONFIRM,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String transactionConfirmationresults(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 开放周期
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_PARAMINFO_FUNDOPENDAY,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String openingPeriod(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 业绩提成流水
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_TRADE_PROFITCURRENT,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String performanceCommissionFlow(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 份额变化流水
     * @param cookie token
     * @param admin 管理人
     * @param gjdfRequestParam 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_TRADE_SHARECURRENTS,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String shareChangeJournal(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 销售商信息
     * @param cookie token
     * @param admin 管理人
     * @param gjdfsellerInformationReq 包含分页参数和销售商编码agencyno查询出销售商信息
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_PARAMINFO_AGENCYINFO,consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String sellerInformation(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFsellerInformationReq gjdfsellerInformationReq);

    @RequestMapping(method = RequestMethod.POST,value = "/ta/kf/paraminfo/fundagency",consumes = GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String shareChangeJournal2(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam gjdfRequestParam);

    /**
     * 基金行情信息
     * @param cookie token
     * @param admin 管理人
     * @param fundMarketInformationReq 必填参数，页数，页长,基金编码等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_NAVINFO_FUNDVALUATIONS,consumes =  GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String fundMarketInformation(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody FundMarketInformationReq fundMarketInformationReq);

    /**
     * 基金账号登记信息
     * @param cookie token
     * @param admin 管理人
     * @param fundMarketInformationReq 必填参数，页数，页长等
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = GJDFConstant.TA_KF_ACCOINFO_ACCONET,consumes =  GJDFConstant.APPLICATION_JSON_CHARSET_UTF_8)
    String customerBankInfo(@RequestHeader("Cookie") String cookie,@RequestHeader String admin,@RequestBody GJDFRequestParam fundMarketInformationReq);



}
