package com.microservices.system.api;

import com.microservices.common.core.constant.SecurityConstants;
import com.microservices.common.core.constant.ServiceNameConstants;
import com.microservices.common.core.domain.R;
import com.microservices.system.api.domain.SysNotice;
import com.microservices.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(contextId = "remoteNoticeService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteNoticeService {

    @PostMapping("/notice/innerAdd")
    R<Long> addNotice(@RequestBody SysNotice sysNotice, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/notice/innerGetInfo/{noticeId}")
    R<SysNotice> getNotice(@PathVariable(value = "noticeId") Long noticeId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PutMapping("/notice/innerEdit")
    R<Integer> editNotice(@RequestBody SysNotice sysNotice, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @DeleteMapping("/notice/innerRemove/{noticeIds}")
    R<Integer> deleteNotice(@PathVariable(value = "noticeIds") Long[] noticeIds, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
