class SendMessageAction extends ChannelAction {

    @Override
    public boolean isTransactionAction() {
        return true;
    }

    @Override
    public boolean action(Request request, Response response) {<FILL_FUNCTION_BODY>}
}

        if (request.getNettyRequest() instanceof FullHttpRequest) {
            SendChannelMessageData sendChannelMessageData = getRequestBody(request.getNettyRequest(), SendChannelMessageData.class);
            if(sendChannelMessageData.getTargets() != null && !sendChannelMessageData.getTargets().isEmpty()) {
                if((channelInfo.getStatus() & ProtoConstants.ChannelState.Channel_State_Mask_Message_Unsubscribed) == 0 && (channelInfo.getStatus() & ProtoConstants.ChannelState.Channel_State_Mask_Global) == 0) {
                    for (String target:sendChannelMessageData.getTargets()) {
                        if(!messagesStore.checkUserInChannel(target, channelInfo.getTargetId())) {
                            setResponseContent(RestResult.resultOf(ErrorCode.ERROR_CODE_NOT_RIGHT, "User " + target + " not in channel"), response);
                            return true;
                        }
                    }
                }
            }

            SendMessageData sendMessageData = new SendMessageData();
            sendMessageData.setConv(new Conversation());
            sendMessageData.getConv().setType(ConversationType_Channel);
            sendMessageData.getConv().setTarget(channelInfo.getTargetId());
            sendMessageData.getConv().setLine(sendChannelMessageData.getLine());
            sendMessageData.setSender(channelInfo.getOwner());
            sendMessageData.setPayload(sendChannelMessageData.getPayload());
            sendMessageData.setToUsers(sendChannelMessageData.getTargets());
            if (SendMessageData.isValide(sendMessageData)) {
                sendApiMessage(response, IMTopic.SendMessageTopic, sendMessageData.toProtoMessage().toByteArray(), result -> {
                    ByteBuf byteBuf = Unpooled.buffer();
                    byteBuf.writeBytes(result);
                    ErrorCode errorCode = ErrorCode.fromCode(byteBuf.readByte());
                    if (errorCode == ErrorCode.ERROR_CODE_SUCCESS) {
                        long messageId = byteBuf.readLong();
                        long timestamp = byteBuf.readLong();
                        sendResponse(response, null, new SendMessageResult(messageId, timestamp));
                    } else {
                        sendResponse(response, errorCode, null);
                    }
                });
                return false;
            } else {
                setResponseContent(RestResult.resultOf(ErrorCode.INVALID_PARAMETER), response);
            }
        }
        return true;
    
<methods>public non-sealed void <init>() ,public cn.wildfirechat.common.ErrorCode preAction(com.xiaoleilu.loServer.handler.Request, com.xiaoleilu.loServer.handler.Response) <variables>private static final org.slf4j.Logger LOG,protected cn.wildfirechat.proto.WFCMessage.ChannelInfo channelInfo