Commit 7c26136b authored by renjie's avatar renjie

information

parent 581d8b5f
package com.edgec.browserbackend; package com.edgec.browserbackend;
import org.apache.catalina.Context;
import org.apache.catalina.connector.Connector; import org.apache.catalina.connector.Connector;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
...@@ -54,18 +56,40 @@ public class BrowserBackendApplication { ...@@ -54,18 +56,40 @@ public class BrowserBackendApplication {
}; };
} }
} }
//
// @Bean // @Bean
// public ServletWebServerFactory servletContainer() { // public ServletWebServerFactory servletContainer() {
// TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); // TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() {
// tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // @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; // return tomcat;
// } // }
// //
// // 配置http
// private Connector createStandardConnector() { // private Connector createStandardConnector() {
// Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); // // 默认协议为org.apache.coyote.http11.Http11NioProtocol
// connector.setPort(8080); // Connector connector = new Connector(TomcatServletWebServerFactory.DEFAULT_PROTOCOL);
// connector.setSecure(false);
// connector.setScheme("http");
// connector.setPort(port);
// connector.setRedirectPort(httpsPort); // 当http重定向到https时的https端口号
// return connector; // return connector;
// } // }
//
// @Value("${http.port}")
// private Integer port;
//
// @Value("${server.port}")
// private Integer httpsPort;
} }
...@@ -388,6 +388,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -388,6 +388,7 @@ public class AccountServiceImpl implements AccountService {
resultDto.setStatus(0); resultDto.setStatus(0);
resultDto.setData(current); resultDto.setData(current);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage());
resultDto.setStatus(-1); resultDto.setStatus(-1);
Map<String, Object> statusInfo = new HashMap<>(); Map<String, Object> statusInfo = new HashMap<>();
statusInfo.put("code", AccountErrorCode.NAMENOTEXIST); statusInfo.put("code", AccountErrorCode.NAMENOTEXIST);
......
package com.edgec.browserbackend.browser.task; package com.edgec.browserbackend.browser.task;
import com.edgec.browserbackend.account.domain.Account; 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.domain.UserPrePaidBilling;
import com.edgec.browserbackend.account.repository.AccountRepository; import com.edgec.browserbackend.account.repository.AccountRepository;
import com.edgec.browserbackend.account.repository.UserPrePaidBillingRepository; import com.edgec.browserbackend.account.repository.UserPrePaidBillingRepository;
...@@ -41,8 +42,9 @@ public class PromotionTask { ...@@ -41,8 +42,9 @@ public class PromotionTask {
YearMonth.now().minusMonths(1).getMonthValue(), 0); YearMonth.now().minusMonths(1).getMonthValue(), 0);
totalCommission += userPrePaidBillings.stream().mapToDouble(UserPrePaidBilling::getTotal).sum(); totalCommission += userPrePaidBillings.stream().mapToDouble(UserPrePaidBilling::getTotal).sum();
} }
account.getPromotion().setCommission((int)totalCommission); Promotion promotion = account.getPromotion();
account.getPromotion().setGift(totalCommission * 8/100); promotion.setCommission((int)totalCommission);
promotion.setGift(totalCommission * 8/100);
accountRepository.save(account); accountRepository.save(account);
} }
} }
......
...@@ -38,13 +38,22 @@ security: ...@@ -38,13 +38,22 @@ security:
resource: resource:
user-info-uri: http://localhost:1729/auth/current user-info-uri: http://localhost:1729/auth/current
# Tomcat
server: server:
port: 1729 # tomcat:
# ssl: # uri-encoding: UTF-8
# protocol: TLS # max-threads: 1000
# key-store: classpath:javastack.keystore # min-spare-threads: 30
# key-store-password: javastack port: 1729 #原来是http的8080
# key-store-type: JKS # ssl: #添加的ssl自签名证书
# key-store: classpath:keystore.jks #注意路径要配置正确
# key-store-password: lovespring
# key-alias: lovespring
# key-password: lovespring
#
#http: # 新加一个http的端口号配置
# port: 1730
--- ---
spring: spring:
profiles: dev 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