From d674b85769119cc45c8846fd19f9e463ecca7a07 Mon Sep 17 00:00:00 2001 From: Zzm0809 Date: Tue, 19 Dec 2023 14:16:58 +0000 Subject: [PATCH] Spotless Apply --- .../src/main/java/org/dinky/alert/http/HttpAlert.java | 5 +---- .../src/main/java/org/dinky/alert/http/HttpSender.java | 9 +++++---- .../components/AlertTypeChoose/InstanceForm/index.tsx | 6 +++--- .../AlertInstance/components/AlertTypeChoose/index.tsx | 4 ++-- .../src/pages/RegCenter/Alert/AlertInstance/constans.tsx | 2 +- .../src/pages/RegCenter/Alert/AlertInstance/function.tsx | 3 ++- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpAlert.java b/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpAlert.java index 55499431e3..e21b7bb71e 100644 --- a/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpAlert.java +++ b/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpAlert.java @@ -19,17 +19,14 @@ package org.dinky.alert.http; -import java.util.Map; import org.dinky.alert.AbstractAlert; import org.dinky.alert.AlertResult; -import java.io.IOException; +import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import freemarker.template.TemplateException; - /** * DingTalkAlert * diff --git a/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpSender.java b/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpSender.java index 9c8104c041..c8520a8b23 100644 --- a/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpSender.java +++ b/dinky-alert/dinky-alert-http/src/main/java/org/dinky/alert/http/HttpSender.java @@ -85,7 +85,7 @@ public Map buildTemplateParams(String title, String content) { * @param content: send msg content * @return AlertResult */ - public AlertResult send(Map templateParams ) { + public AlertResult send(Map templateParams) { AlertResult alertResult = new AlertResult(); try { @@ -113,11 +113,12 @@ public AlertResult send(Map templateParams ) { return alertResult; } - private void createHttpRequest(Map templateParams ) throws MalformedURLException, URISyntaxException { + private void createHttpRequest(Map templateParams) + throws MalformedURLException, URISyntaxException { if (HttpConstants.REQUEST_TYPE_POST.equals(httpParams.getMethod())) { httpRequest = new HttpPost(httpParams.getUrl()); buildRequestHeader(); - buildMsgToRequestBody( templateParams ); + buildMsgToRequestBody(templateParams); } else if (HttpConstants.REQUEST_TYPE_GET.equals(httpParams.getMethod())) { buildMsgToUrl(templateParams); URL unencodeUrl = new URL(httpParams.getUrl()); @@ -169,7 +170,7 @@ private void buildRequestHeader() { /** * set body params */ - private void buildMsgToRequestBody(Map templateParams ) { + private void buildMsgToRequestBody(Map templateParams) { try { JSONObject jsonObject = JSONUtil.createObj(); templateParams.forEach(jsonObject::set); diff --git a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/index.tsx b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/index.tsx index 0974af88bf..df8e225007 100644 --- a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/index.tsx +++ b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/index.tsx @@ -23,12 +23,12 @@ import Http from '@/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoo import Sms from '@/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/Sms'; import WeChat from '@/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/InstanceForm/WeChat'; import { ALERT_TYPE_LIST_OPTIONS } from '@/pages/RegCenter/Alert/AlertInstance/constans'; -import { Alert,ALERT_TYPE } from '@/types/RegCenter/data.d'; +import { Alert, ALERT_TYPE } from '@/types/RegCenter/data.d'; import { l } from '@/utils/intl'; -import { ProForm,ProFormSelect,ProFormText } from '@ant-design/pro-components'; +import { ProForm, ProFormSelect, ProFormText } from '@ant-design/pro-components'; import { FormInstance } from 'antd/es/form/hooks/useForm'; import { Values } from 'async-validator'; -import React,{ useState } from 'react'; +import React, { useState } from 'react'; import DingTalk from './DingTalk'; type InstanceFormProps = { diff --git a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/index.tsx b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/index.tsx index 79175ce2c9..3763065b82 100644 --- a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/index.tsx +++ b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/components/AlertTypeChoose/index.tsx @@ -25,7 +25,7 @@ import InstanceForm from '@/pages/RegCenter/Alert/AlertInstance/components/Alert import { NORMAL_MODAL_OPTIONS } from '@/services/constants'; import { Alert } from '@/types/RegCenter/data.d'; import { l } from '@/utils/intl'; -import {ModalForm, ProForm} from '@ant-design/pro-components'; +import { ModalForm } from '@ant-design/pro-components'; /** * update form props @@ -131,7 +131,7 @@ const AlertTypeChoose: React.FC = (props) => { submitter={{ render: () => [...renderFooter()] }} syncToInitialValues > - + ); diff --git a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/constans.tsx b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/constans.tsx index 02d6523a17..ef8a6df7ce 100644 --- a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/constans.tsx +++ b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/constans.tsx @@ -85,7 +85,7 @@ export const ALERT_TYPE_LIST_OPTIONS: DefaultOptionType[] = [ export const RequestMethod = [ { label: 'POST', value: 'POST', key: 'POST', disabled: false }, - { label: 'GET', value: 'GET' , key: 'GET', disabled: true }, + { label: 'GET', value: 'GET', key: 'GET', disabled: true } ]; export enum SMS_TYPE { ALIBABA = 'alibaba', diff --git a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/function.tsx b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/function.tsx index 456ec97f32..d7e4344b0c 100644 --- a/dinky-web/src/pages/RegCenter/Alert/AlertInstance/function.tsx +++ b/dinky-web/src/pages/RegCenter/Alert/AlertInstance/function.tsx @@ -22,7 +22,8 @@ import { DefaultSvg, DingTalkSvg, EmailSvg, - FeiShuSvg, HttpSvg, + FeiShuSvg, + HttpSvg, SmsSvg, WeChatSvg } from '@/components/Icons/AlertIcon';