Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
4ebb6e86
Commit
4ebb6e86
authored
Sep 18, 2024
by
jinliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add the coupon for new certain number of users
parent
640157af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+4
-6
GlobalField.java
.../com/edgec/browserbackend/browser/domain/GlobalField.java
+7
-0
application.yml
src/main/resources/application.yml
+0
-5
No files found.
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
4ebb6e86
...
...
@@ -37,7 +37,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.thymeleaf.util.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
...
...
@@ -54,9 +53,6 @@ import java.util.stream.Collectors;
@ComponentScan
(
"com.edgec.browserbackend.account.repository"
)
public
class
AccountServiceImpl
implements
AccountService
{
@Value
(
"${account.maxEligibleUsers}"
)
private
int
maxEligibleUsers
;
private
static
final
int
TRIVAL_MONTHS
=
1
;
private
final
Logger
log
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
@@ -488,10 +484,12 @@ public class AccountServiceImpl implements AccountService {
if
(!
StringUtils
.
isEmpty
(
account
.
getPhoneNumber
())
&&
!
list
.
contains
(
account
.
getPhoneNumber
().
substring
(
0
,
3
))
)
{
// Get the total number of registered users
long
totalRegisteredUsers
=
accountRepository
.
countByParentIsNull
();
int
maxEligibleUsers
=
globalFieldRepository
.
findAll
().
get
(
0
).
getMaxEligibleUsers
();
int
giftAmount
=
globalFieldRepository
.
findAll
().
get
(
0
).
getRegisterGift
();
// Check if the total number of registered users is less than maxEligibleUsers
if
(
totalRegisteredUsers
<
maxEligibleUsers
)
{
paymentService
.
bankTransferInsertion
(
account
.
getName
(),
g
lobalFieldRepository
.
findAll
().
get
(
0
).
getRegisterGift
()
,
4
);
paymentService
.
bankTransferInsertion
(
account
.
getName
(),
g
iftAmount
,
4
);
}
}
log
.
info
(
"new account has been created: "
+
account
.
getName
());
...
...
src/main/java/com/edgec/browserbackend/browser/domain/GlobalField.java
View file @
4ebb6e86
...
...
@@ -24,6 +24,13 @@ public class GlobalField {
*/
private
String
specialLineState
;
/**
* 注册礼金
* 最大赠送人数,目前是 1000 人
*/
private
Integer
maxEligibleUsers
;
/**
* 注册礼金
* 目前是注册就送 16 元
...
...
src/main/resources/application.yml
View file @
4ebb6e86
...
...
@@ -40,11 +40,6 @@ security:
resource
:
user-info-uri
:
http://localhost:1729/auth/current
# 可以获得赠送的最大用户数
account
:
maxEligibleUsers
:
1000
# Tomcat
server
:
# tomcat:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment