package com.rongwei.safecommon.fegin;

import com.rongwei.rwcommon.base.R;
import com.rongwei.rwcommon.vo.CriteriaQuery;
import com.rongwei.rwcommon.vo.MailDo;
import com.rongwei.rwcommonentity.commonservers.vo.SysNotifyAnnounceVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

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

@FeignClient(value = "rw-common-server", fallback = CXHysitx.class, contextId = "commonFeign")
public interface CXCommonFeginClient {
    @PostMapping("sys/sysnotifyannounce/saveOrUpdate")
    @Async("customThreadPool")
    void sendNotify(@RequestBody SysNotifyAnnounceVo sysNotifyAnnounceVo);

    @PostMapping("/mail/sendHtmlMail")
    R sendHtmlMail(@RequestBody MailDo Mail);

    @PostMapping("ws/socket/push/app")
    R pushToWeb(@RequestParam String cid, @RequestParam(required = false) String message);

    @RequestMapping("sys/sysnotifyannounce/list")
    R list(@RequestParam Map<String, Object> params);

    @PostMapping("sys/sysnotifyannounce/delete")
    R delete(@RequestBody List<String> ids);

    @PostMapping(value = "sys/sysfile/upload?platform=ic-pc&foldercode=file_system&relationid={relationid}"
            , consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    R upload(@RequestPart(value = "file", required = true) MultipartFile file, @PathVariable("relationid") String relationid);
}
