查找矩形和正方形Java的面积

时间:2018-10-16 09:41:39

标签: java

在您的任务中,我需要您的帮助。

我需要找到一个正方形/矩形的面积和周长。我能够获得矩形的面积和周长,但是我不知道如何将其包含在案例中或切换为`。

请在下面找到我的代码。

@Configuration
public class MailConfig {

    ...

    @Bean
    @SuppressWarnings("Duplicates")
    @Qualifier(value = "javaMailSender")
    public JavaMailSender getJavaMailSender() {
        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
        mailSender.setHost(m_mailHost);
        mailSender.setPort(m_mailPort);
        mailSender.setUsername(m_mailUserEmail);
        mailSender.setPassword(m_mailPassword);
        Properties props = mailSender.getJavaMailProperties();
        props.put(PROPERTY_MAIL_TRANSPORT_PROTOCOL, m_mailProtocol);
        props.put(PROPERTY_MAIL_SMTP_AUTHENTICATION, m_mailSmtpAuth);
        props.put(PROPERTY_MAIL_SMTP_START_TLS_ENABLED, m_mailSmtpStartTlsEnabled);
        props.put(PROPERTY_MAIL_DEBUG, m_mailDebug);
        return mailSender;
    }

    @Bean
    @Qualifier(value = "imapMailFlow")
    public IntegrationFlow imapMailFlow() throws UnsupportedEncodingException {
        String user = URLEncoder.encode(mailUserEmail, ConstantUtil.CHARACTER_ENCODING);
        return IntegrationFlows
                .from(Mail.imapIdleAdapter("imaps://" + user + ":" + mailPassword + "@imap.gmail.com:993/inbox")
                        .javaMailProperties(p -> p.put("mail.debug", "false")
                                .put("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory")
                                .put("mail.imap.socketFactory.fallback", "false").put("mail.store.protocol", "imaps"))
                        .shouldMarkMessagesAsRead(true).shouldDeleteMessages(false))
                .channel("receiveChannel").get();
    }

    ...

}

1 个答案:

答案 0 :(得分:0)

这应该让您入门

urlpatterns = [
    url(r'^$', include('main.urls')),
    url(r'^main/', include('main.urls')),
    url(r'^admin/', admin.site.urls),

    # Languages
    url(r'^i18n/', include('django.conf.urls.i18n'), name='set_language'),
    url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='javascript-catalog'),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)