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 AlterCustomMessageSingleService {

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

    @Data
    class AlterCustomMessageSingleRequest{
        String targetId;          //消息来源code+"|"+业务id 修改消息状态时所依据的条件
        String workCodeList;       //String userIdList/loginIdList/workCodeList/lastNameList; 接收人OA系统id/登录名/编号/接收人姓名 （任选一个填入即可，以逗号分隔）
        String bizState;          //业务状态 待处理 0 已处理 1 已同意 2 已拒绝 3 已删除 27 已暂停 34 已撤销 35
        String code;              //消息来源code(传了代表code也做为修改时的条件，默认不传）
    }

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

}
