Skip to content

Commit

Permalink
Spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 authored and github-actions[bot] committed Dec 19, 2023
1 parent 4aed73e commit d674b85
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public Map<String, Object> buildTemplateParams(String title, String content) {
* @param content: send msg content
* @return AlertResult
*/
public AlertResult send(Map<String, Object> templateParams ) {
public AlertResult send(Map<String, Object> templateParams) {
AlertResult alertResult = new AlertResult();

try {
Expand Down Expand Up @@ -113,11 +113,12 @@ public AlertResult send(Map<String, Object> templateParams ) {
return alertResult;
}

private void createHttpRequest(Map<String, Object> templateParams ) throws MalformedURLException, URISyntaxException {
private void createHttpRequest(Map<String, Object> 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());
Expand Down Expand Up @@ -169,7 +170,7 @@ private void buildRequestHeader() {
/**
* set body params
*/
private void buildMsgToRequestBody(Map<String, Object> templateParams ) {
private void buildMsgToRequestBody(Map<String, Object> templateParams) {
try {
JSONObject jsonObject = JSONUtil.createObj();
templateParams.forEach(jsonObject::set);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -131,7 +131,7 @@ const AlertTypeChoose: React.FC<UpdateFormProps> = (props) => {
submitter={{ render: () => [...renderFooter()] }}
syncToInitialValues
>
<InstanceForm form={form} values={formValues} />
<InstanceForm form={form} values={formValues} />
</ModalForm>
</>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import {
DefaultSvg,
DingTalkSvg,
EmailSvg,
FeiShuSvg, HttpSvg,
FeiShuSvg,
HttpSvg,
SmsSvg,
WeChatSvg
} from '@/components/Icons/AlertIcon';
Expand Down

0 comments on commit d674b85

Please sign in to comment.