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
bf327467
Commit
bf327467
authored
May 20, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'staging' into 'master'
Staging See merge request
!123
parents
94942a23
e4de15af
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
252 additions
and
33 deletions
+252
-33
AdministratorController.java
...erbackend/account/controller/AdministratorController.java
+18
-2
IpCountQueryResultDto.java
...gec/browserbackend/account/dto/IpCountQueryResultDto.java
+19
-0
PromotionQueryResultDto.java
...c/browserbackend/account/dto/PromotionQueryResultDto.java
+9
-0
UserBalanceRepository.java
...wserbackend/account/repository/UserBalanceRepository.java
+2
-1
UserBalanceRepositoryCustom.java
...ckend/account/repository/UserBalanceRepositoryCustom.java
+4
-0
UserBalanceRepositoryCustomImpl.java
...d/account/repository/UserBalanceRepositoryCustomImpl.java
+18
-0
AdministratorService.java
.../browserbackend/account/service/AdministratorService.java
+2
-0
AccountServiceImpl.java
...owserbackend/account/service/impl/AccountServiceImpl.java
+1
-3
AdministratorServiceImpl.java
...ackend/account/service/impl/AdministratorServiceImpl.java
+35
-4
IpCountRecord.java
...om/edgec/browserbackend/browser/domain/IpCountRecord.java
+43
-0
IpCountRecordRepository.java
...erbackend/browser/repository/IpCountRecordRepository.java
+8
-0
IpResourceRepository.java
...owserbackend/browser/repository/IpResourceRepository.java
+5
-2
IpResourceServiceImpl.java
...erbackend/browser/service/Impl/IpResourceServiceImpl.java
+25
-4
BrowserTask.java
...va/com/edgec/browserbackend/browser/task/BrowserTask.java
+59
-13
Trans.java
...ain/java/com/edgec/browserbackend/common/utils/Trans.java
+4
-4
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AdministratorController.java
View file @
bf327467
...
@@ -94,8 +94,15 @@ public class AdministratorController {
...
@@ -94,8 +94,15 @@ public class AdministratorController {
//用户通过银行转账,手动插入余额记录
//用户通过银行转账,手动插入余额记录
@PreAuthorize
(
Securitys
.
ROOT_EL
)
@PreAuthorize
(
Securitys
.
ROOT_EL
)
@RequestMapping
(
path
=
"/0xadministrator/banktransfer"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
path
=
"/0xadministrator/banktransfer"
,
method
=
RequestMethod
.
POST
)
public
UserBalance
bankTransferInsert
(
@RequestBody
UserBalance
userBalance
)
{
public
HashMap
bankTransferInsert
(
@RequestBody
UserBalance
userBalance
)
{
return
paymentService
.
bankTransferInsertion
(
userBalance
.
getUsername
(),
(
int
)
userBalance
.
getBalanced
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
try
{
map
.
put
(
"userbalance"
,
paymentService
.
bankTransferInsertion
(
userBalance
.
getUsername
(),
(
int
)
userBalance
.
getBalanced
()));
map
.
put
(
"status"
,
"success"
);
}
catch
(
Exception
e
)
{
map
.
put
(
"status"
,
"failed"
);
}
return
map
;
}
}
//--------------------------------用户--------------------------------------//
//--------------------------------用户--------------------------------------//
...
@@ -171,6 +178,7 @@ public class AdministratorController {
...
@@ -171,6 +178,7 @@ public class AdministratorController {
return
userPrePaidBillingService
.
findUserBillingByUnpaid
(
username
,
BillStatus
.
UNPAID
);
return
userPrePaidBillingService
.
findUserBillingByUnpaid
(
username
,
BillStatus
.
UNPAID
);
}
}
//--------------------------------系统--------------------------------------//
//--------------------------------系统--------------------------------------//
//查询某时段内用户的账单,tested
//查询某时段内用户的账单,tested
@PreAuthorize
(
"hasRole('ADMIN')"
)
@PreAuthorize
(
"hasRole('ADMIN')"
)
...
@@ -195,6 +203,14 @@ public class AdministratorController {
...
@@ -195,6 +203,14 @@ public class AdministratorController {
return
administratorService
.
searchCreateAccountBetween
(
pageable
,
strDate1
,
strDate2
,
isAuthorized
);
return
administratorService
.
searchCreateAccountBetween
(
pageable
,
strDate1
,
strDate2
,
isAuthorized
);
}
}
// 查询所有用户消费
@PreAuthorize
(
Securitys
.
ADMIN_EL
)
@RequestMapping
(
path
=
"/0xadministrator/allused"
,
method
=
RequestMethod
.
GET
)
public
Page
<
UserBalance
>
findAllused
(
@RequestParam
(
value
=
"page"
)
int
page
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Pageable
pageable
=
PageRequest
.
of
(
page
,
size
);
return
administratorService
.
getAllUserUsed
(
pageable
);
}
//search company earnings detail by month tested
//search company earnings detail by month tested
@PreAuthorize
(
"hasRole('ADMIN')"
)
@PreAuthorize
(
"hasRole('ADMIN')"
)
@RequestMapping
(
path
=
"/0xadministrator/companyearning/{stringdate}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/0xadministrator/companyearning/{stringdate}"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/com/edgec/browserbackend/account/dto/IpCountQueryResultDto.java
View file @
bf327467
...
@@ -4,6 +4,9 @@ public class IpCountQueryResultDto {
...
@@ -4,6 +4,9 @@ public class IpCountQueryResultDto {
long
IpCount_using
;
long
IpCount_using
;
long
IpCount_all
;
long
IpCount_all
;
long
IpCount_yesterday_using
;
long
IpCount_yesterday_all
;
public
long
getIpCount_all
()
{
public
long
getIpCount_all
()
{
return
IpCount_all
;
return
IpCount_all
;
}
}
...
@@ -19,4 +22,20 @@ public class IpCountQueryResultDto {
...
@@ -19,4 +22,20 @@ public class IpCountQueryResultDto {
public
void
setIpCount_using
(
long
ipCount_using
)
{
public
void
setIpCount_using
(
long
ipCount_using
)
{
IpCount_using
=
ipCount_using
;
IpCount_using
=
ipCount_using
;
}
}
public
long
getIpCount_yesterday_all
()
{
return
IpCount_yesterday_all
;
}
public
void
setIpCount_yesterday_all
(
long
ipCount_yesterday_all
)
{
IpCount_yesterday_all
=
ipCount_yesterday_all
;
}
public
long
getIpCount_yesterday_using
()
{
return
IpCount_yesterday_using
;
}
public
void
setIpCount_yesterday_using
(
long
ipCount_yesterday_using
)
{
IpCount_yesterday_using
=
ipCount_yesterday_using
;
}
}
}
src/main/java/com/edgec/browserbackend/account/dto/PromotionQueryResultDto.java
View file @
bf327467
...
@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
...
@@ -7,6 +7,7 @@ import org.springframework.data.domain.Page;
public
class
PromotionQueryResultDto
{
public
class
PromotionQueryResultDto
{
private
String
username
;
private
String
username
;
private
String
code
;
private
String
code
;
private
long
ipCount
;
Page
<
AccountPromotionDto
>
users
;
Page
<
AccountPromotionDto
>
users
;
Promotion
promotion
;
Promotion
promotion
;
...
@@ -50,4 +51,12 @@ public class PromotionQueryResultDto {
...
@@ -50,4 +51,12 @@ public class PromotionQueryResultDto {
public
void
setUsers
(
Page
<
AccountPromotionDto
>
users
)
{
public
void
setUsers
(
Page
<
AccountPromotionDto
>
users
)
{
this
.
users
=
users
;
this
.
users
=
users
;
}
}
public
long
getIpCount
()
{
return
ipCount
;
}
public
void
setIpCount
(
long
ipCount
)
{
this
.
ipCount
=
ipCount
;
}
}
}
src/main/java/com/edgec/browserbackend/account/repository/UserBalanceRepository.java
View file @
bf327467
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
@Repository
@Repository
public
interface
UserBalanceRepository
extends
MongoRepository
<
UserBalance
,
String
>,
UserBalanceRepositoryCustom
{
public
interface
UserBalanceRepository
extends
MongoRepository
<
UserBalance
,
String
>,
UserBalanceRepositoryCustom
{
}
}
src/main/java/com/edgec/browserbackend/account/repository/UserBalanceRepositoryCustom.java
View file @
bf327467
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
package
com
.
edgec
.
browserbackend
.
account
.
repository
;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
public
interface
UserBalanceRepositoryCustom
{
public
interface
UserBalanceRepositoryCustom
{
void
incrementBalance
(
UserBalance
balance
,
float
balancedIcrement
,
float
usedIncrement
);
void
incrementBalance
(
UserBalance
balance
,
float
balancedIcrement
,
float
usedIncrement
);
Page
<
UserBalance
>
findAllOrderByUsedDesc
(
Pageable
pageable
);
}
}
src/main/java/com/edgec/browserbackend/account/repository/UserBalanceRepositoryCustomImpl.java
View file @
bf327467
...
@@ -3,10 +3,16 @@ package com.edgec.browserbackend.account.repository;
...
@@ -3,10 +3,16 @@ package com.edgec.browserbackend.account.repository;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
com.edgec.browserbackend.account.domain.UserBalance
;
import
org.bson.Document
;
import
org.bson.Document
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.BasicQuery
;
import
org.springframework.data.mongodb.core.query.Update
;
import
org.springframework.data.mongodb.core.query.Update
;
import
java.util.List
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
query
.
Criteria
.
where
;
import
static
org
.
springframework
.
data
.
mongodb
.
core
.
query
.
Criteria
.
where
;
public
class
UserBalanceRepositoryCustomImpl
implements
UserBalanceRepositoryCustom
{
public
class
UserBalanceRepositoryCustomImpl
implements
UserBalanceRepositoryCustom
{
...
@@ -24,4 +30,16 @@ public class UserBalanceRepositoryCustomImpl implements UserBalanceRepositoryCus
...
@@ -24,4 +30,16 @@ public class UserBalanceRepositoryCustomImpl implements UserBalanceRepositoryCus
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
UserBalance
.
class
);
mongoTemplate
.
updateFirst
(
basicQuery
,
update
,
UserBalance
.
class
);
}
}
@Override
public
Page
<
UserBalance
>
findAllOrderByUsedDesc
(
Pageable
pageable
)
{
Document
doc
=
new
Document
();
BasicQuery
basicQuery
=
new
BasicQuery
(
doc
);
long
count
=
mongoTemplate
.
count
(
basicQuery
,
UserBalance
.
class
);
basicQuery
.
with
(
pageable
);
basicQuery
.
with
(
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"used"
));
List
<
UserBalance
>
userBalances
=
mongoTemplate
.
find
(
basicQuery
,
UserBalance
.
class
);
Page
<
UserBalance
>
userBalancePage
=
new
PageImpl
<>(
userBalances
,
pageable
,
count
);
return
userBalancePage
;
}
}
}
src/main/java/com/edgec/browserbackend/account/service/AdministratorService.java
View file @
bf327467
...
@@ -65,4 +65,6 @@ public interface AdministratorService {
...
@@ -65,4 +65,6 @@ public interface AdministratorService {
void
addUserWhiteList
(
String
username
,
String
website
);
void
addUserWhiteList
(
String
username
,
String
website
);
File
getProxyConfig
();
File
getProxyConfig
();
Page
<
UserBalance
>
getAllUserUsed
(
Pageable
pageable
);
}
}
src/main/java/com/edgec/browserbackend/account/service/impl/AccountServiceImpl.java
View file @
bf327467
...
@@ -507,9 +507,7 @@ public class AccountServiceImpl implements AccountService {
...
@@ -507,9 +507,7 @@ public class AccountServiceImpl implements AccountService {
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"13570690305"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"13570690305"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"13802945832"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
sendNewAccountSms
(
"13802945832"
,
com
.
edgec
.
browserbackend
.
common
.
commons
.
utils
.
SmsUtils
.
SmsTemplateCode
.
NEWACCOUNT
,
param
);
if
(
inviter
!=
null
)
{
paymentService
.
bankTransferInsertion
(
account
.
getName
(),
12
);
paymentService
.
bankTransferInsertion
(
account
.
getName
(),
12
);
}
log
.
info
(
"new account has been created: "
+
account
.
getName
());
log
.
info
(
"new account has been created: "
+
account
.
getName
());
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/AdministratorServiceImpl.java
View file @
bf327467
...
@@ -10,11 +10,12 @@ import com.edgec.browserbackend.account.repository.*;
...
@@ -10,11 +10,12 @@ import com.edgec.browserbackend.account.repository.*;
import
com.edgec.browserbackend.account.service.AdministratorService
;
import
com.edgec.browserbackend.account.service.AdministratorService
;
import
com.edgec.browserbackend.auth.service.UserService
;
import
com.edgec.browserbackend.auth.service.UserService
;
import
com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode
;
import
com.edgec.browserbackend.browser.ErrorCode.BrowserErrorCode
;
import
com.edgec.browserbackend.browser.domain.IpCountRecord
;
import
com.edgec.browserbackend.browser.domain.ProxyConfig
;
import
com.edgec.browserbackend.browser.domain.ProxyConfig
;
import
com.edgec.browserbackend.browser.repository.IpCountRecordRepository
;
import
com.edgec.browserbackend.browser.repository.IpResourceRepository
;
import
com.edgec.browserbackend.browser.repository.IpResourceRepository
;
import
com.edgec.browserbackend.browser.repository.ProxyConfigRepository
;
import
com.edgec.browserbackend.browser.repository.ProxyConfigRepository
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.error.ClientRequestException
;
import
com.edgec.browserbackend.common.commons.utils.DateConverter
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -29,9 +30,12 @@ import org.springframework.stereotype.Service;
...
@@ -29,9 +30,12 @@ import org.springframework.stereotype.Service;
import
java.io.File
;
import
java.io.File
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.Instant
;
import
java.time.ZoneOffset
;
import
java.time.ZoneOffset
;
import
java.time.ZonedDateTime
;
import
java.time.ZonedDateTime
;
import
java.time.temporal.ChronoUnit
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicLong
;
@Service
@Service
...
@@ -67,6 +71,9 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -67,6 +71,9 @@ public class AdministratorServiceImpl implements AdministratorService {
@Autowired
@Autowired
private
ProxyConfigRepository
proxyConfigRepository
;
private
ProxyConfigRepository
proxyConfigRepository
;
@Autowired
private
IpCountRecordRepository
ipCountRecordRepository
;
@Override
@Override
public
Administrator
createAdministrator
(
Administrator
administrator
)
{
public
Administrator
createAdministrator
(
Administrator
administrator
)
{
Administrator
administrator1
=
new
Administrator
();
Administrator
administrator1
=
new
Administrator
();
...
@@ -375,16 +382,31 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -375,16 +382,31 @@ public class AdministratorServiceImpl implements AdministratorService {
public
IpCountQueryResultDto
queyrIpCount
(
String
username
)
{
public
IpCountQueryResultDto
queyrIpCount
(
String
username
)
{
IpCountQueryResultDto
ipCountQueryResultDto
=
new
IpCountQueryResultDto
();
IpCountQueryResultDto
ipCountQueryResultDto
=
new
IpCountQueryResultDto
();
if
(
StringUtils
.
isBlank
(
username
))
{
if
(
StringUtils
.
isBlank
(
username
))
{
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
(
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeleted
AndValidTimeGreaterThan
(
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
count
();
long
ipcount_all
=
ipResourceRepository
.
count
();
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
IpCountRecord
ipCountRecord
=
ipCountRecordRepository
.
findFirstByUsernameAndTimestampBetween
(
"all"
,
Instant
.
now
().
minus
(
1
,
ChronoUnit
.
DAYS
).
toEpochMilli
(),
Instant
.
now
().
toEpochMilli
());
if
(
ipCountRecord
!=
null
)
{
ipCountQueryResultDto
.
setIpCount_all
(
ipCountRecord
.
getIp_all
());
ipCountQueryResultDto
.
setIpCount_using
(
ipCountRecord
.
getIp_using
());
}
}
else
{
}
else
{
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
(
username
,
false
);
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
username
,
false
,
Instant
.
now
().
toEpochMilli
()
);
long
ipcount_all
=
ipResourceRepository
.
countAllByOwner
(
username
);
long
ipcount_all
=
ipResourceRepository
.
countAllByOwner
(
username
);
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_using
(
ipcount_using
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
ipCountQueryResultDto
.
setIpCount_all
(
ipcount_all
);
IpCountRecord
ipCountRecord
=
ipCountRecordRepository
.
findFirstByUsernameAndTimestampBetween
(
username
,
Instant
.
now
().
minus
(
1
,
ChronoUnit
.
DAYS
).
toEpochMilli
(),
Instant
.
now
().
toEpochMilli
());
if
(
ipCountRecord
!=
null
)
{
ipCountQueryResultDto
.
setIpCount_all
(
ipCountRecord
.
getIp_all
());
ipCountQueryResultDto
.
setIpCount_using
(
ipCountRecord
.
getIp_using
());
}
}
}
return
ipCountQueryResultDto
;
return
ipCountQueryResultDto
;
}
}
...
@@ -420,6 +442,7 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -420,6 +442,7 @@ public class AdministratorServiceImpl implements AdministratorService {
List
<
Account
>
accounts
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
List
<
Account
>
accounts
=
accountRepository
.
findAllBySignupDateBetweenAndPromotionCodeAndParentIsNull
(
dateTime1
,
dateTime2
,
account
.
getPromotion
().
getCode
());
Promotion
promotion
=
new
Promotion
();
Promotion
promotion
=
new
Promotion
();
Account
finalAccount
=
account
;
Account
finalAccount
=
account
;
AtomicLong
ipCount
=
new
AtomicLong
();
if
(
accounts
!=
null
&&
accounts
.
size
()
>
0
)
{
if
(
accounts
!=
null
&&
accounts
.
size
()
>
0
)
{
accounts
.
forEach
(
x
->
{
accounts
.
forEach
(
x
->
{
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
promotion
.
setInvitedUsers
(
promotion
.
getInvitedUsers
()
+
1
);
...
@@ -430,10 +453,12 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -430,10 +453,12 @@ public class AdministratorServiceImpl implements AdministratorService {
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setTotalCommission
(
promotion
.
getTotalCommission
()
+
(
int
)
totalCommission
);
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
promotion
.
setCommission
(
promotion
.
getCommission
()
+
x
.
getPromotion
().
getCommission
());
double
secondCommission
=
0
;
double
secondCommission
=
0
;
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeletedAndValidTimeGreaterThan
(
x
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
()));
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
if
(
finalAccount
.
getPromotion
().
isSale
()
&&
x
.
getParent
()
==
null
)
{
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCodeAndParentIsNull
(
x
.
getPromotion
().
getCode
());
List
<
Account
>
secondPromotes
=
accountRepository
.
findByPromotionCodeAndParentIsNull
(
x
.
getPromotion
().
getCode
());
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
if
(
secondPromotes
!=
null
&&
secondPromotes
.
size
()
>
0
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
for
(
Account
secondPromote
:
secondPromotes
)
{
ipCount
.
addAndGet
(
ipResourceRepository
.
countAllByOwnerAndIsDeletedAndValidTimeGreaterThan
(
secondPromote
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
()));
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findByAdministratorAndPayMethodInAndTimestampBetween
(
secondPromote
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
List
<
UserPrePaidBilling
>
userPrePaidBillings1
=
userPrePaidBillingRepository
.
findByAdministratorAndPayMethodInAndTimestampBetween
(
secondPromote
.
getName
(),
Arrays
.
asList
(
1
,
2
,
3
),
dateTime1
.
getTime
(),
dateTime2
.
getTime
());
if
(
userPrePaidBillings1
!=
null
&&
userPrePaidBillings1
.
size
()
>
0
)
if
(
userPrePaidBillings1
!=
null
&&
userPrePaidBillings1
.
size
()
>
0
)
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
secondCommission
+=
userPrePaidBillings1
.
stream
().
mapToDouble
(
UserPrePaidBilling:
:
getTotal
).
sum
();
...
@@ -450,7 +475,7 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -450,7 +475,7 @@ public class AdministratorServiceImpl implements AdministratorService {
});
});
}
}
promotionQueryResultDto
.
setPromotion
(
promotion
);
promotionQueryResultDto
.
setPromotion
(
promotion
);
promotionQueryResultDto
.
setIpCount
(
ipCount
.
get
());
return
promotionQueryResultDto
;
return
promotionQueryResultDto
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
log
.
error
(
e
.
getMessage
(),
e
);
...
@@ -488,6 +513,12 @@ public class AdministratorServiceImpl implements AdministratorService {
...
@@ -488,6 +513,12 @@ public class AdministratorServiceImpl implements AdministratorService {
return
null
;
return
null
;
}
}
@Override
public
Page
<
UserBalance
>
getAllUserUsed
(
Pageable
pageable
)
{
Page
<
UserBalance
>
userBalances
=
userBalanceRepository
.
findAllOrderByUsedDesc
(
pageable
);
return
userBalances
;
}
}
}
...
...
src/main/java/com/edgec/browserbackend/browser/domain/IpCountRecord.java
0 → 100644
View file @
bf327467
package
com
.
edgec
.
browserbackend
.
browser
.
domain
;
import
org.springframework.data.mongodb.core.mapping.Document
;
@Document
(
collection
=
"ipcountrecord"
)
public
class
IpCountRecord
{
private
String
username
;
private
long
timestamp
;
private
long
ip_using
;
private
long
ip_all
;
public
String
getUsername
()
{
return
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
long
getIp_all
()
{
return
ip_all
;
}
public
void
setIp_all
(
long
ip_all
)
{
this
.
ip_all
=
ip_all
;
}
public
long
getIp_using
()
{
return
ip_using
;
}
public
void
setIp_using
(
long
ip_using
)
{
this
.
ip_using
=
ip_using
;
}
public
long
getTimestamp
()
{
return
timestamp
;
}
public
void
setTimestamp
(
long
timestamp
)
{
this
.
timestamp
=
timestamp
;
}
}
src/main/java/com/edgec/browserbackend/browser/repository/IpCountRecordRepository.java
0 → 100644
View file @
bf327467
package
com
.
edgec
.
browserbackend
.
browser
.
repository
;
import
com.edgec.browserbackend.browser.domain.IpCountRecord
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
public
interface
IpCountRecordRepository
extends
MongoRepository
<
IpCountRecord
,
String
>
{
IpCountRecord
findFirstByUsernameAndTimestampBetween
(
String
username
,
long
begin
,
long
end
);
}
src/main/java/com/edgec/browserbackend/browser/repository/IpResourceRepository.java
View file @
bf327467
...
@@ -22,6 +22,9 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
...
@@ -22,6 +22,9 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
List
<
IpResource
>
findByOwnerAndIsDeletedAndShopIdIsNull
(
String
owner
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerAndIsDeletedAndShopIdIsNull
(
String
owner
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
String
owner
,
List
<
Integer
>
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
String
owner
,
List
<
Integer
>
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
String
owner
,
int
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
String
owner
,
int
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerInAndIsDeletedAndShopIdIsNull
(
List
<
String
>
owner
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerInAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
List
<
String
>
owner
,
List
<
Integer
>
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByOwnerInAndStatusAndIsDeletedAndShopIdIsNull
(
List
<
String
>
owner
,
int
status
,
boolean
isDeleted
);
List
<
IpResource
>
findByStatusAndShopIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
List
<
IpResource
>
findByStatusAndShopIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
Page
<
IpResource
>
findByIsDeletedAndIdInAndAddrLikeOrderByPurchasedTimeDesc
(
boolean
isDeleted
,
List
<
String
>
ipIds
,
String
addr
,
Pageable
pageable
);
Page
<
IpResource
>
findByIsDeletedAndIdInAndAddrLikeOrderByPurchasedTimeDesc
(
boolean
isDeleted
,
List
<
String
>
ipIds
,
String
addr
,
Pageable
pageable
);
Page
<
IpResource
>
findByIsDeletedAndIdInAndVendorCnLikeOrderByPurchasedTimeDesc
(
boolean
isDeleted
,
List
<
String
>
ipIds
,
String
vendorCn
,
Pageable
pageable
);
Page
<
IpResource
>
findByIsDeletedAndIdInAndVendorCnLikeOrderByPurchasedTimeDesc
(
boolean
isDeleted
,
List
<
String
>
ipIds
,
String
vendorCn
,
Pageable
pageable
);
...
@@ -44,8 +47,8 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
...
@@ -44,8 +47,8 @@ public interface IpResourceRepository extends MongoRepository<IpResource, String
int
countByStatusAndIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
int
countByStatusAndIdInAndIsDeleted
(
int
status
,
List
<
String
>
ipIds
,
boolean
isDeleted
);
long
countAllByIsDeleted
(
boolean
isDeleted
);
long
countAllByIsDeleted
AndValidTimeGreaterThan
(
boolean
isDeleted
,
long
time
);
long
countAllByOwnerAndIsDeleted
(
String
username
,
boolean
isDeleted
);
long
countAllByOwnerAndIsDeleted
AndValidTimeGreaterThan
(
String
username
,
boolean
isDeleted
,
long
time
);
long
countAllByOwner
(
String
username
);
long
countAllByOwner
(
String
username
);
}
}
src/main/java/com/edgec/browserbackend/browser/service/Impl/IpResourceServiceImpl.java
View file @
bf327467
...
@@ -558,21 +558,42 @@ public class IpResourceServiceImpl implements IpResourceService {
...
@@ -558,21 +558,42 @@ public class IpResourceServiceImpl implements IpResourceService {
List
<
IpResource
>
ipResources
=
new
ArrayList
<>();
List
<
IpResource
>
ipResources
=
new
ArrayList
<>();
List
<
IpResource
>
notUsed
=
null
;
List
<
IpResource
>
notUsed
=
null
;
List
<
String
>
children
=
new
ArrayList
<>();
boolean
isParent
=
false
;
if
(
account
.
getParent
()
==
null
)
{
isParent
=
true
;
children
=
accountRepository
.
findByParent
(
account
.
getName
()).
stream
().
map
(
Account:
:
getName
).
collect
(
Collectors
.
toList
());
}
children
.
add
(
account
.
getName
());
switch
(
groupType
)
{
switch
(
groupType
)
{
case
1
:
case
1
:
ipResources
=
ipResourceRepository
.
findByShopIdInAndIsDeleted
(
shopIds
,
false
);
ipResources
=
ipResourceRepository
.
findByShopIdInAndIsDeleted
(
shopIds
,
false
);
notUsed
=
ipResourceRepository
.
findByOwnerAndIsDeletedAndShopIdIsNull
(
username
,
false
);
if
(!
isParent
)
notUsed
=
ipResourceRepository
.
findByOwnerAndIsDeletedAndShopIdIsNull
(
username
,
false
);
else
notUsed
=
ipResourceRepository
.
findByOwnerInAndIsDeletedAndShopIdIsNull
(
children
,
false
);
break
;
break
;
case
2
:
case
2
:
ipResources
=
ipResourceRepository
.
findByStatusAndShopIdInAndIsDeleted
(
2
,
shopIds
,
false
);
ipResources
=
ipResourceRepository
.
findByStatusAndShopIdInAndIsDeleted
(
2
,
shopIds
,
false
);
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
username
,
2
,
false
);
if
(!
isParent
)
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
username
,
2
,
false
);
else
notUsed
=
ipResourceRepository
.
findByOwnerInAndStatusAndIsDeletedAndShopIdIsNull
(
children
,
2
,
false
);
break
;
break
;
case
3
:
case
3
:
ipResources
=
ipResourceRepository
.
findByStatusAndShopIdInAndIsDeleted
(
1
,
shopIds
,
false
);
ipResources
=
ipResourceRepository
.
findByStatusAndShopIdInAndIsDeleted
(
1
,
shopIds
,
false
);
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
username
,
1
,
false
);
if
(!
isParent
)
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusAndIsDeletedAndShopIdIsNull
(
username
,
1
,
false
);
else
notUsed
=
ipResourceRepository
.
findByOwnerInAndStatusAndIsDeletedAndShopIdIsNull
(
children
,
1
,
false
);
break
;
break
;
case
4
:
case
4
:
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
username
,
Arrays
.
asList
(
3
,
5
,
6
),
false
);
if
(!
isParent
)
notUsed
=
ipResourceRepository
.
findByOwnerAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
username
,
Arrays
.
asList
(
3
,
5
,
6
),
false
);
else
notUsed
=
ipResourceRepository
.
findByOwnerInAndStatusIsNotInAndIsDeletedAndShopIdIsNull
(
children
,
Arrays
.
asList
(
3
,
5
,
6
),
false
);
break
;
break
;
}
}
if
(
notUsed
!=
null
)
if
(
notUsed
!=
null
)
...
...
src/main/java/com/edgec/browserbackend/browser/task/BrowserTask.java
View file @
bf327467
package
com
.
edgec
.
browserbackend
.
browser
.
task
;
package
com
.
edgec
.
browserbackend
.
browser
.
task
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.edgec.browserbackend.account.domain.Account
;
import
com.edgec.browserbackend.account.domain.IpChargeRequestDto
;
import
com.edgec.browserbackend.account.domain.IpChargeRequestDto
;
import
com.edgec.browserbackend.account.domain.QueryIpUrlList
;
import
com.edgec.browserbackend.account.domain.QueryIpUrlList
;
import
com.edgec.browserbackend.account.repository.AccountRepository
;
import
com.edgec.browserbackend.account.repository.QueryIpUrlListRepository
;
import
com.edgec.browserbackend.account.repository.QueryIpUrlListRepository
;
import
com.edgec.browserbackend.account.service.AccountService
;
import
com.edgec.browserbackend.account.service.AccountService
;
import
com.edgec.browserbackend.browser.domain.IpCountRecord
;
import
com.edgec.browserbackend.browser.domain.IpResource
;
import
com.edgec.browserbackend.browser.domain.IpResource
;
import
com.edgec.browserbackend.browser.domain.IpType
;
import
com.edgec.browserbackend.browser.domain.IpType
;
import
com.edgec.browserbackend.browser.dto.IpBuyResultDto
;
import
com.edgec.browserbackend.browser.dto.IpBuyResultDto
;
import
com.edgec.browserbackend.browser.dto.IpInfoResultDto
;
import
com.edgec.browserbackend.browser.dto.IpInfoResultDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.dto.ShopRequestDto
;
import
com.edgec.browserbackend.browser.repository.IpCountRecordRepository
;
import
com.edgec.browserbackend.browser.repository.IpResourceRepository
;
import
com.edgec.browserbackend.browser.repository.IpResourceRepository
;
import
com.edgec.browserbackend.browser.service.IpAndShopService
;
import
com.edgec.browserbackend.browser.service.IpAndShopService
;
import
com.edgec.browserbackend.common.commons.utils.NotifyUtils
;
import
com.edgec.browserbackend.common.commons.utils.NotifyUtils
;
...
@@ -21,6 +25,7 @@ import org.slf4j.Logger;
...
@@ -21,6 +25,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.aggregation.ArrayOperators
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpEntity
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
@@ -62,6 +67,12 @@ public class BrowserTask {
...
@@ -62,6 +67,12 @@ public class BrowserTask {
@Autowired
@Autowired
private
QueryIpUrlListRepository
queryIpUrlListRepository
;
private
QueryIpUrlListRepository
queryIpUrlListRepository
;
@Autowired
private
IpCountRecordRepository
ipCountRecordRepository
;
@Autowired
private
AccountRepository
accountRepository
;
@Value
(
"${spring.profiles.active}"
)
@Value
(
"${spring.profiles.active}"
)
private
String
profiles
;
private
String
profiles
;
...
@@ -228,7 +239,11 @@ public class BrowserTask {
...
@@ -228,7 +239,11 @@ public class BrowserTask {
if
(
ipResourceRepository
.
healthLock
(
ipResource
))
{
if
(
ipResourceRepository
.
healthLock
(
ipResource
))
{
try
{
try
{
QueryIpUrlList
queryIpUrlList
=
queryIpUrlListRepository
.
findAll
().
get
(
0
);
QueryIpUrlList
queryIpUrlList
=
queryIpUrlListRepository
.
findAll
().
get
(
0
);
if
(
ipResource
.
isSpecialLine
())
{
if
(
ipResource
.
getValidTime
()
<=
Instant
.
now
().
toEpochMilli
()
&&
ipResource
.
getStatus
()
!=
3
&&
ipResource
.
getStatus
()
!=
6
)
{
ipResource
.
setStatus
(
1
);
ipResourceRepository
.
save
(
ipResource
);
}
else
if
(
ipResource
.
isSpecialLine
())
{
Trans
trans
=
new
Trans
(
ipResource
.
getProxyUsername
(),
ipResource
.
getProxyPassword
());
Trans
trans
=
new
Trans
(
ipResource
.
getProxyUsername
(),
ipResource
.
getProxyPassword
());
String
sp_result
=
trans
.
get
(
queryIpUrlList
.
getUrl
());
String
sp_result
=
trans
.
get
(
queryIpUrlList
.
getUrl
());
int
failTime
=
0
;
int
failTime
=
0
;
...
@@ -278,6 +293,33 @@ public class BrowserTask {
...
@@ -278,6 +293,33 @@ public class BrowserTask {
}
}
}
}
@Scheduled
(
cron
=
"0 0 0 * * ?"
)
public
void
countIp
()
{
List
<
Account
>
accounts
=
accountRepository
.
findAll
();
try
{
accounts
.
forEach
(
x
->
{
IpCountRecord
ipCountRecord
=
new
IpCountRecord
();
ipCountRecord
.
setUsername
(
x
.
getName
());
ipCountRecord
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
long
ipcount_using
=
ipResourceRepository
.
countAllByOwnerAndIsDeletedAndValidTimeGreaterThan
(
x
.
getName
(),
false
,
Instant
.
now
().
toEpochMilli
());
long
ipcount_all
=
ipResourceRepository
.
countAllByOwner
(
x
.
getName
());
ipCountRecord
.
setIp_all
(
ipcount_all
);
ipCountRecord
.
setIp_using
(
ipcount_using
);
ipCountRecordRepository
.
save
(
ipCountRecord
);
});
IpCountRecord
ipCountRecord
=
new
IpCountRecord
();
ipCountRecord
.
setUsername
(
"all"
);
ipCountRecord
.
setTimestamp
(
Instant
.
now
().
toEpochMilli
());
long
ipcount_using
=
ipResourceRepository
.
countAllByIsDeletedAndValidTimeGreaterThan
(
false
,
Instant
.
now
().
toEpochMilli
());
long
ipcount_all
=
ipResourceRepository
.
count
();
ipCountRecord
.
setIp_using
(
ipcount_using
);
ipCountRecord
.
setIp_all
(
ipcount_all
);
ipCountRecordRepository
.
save
(
ipCountRecord
);
}
catch
(
Exception
e
)
{
log
.
error
(
"统计IpCount error"
,
e
);
}
}
public
static
class
HttpClientutils
{
public
static
class
HttpClientutils
{
static
OkHttpClient
.
Builder
builder
=
new
OkHttpClient
.
Builder
();
static
OkHttpClient
.
Builder
builder
=
new
OkHttpClient
.
Builder
();
...
@@ -306,19 +348,23 @@ public class BrowserTask {
...
@@ -306,19 +348,23 @@ public class BrowserTask {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
url
=
CLOUDAMURL
+
"/ecc/ipinfo?accountId=browser&ip="
+
"100.25.101.201"
;
// String url = CLOUDAMURL + "/ecc/ipinfo?accountId=browser&ip=" + "100.25.101.201";
String
profiles
=
"prod"
;
// String profiles = "prod";
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
// Map<String, String> headers = new HashMap<>();
headers
.
put
(
"Content-Type"
,
"application/json"
);
// headers.put("Content-Type", "application/json");
if
(
profiles
.
equals
(
"dev"
)
||
profiles
.
equals
(
"staging"
))
// if (profiles.equals("dev") || profiles.equals("staging"))
headers
.
put
(
"Authorization"
,
"Bearer oq5tg3gMsflHcK5iZ2741G5R30XYd9blyOqH9qeBItKtrzfTsGIoy8AsxqqNXdcm"
);
// headers.put("Authorization", "Bearer oq5tg3gMsflHcK5iZ2741G5R30XYd9blyOqH9qeBItKtrzfTsGIoy8AsxqqNXdcm");
else
if
(
profiles
.
equals
(
"prod"
))
// else if (profiles.equals("prod"))
headers
.
put
(
"Authorization"
,
"Bearer tKWsuHzcngf0RQPMss70f9jgymDIwgQ9zbLfESJdcou3pZSNWl7lNTzto8VQgwaO"
);
// headers.put("Authorization", "Bearer tKWsuHzcngf0RQPMss70f9jgymDIwgQ9zbLfESJdcou3pZSNWl7lNTzto8VQgwaO");
//
// String rs = HttpClientutils.doGet(url, headers);
// System.out.println(rs);
// IpInfoResultDto ipInfoResultDto = JSONObject.parseObject(rs, IpInfoResultDto.class);
// System.out.println(ipInfoResultDto);
String
rs
=
HttpClientutils
.
doGet
(
url
,
headers
);
Trans
trans
=
new
Trans
(
"8.208.28.192"
,
"962MrDCCd2pvaA1"
);
System
.
out
.
println
(
rs
);
String
sp_result
=
trans
.
get
(
"http://pv.sohu.com/cityjson"
);
IpInfoResultDto
ipInfoResultDto
=
JSONObject
.
parseObject
(
rs
,
IpInfoResultDto
.
class
);
System
.
out
.
println
(
sp_result
);
System
.
out
.
println
(
ipInfoResultDto
);
}
}
...
...
src/main/java/com/edgec/browserbackend/common/utils/Trans.java
View file @
bf327467
...
@@ -23,7 +23,7 @@ import java.io.InputStreamReader;
...
@@ -23,7 +23,7 @@ import java.io.InputStreamReader;
public
class
Trans
{
public
class
Trans
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Trans
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
Trans
.
class
);
static
int
timeout
=
10
*
1000
;
// 以秒为单位
static
int
timeout
=
10
*
1000
;
// 以秒为单位
private
static
String
specialHost
=
"39.108.183.128"
;
//117.177.243.7
private
static
String
specialHost
=
"39.108.183.128"
;
private
static
int
specialPort
=
20008
;
private
static
int
specialPort
=
20008
;
private
String
host
;
private
String
host
;
private
int
port
;
private
int
port
;
...
@@ -71,9 +71,9 @@ public class Trans {
...
@@ -71,9 +71,9 @@ public class Trans {
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
.
setProxy
(
proxy
)
.
setProxy
(
proxy
)
.
setConnectTimeout
(
2
000
)
.
setConnectTimeout
(
5
000
)
.
setSocketTimeout
(
2
000
)
.
setSocketTimeout
(
5
000
)
.
setConnectionRequestTimeout
(
2
000
)
.
setConnectionRequestTimeout
(
5
000
)
.
build
();
.
build
();
httpGet
.
setConfig
(
requestConfig
);
httpGet
.
setConfig
(
requestConfig
);
...
...
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