package cn.ey.biz.module.weaver.api.msg;

import cn.ey.biz.module.weaver.autoconfigure.FeignConfiguration;
import cn.ey.biz.module.weaver.common.Constants;
import lombok.Data;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *  删除消息
 */
@FeignClient(name= Constants.WEAVER_NAME, url="${weaver.service.url}", configuration = FeignConfiguration.class)
public interface DeleteCustomMessageSingleService {

    @RequestMapping(method= RequestMethod.POST, value="/api/ec/dev/message/deleteCustomMessageSingle",
            consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    DeleteCustomMessageSingleResponse deleteCustomMessageSingle(@RequestBody DeleteCustomMessageSingleRequest request);

    @Data
    class DeleteCustomMessageSingleRequest{
        String  targetId;      //消息来源code+"|"+业务id 删除消息时所依据的条件
        String workCodeList;   //userIdList/loginIdList/workCodeList/lastNameList  接收人OA系统id/登录名/编号/接收人姓名 （任选一个填入即可，以逗号分隔）
        String code;           //消息来源code(传了代表code也做为删除时的条件，默认不传）
    }

    @Data
    class DeleteCustomMessageSingleResponse{
        String  msg;
        String code;
        String msgShowType;
        Boolean status;
    }

}
