package com.pcloud.book.record.service;

import com.pcloud.book.record.entity.BookBrowseRecord;
import com.pcloud.common.dto.ResponseDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

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

@FeignClient(value = "pcloud-service-book", qualifier = "bookBrowseRecordPcloud", path = "book/v1.0/bookBrowseRecordService")
public interface BookBrowseRecordService {

    @RequestMapping(value = "addBookRecord", method = RequestMethod.POST)
    public void addBookRecord(@RequestBody BookBrowseRecord bookBrowseRecord);

    @RequestMapping(value = "getCityByIP", method = RequestMethod.GET)
    public ResponseEntity<ResponseDto<BookBrowseRecord>> getCityByIP(@RequestParam("ip") String ip);
    @ApiOperation("通过IP查询城市")
    @RequestMapping(value = "getCitiesByIp", method = RequestMethod.POST)
    ResponseEntity<ResponseDto<Map<String, String>>> getCitiesByIp(@RequestBody List<String> ips);

}
