Commit 7c26136b authored by renjie's avatar renjie

information

parent 581d8b5f
package com.edgec.browserbackend;
import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
......@@ -54,18 +56,40 @@ public class BrowserBackendApplication {
};
}
}
//
// @Bean
// public ServletWebServerFactory servletContainer() {
// TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
// tomcat.addAdditionalTomcatConnectors(createStandardConnector());
// TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
// @Override
// protected void postProcessContext(Context context) {
// // 如果要强制使用https,请松开以下注释
// // SecurityConstraint constraint = new SecurityConstraint();
// // constraint.setUserConstraint("CONFIDENTIAL");
// // SecurityCollection collection = new SecurityCollection();
// // collection.addPattern("/*");
// // constraint.addCollection(collection);
// // context.addConstraint(constraint);
// }
// };
// tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http
// return tomcat;
// }
//
// // 配置http
// private Connector createStandardConnector() {
// Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
// connector.setPort(8080);
// // 默认协议为org.apache.coyote.http11.Http11NioProtocol
// Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
// connector.setSecure(false);
// connector.setScheme("http");
// connector.setPort(port);
// connector.setRedirectPort(httpsPort); // 当http重定向到https时的https端口号
// return connector;
// }
//
// @Value("${http.port}")
// private Integer port;
//
// @Value("${server.port}")
// private Integer httpsPort;
}
......@@ -388,6 +388,7 @@ public class AccountServiceImpl implements AccountService {
resultDto.setStatus(0);
resultDto.setData(current);
} catch (Exception e) {
log.error(e.getMessage());
resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", AccountErrorCode.NAMENOTEXIST);
......
package com.edgec.browserbackend.browser.task;
import com.edgec.browserbackend.account.domain.Account;
import com.edgec.browserbackend.account.domain.Promotion;
import com.edgec.browserbackend.account.domain.UserPrePaidBilling;
import com.edgec.browserbackend.account.repository.AccountRepository;
import com.edgec.browserbackend.account.repository.UserPrePaidBillingRepository;
......@@ -41,8 +42,9 @@ public class PromotionTask {
YearMonth.now().minusMonths(1).getMonthValue(), 0);
totalCommission += userPrePaidBillings.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
}
account.getPromotion().setCommission((int)totalCommission);
account.getPromotion().setGift(totalCommission * 8/100);
Promotion promotion = account.getPromotion();
promotion.setCommission((int)totalCommission);
promotion.setGift(totalCommission * 8/100);
accountRepository.save(account);
}
}
......
......@@ -38,13 +38,22 @@ security:
resource:
user-info-uri: http://localhost:1729/auth/current
# Tomcat
server:
port: 1729
# ssl:
# protocol: TLS
# key-store: classpath:javastack.keystore
# key-store-password: javastack
# key-store-type: JKS
# tomcat:
# uri-encoding: UTF-8
# max-threads: 1000
# min-spare-threads: 30
port: 1729 #原来是http的8080
# ssl: #添加的ssl自签名证书
# key-store: classpath:keystore.jks #注意路径要配置正确
# key-store-password: lovespring
# key-alias: lovespring
# key-password: lovespring
#
#http: # 新加一个http的端口号配置
# port: 1730
---
spring:
profiles: dev
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment