package com.xueyi.system.api.staff.feign;

import com.alibaba.fastjson2.JSONObject;
import com.xueyi.common.core.constant.basic.SecurityConstants;
import com.xueyi.common.core.constant.basic.ServiceConstants;
import com.xueyi.system.api.organize.feign.factory.RemoteUserFallbackFactory;
import com.xueyi.system.api.staff.domain.dto.DmVisitCommonDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
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.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 访客服务
 *
 * @author yrx
 */
@FeignClient(contextId = "remoteVisitorService", value = ServiceConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteVisitorService {


    @PostMapping("/visit/inner-api/confirm-visitor")
    public JSONObject queryVisit(@RequestParam(value = "visitorName") String visitorName, @RequestParam(value = "empId") Long empId,
                                 @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping(value = "/visit/inner-api/new-visitor")
    public JSONObject newVisit(@RequestBody DmVisitCommonDto commonDto,
                               @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @DeleteMapping(value = "/visit/inner-api/del-visitor")
    public JSONObject delVisit(@RequestBody DmVisitCommonDto commonDto,
                               @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
    @GetMapping(value = "/visit/inner-api/sms-config")
    public JSONObject smsConfig(@RequestParam(value = "devId") String devId, @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/visit/inner-api/list")
    public JSONObject visitList(@RequestParam(value = "empId") Long empId,
                               @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/visit/inner-api/list-all")
    public JSONObject visitListAll(@RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping(value = "/visit/inner-api/send-sms")
    public JSONObject sendSms(@RequestParam(value = "type") Integer type, @RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);


    @GetMapping(value = "/visit/inner-api/sms-users")
    public JSONObject smsUserConfig(@RequestHeader(SecurityConstants.ENTERPRISE_ID) Long enterpriseId, @RequestHeader(SecurityConstants.SOURCE_NAME) String sourceName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}