Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
bab6d0a4
Commit
bab6d0a4
authored
Nov 14, 2021
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加用户相关entity
parent
8ace2dbe
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
369997 additions
and
0 deletions
+369997
-0
OauthClientDetailsController.java
...er/internal/user/center/OauthClientDetailsController.java
+53
-0
CustomerInfoEntity.java
...in/java/cn/quantgroup/xyqb/entity/CustomerInfoEntity.java
+288
-0
CustomerLoginEntity.java
...n/java/cn/quantgroup/xyqb/entity/CustomerLoginEntity.java
+103
-0
EntityBuilder.java
src/main/java/cn/quantgroup/xyqb/entity/EntityBuilder.java
+33
-0
OauthClientDetailsEntity.java
...a/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
+224
-0
ProductLoginEntity.java
...in/java/cn/quantgroup/xyqb/entity/ProductLoginEntity.java
+203
-0
BasicEntity.java
...ava/cn/quantgroup/xyqb/entity/baseEntity/BasicEntity.java
+4
-0
OptimisticEntity.java
...n/quantgroup/xyqb/entity/baseEntity/OptimisticEntity.java
+103
-0
PartitionEntity.java
...cn/quantgroup/xyqb/entity/baseEntity/PartitionEntity.java
+32
-0
PersistentKey.java
...a/cn/quantgroup/xyqb/entity/baseEntity/PersistentKey.java
+5
-0
ICustomerInfoRepository.java
...n/quantgroup/xyqb/repository/ICustomerInfoRepository.java
+13
-0
ICustomerLoginRepository.java
.../quantgroup/xyqb/repository/ICustomerLoginRepository.java
+15
-0
IOauthClientDetailsRepository.java
...tgroup/xyqb/repository/IOauthClientDetailsRepository.java
+16
-0
IProductLoginRepository.java
...n/quantgroup/xyqb/repository/IProductLoginRepository.java
+23
-0
IOauthClientDetailsService.java
...ntgroup/xyqb/service/user/IOauthClientDetailsService.java
+14
-0
IOauthLoginInfoService.java
.../quantgroup/xyqb/service/user/IOauthLoginInfoService.java
+13
-0
OauthClientDetailsServiceImpl.java
...xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
+57
-0
OauthLoginInfoServiceImpl.java
...oup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
+99
-0
StringUtils.java
src/main/java/cn/quantgroup/xyqb/util/StringUtils.java
+55
-0
xyqb-user2.2021-11-13-0.log
xyqb-user2.2021-11-13-0.log
+368644
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/center/OauthClientDetailsController.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
controller
.
internal
.
user
.
center
;
import
cn.quantgroup.user.enums.*
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator
;
import
cn.quantgroup.xyqb.aspect.lock.RedisLock
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.event.UserExtInfoSaveEvent
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.service.user.*
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by 11 on 2017/3/22.
*/
@Slf4j
@RestController
@RequestMapping
(
"/oauthClient"
)
public
class
OauthClientDetailsController
{
@Autowired
private
IOauthClientDetailsService
oauthClientDetailsService
;
@Autowired
private
IOauthLoginInfoService
oauthLoginInfoService
;
@PostMapping
(
"/getOauthClient"
)
public
JsonResult
getOauthClient
(
Long
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsService
.
findFirstByClientId
(
clientId
);
return
JsonResult
.
buildSuccessResultGeneric
(
oauthClientDetailsEntity
);
}
@PostMapping
(
"/addLoginInfo"
)
public
JsonResult
addLoginInfo
(
Long
clientId
,
String
phoneNo
)
{
User
user
=
new
User
();
user
.
setPhoneNo
(
phoneNo
);
user
.
setId
(
new
Long
(
"111111"
));
oauthLoginInfoService
.
addLoginInfo
(
user
,
clientId
);
return
JsonResult
.
buildSuccessResultGeneric
(
"12"
);
}
}
src/main/java/cn/quantgroup/xyqb/entity/CustomerInfoEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity
;
import
cn.quantgroup.xyqb.util.StringUtils
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/9/23
* @Time: 11:02
* Description: No Description
*/
@Entity
@Table
(
name
=
"customer_info"
)
public
class
CustomerInfoEntity
extends
PartitionEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3639362579605273102L
;
private
final
static
String
CLASS_NAME
=
CustomerInfoEntity
.
class
.
getSimpleName
();
@Id
@Column
(
name
=
"ID"
,
nullable
=
false
)
private
long
id
;
@Column
(
name
=
"CUSTOMER_ID"
,
nullable
=
false
)
private
long
customerId
;
@Column
(
name
=
"INSTITUTION_ID"
,
nullable
=
false
,
length
=
4
)
private
String
institutionId
;
@Column
(
name
=
"AVATAR_URL"
,
nullable
=
true
,
length
=
255
)
private
String
avatarUrl
;
@Column
(
name
=
"NICK_NAME"
,
nullable
=
true
,
length
=
50
)
private
String
nickName
;
@Column
(
name
=
"CITY"
,
nullable
=
true
,
length
=
36
)
private
String
city
;
@Column
(
name
=
"CITY_CODE"
,
nullable
=
true
)
private
Long
cityCode
;
@Column
(
name
=
"COUNTRY"
,
nullable
=
true
,
length
=
50
)
private
String
country
;
@Column
(
name
=
"LANGUAGE"
,
nullable
=
true
,
length
=
30
)
private
String
language
;
@Column
(
name
=
"SOURCE_OPEN_ID"
,
nullable
=
true
,
length
=
128
)
private
String
sourceOpenId
;
@Column
(
name
=
"PRIVILEAGE"
,
nullable
=
true
,
length
=
255
)
private
String
privileage
;
@Column
(
name
=
"PROVINCE"
,
nullable
=
true
,
length
=
30
)
private
String
province
;
@Column
(
name
=
"PROVINCE_CODE"
,
nullable
=
true
)
private
Long
provinceCode
;
@Column
(
name
=
"SEX"
,
nullable
=
true
)
private
Byte
sex
;
@Column
(
name
=
"UNION_ID"
,
nullable
=
true
,
length
=
128
)
private
String
unionId
;
@Column
(
name
=
"UTM_SOURCE"
,
nullable
=
true
,
length
=
50
)
private
String
utmSource
;
@Column
(
name
=
"NAME"
,
nullable
=
true
,
length
=
50
)
private
String
name
;
@Column
(
name
=
"ID_CARD_NO"
,
nullable
=
true
,
length
=
32
)
private
String
idCardNo
;
@Column
(
name
=
"ID_CARD_TYPE"
,
nullable
=
true
)
private
Byte
idCardType
;
@Column
(
name
=
"BIRTHDAY"
,
nullable
=
true
,
length
=
30
)
private
String
birthday
;
@Column
(
name
=
"PRODUCT_ID"
,
nullable
=
false
)
private
String
productId
;
@Column
(
name
=
"SOURCE_TYPE"
,
nullable
=
true
,
length
=
255
)
private
String
sourceType
;
@Column
(
name
=
"TELEPHONE"
,
nullable
=
true
,
length
=
32
)
private
String
telephone
;
public
long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
long
customerId
)
{
this
.
customerId
=
customerId
;
}
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getAvatarUrl
()
{
return
avatarUrl
;
}
public
void
setAvatarUrl
(
String
avatarUrl
)
{
this
.
avatarUrl
=
avatarUrl
;
}
public
String
getNickName
()
{
return
nickName
;
}
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
Long
getCityCode
()
{
return
cityCode
;
}
public
void
setCityCode
(
Long
cityCode
)
{
this
.
cityCode
=
cityCode
;
}
public
String
getCountry
()
{
return
country
;
}
public
void
setCountry
(
String
country
)
{
this
.
country
=
country
;
}
public
String
getLanguage
()
{
return
language
;
}
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
public
String
getSourceOpenId
()
{
return
sourceOpenId
;
}
public
void
setSourceOpenId
(
String
sourceOpenId
)
{
this
.
sourceOpenId
=
sourceOpenId
;
}
public
String
getPrivileage
()
{
return
privileage
;
}
public
void
setPrivileage
(
String
privileage
)
{
this
.
privileage
=
privileage
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
Long
getProvinceCode
()
{
return
provinceCode
;
}
public
void
setProvinceCode
(
Long
provinceCode
)
{
this
.
provinceCode
=
provinceCode
;
}
public
Byte
getSex
()
{
return
sex
;
}
public
void
setSex
(
Byte
sex
)
{
this
.
sex
=
sex
;
}
public
String
getUnionId
()
{
return
unionId
;
}
public
void
setUnionId
(
String
unionId
)
{
this
.
unionId
=
unionId
;
}
public
String
getUtmSource
()
{
return
utmSource
;
}
public
void
setUtmSource
(
String
utmSource
)
{
this
.
utmSource
=
utmSource
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getIdCardNo
()
{
return
idCardNo
;
}
public
void
setIdCardNo
(
String
idCardNo
)
{
this
.
idCardNo
=
idCardNo
;
}
public
Byte
getIdCardType
()
{
return
idCardType
;
}
public
void
setIdCardType
(
Byte
idCardType
)
{
this
.
idCardType
=
idCardType
;
}
public
String
getBirthday
()
{
return
birthday
;
}
public
void
setBirthday
(
String
birthday
)
{
this
.
birthday
=
birthday
;
}
public
String
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
String
productId
)
{
this
.
productId
=
productId
;
}
public
String
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
String
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
public
String
getTelephone
()
{
return
telephone
;
}
public
void
setTelephone
(
String
telephone
)
{
this
.
telephone
=
telephone
;
}
@Override
public
String
getPersistentKey
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
customerId
,
institutionId
);
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/CustomerLoginEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity
;
import
cn.quantgroup.xyqb.util.StringUtils
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Objects
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/9/23
* @Time: 11:02
* Description: No Description
*/
@Entity
@Table
(
name
=
"customer_login"
)
public
class
CustomerLoginEntity
extends
PartitionEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
6859480785575072675L
;
private
final
static
String
CLASS_NAME
=
CustomerLoginEntity
.
class
.
getSimpleName
();
@Id
@Column
(
name
=
"ID"
,
nullable
=
false
)
private
long
id
;
@Column
(
name
=
"INSTITUTION_ID"
,
nullable
=
false
,
length
=
4
)
private
String
institutionId
;
@Column
(
name
=
"PRODUCT_ID"
,
nullable
=
false
,
length
=
4
)
private
String
productId
;
@Column
(
name
=
"CUSTOMER_ID"
,
nullable
=
false
)
private
long
customerId
;
@Column
(
name
=
"UUID"
,
nullable
=
true
)
private
String
uuid
;
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
String
productId
)
{
this
.
productId
=
productId
;
}
public
long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
long
customerId
)
{
this
.
customerId
=
customerId
;
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
CustomerLoginEntity
that
=
(
CustomerLoginEntity
)
o
;
return
customerId
==
that
.
customerId
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
institutionId
,
productId
,
customerId
,
uuid
);
}
@Override
public
String
getPersistentKey
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
institutionId
,
productId
,
customerId
);
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/EntityBuilder.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
java.time.LocalDate
;
import
java.util.Date
;
/**
* Created by Administrator on 2021/8/27 0027.
*/
public
class
EntityBuilder
{
public
static
ProductLoginEntity
productLogin
(
String
productId
,
String
institutionId
,
String
phoneNo
,
Long
customerId
,
String
customerName
,
Integer
partitionKey
,
Long
id
)
{
ProductLoginEntity
entity
=
new
ProductLoginEntity
();
entity
.
setId
(
id
);
entity
.
setCustomerId
(
customerId
);
entity
.
setCustomerName
(
customerName
);
entity
.
setPhoneNo
(
phoneNo
);
entity
.
setProductId
(
productId
);
entity
.
setInstitutionId
(
institutionId
);
entity
.
setPartitionKey
(
partitionKey
);
entity
.
setPassword
(
""
);
entity
.
setSaltValue
(
""
);
entity
.
setStatus
(
""
);
entity
.
setBatchNo
(
1
);
entity
.
setCreatedDate
(
new
Date
());
entity
.
setModifiedDate
(
new
Date
());
entity
.
setCreatedBy
(
""
);
entity
.
setModifiedBy
(
""
);
return
entity
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/OauthClientDetailsEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
cn.quantgroup.xyqb.entity.baseEntity.OptimisticEntity
;
import
cn.quantgroup.xyqb.util.StringUtils
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.util.Objects
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/9/23
* @Time: 11:02
* Description: No Description
*/
@Entity
@Table
(
name
=
"oauth_client_details"
)
public
class
OauthClientDetailsEntity
extends
OptimisticEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
3521505570429896355L
;
private
final
static
String
CLASS_NAME
=
OauthClientDetailsEntity
.
class
.
getSimpleName
();
@Id
@Column
(
name
=
"CLIENT_ID"
,
nullable
=
false
)
private
long
clientId
;
@Column
(
name
=
"INSTITUTION_ID"
,
nullable
=
false
,
length
=
4
)
private
String
institutionId
;
@Column
(
name
=
"PRODUCT_ID"
,
nullable
=
false
,
length
=
4
)
private
String
productId
;
@Column
(
name
=
"ENCRYPTION_TYPE"
,
nullable
=
false
,
length
=
4
)
private
String
encryptionType
;
@Column
(
name
=
"ENABLE"
,
nullable
=
false
,
length
=
4
)
private
String
enable
;
@Column
(
name
=
"RESOURCE_IDS"
,
nullable
=
true
,
length
=
255
)
private
String
resourceIds
;
@Column
(
name
=
"CLIENT_SECRET"
,
nullable
=
false
,
length
=
255
)
private
String
clientSecret
;
@Column
(
name
=
"SCOPE"
,
nullable
=
true
,
length
=
255
)
private
String
scope
;
@Column
(
name
=
"AUTHORIZED_GRANT_TYPES"
,
nullable
=
true
,
length
=
255
)
private
String
authorizedGrantTypes
;
@Column
(
name
=
"WEB_SERVER_REDIRECT_URI"
,
nullable
=
true
,
length
=
255
)
private
String
webServerRedirectUri
;
@Column
(
name
=
"AUTHORITIES"
,
nullable
=
true
,
length
=
255
)
private
String
authorities
;
@Column
(
name
=
"ACCESS_TOKEN_VALIDITY"
,
nullable
=
true
)
private
Integer
accessTokenValidity
;
@Column
(
name
=
"REFRESH_TOKEN_VALIDITY"
,
nullable
=
true
)
private
Integer
refreshTokenValidity
;
@Column
(
name
=
"ADDITIONAL_INFORMATION"
,
nullable
=
true
,
length
=
4096
)
private
String
additionalInformation
;
@Column
(
name
=
"AUTOAPPROVE"
,
nullable
=
true
,
length
=
255
)
private
String
autoapprove
;
@Column
(
name
=
"SMS_REGISTER_TEMPLATE"
,
nullable
=
true
,
length
=
255
)
private
String
smsRegisterTemplate
;
public
long
getClientId
()
{
return
clientId
;
}
public
void
setClientId
(
long
clientId
)
{
this
.
clientId
=
clientId
;
}
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
String
productId
)
{
this
.
productId
=
productId
;
}
public
String
getEncryptionType
()
{
return
encryptionType
;
}
public
void
setEncryptionType
(
String
encryptionType
)
{
this
.
encryptionType
=
encryptionType
;
}
public
String
getEnable
()
{
return
enable
;
}
public
void
setEnable
(
String
enable
)
{
this
.
enable
=
enable
;
}
public
String
getResourceIds
()
{
return
resourceIds
;
}
public
void
setResourceIds
(
String
resourceIds
)
{
this
.
resourceIds
=
resourceIds
;
}
public
String
getClientSecret
()
{
return
clientSecret
;
}
public
void
setClientSecret
(
String
clientSecret
)
{
this
.
clientSecret
=
clientSecret
;
}
public
String
getScope
()
{
return
scope
;
}
public
void
setScope
(
String
scope
)
{
this
.
scope
=
scope
;
}
public
String
getAuthorizedGrantTypes
()
{
return
authorizedGrantTypes
;
}
public
void
setAuthorizedGrantTypes
(
String
authorizedGrantTypes
)
{
this
.
authorizedGrantTypes
=
authorizedGrantTypes
;
}
public
String
getWebServerRedirectUri
()
{
return
webServerRedirectUri
;
}
public
void
setWebServerRedirectUri
(
String
webServerRedirectUri
)
{
this
.
webServerRedirectUri
=
webServerRedirectUri
;
}
public
String
getAuthorities
()
{
return
authorities
;
}
public
void
setAuthorities
(
String
authorities
)
{
this
.
authorities
=
authorities
;
}
public
Integer
getAccessTokenValidity
()
{
return
accessTokenValidity
;
}
public
void
setAccessTokenValidity
(
Integer
accessTokenValidity
)
{
this
.
accessTokenValidity
=
accessTokenValidity
;
}
public
Integer
getRefreshTokenValidity
()
{
return
refreshTokenValidity
;
}
public
void
setRefreshTokenValidity
(
Integer
refreshTokenValidity
)
{
this
.
refreshTokenValidity
=
refreshTokenValidity
;
}
public
String
getAdditionalInformation
()
{
return
additionalInformation
;
}
public
void
setAdditionalInformation
(
String
additionalInformation
)
{
this
.
additionalInformation
=
additionalInformation
;
}
public
String
getAutoapprove
()
{
return
autoapprove
;
}
public
void
setAutoapprove
(
String
autoapprove
)
{
this
.
autoapprove
=
autoapprove
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
OauthClientDetailsEntity
that
=
(
OauthClientDetailsEntity
)
o
;
return
Objects
.
equals
(
clientId
,
that
.
clientId
)
&&
Objects
.
equals
(
institutionId
,
that
.
institutionId
)
&&
Objects
.
equals
(
productId
,
that
.
productId
)
&&
Objects
.
equals
(
encryptionType
,
that
.
encryptionType
)
&&
Objects
.
equals
(
enable
,
that
.
enable
)
&&
Objects
.
equals
(
resourceIds
,
that
.
resourceIds
)
&&
Objects
.
equals
(
clientSecret
,
that
.
clientSecret
)
&&
Objects
.
equals
(
scope
,
that
.
scope
)
&&
Objects
.
equals
(
authorizedGrantTypes
,
that
.
authorizedGrantTypes
)
&&
Objects
.
equals
(
webServerRedirectUri
,
that
.
webServerRedirectUri
)
&&
Objects
.
equals
(
authorities
,
that
.
authorities
)
&&
Objects
.
equals
(
accessTokenValidity
,
that
.
accessTokenValidity
)
&&
Objects
.
equals
(
refreshTokenValidity
,
that
.
refreshTokenValidity
)
&&
Objects
.
equals
(
additionalInformation
,
that
.
additionalInformation
)
&&
Objects
.
equals
(
autoapprove
,
that
.
autoapprove
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
clientId
,
institutionId
,
productId
,
encryptionType
,
enable
,
resourceIds
,
clientSecret
,
scope
,
authorizedGrantTypes
,
webServerRedirectUri
,
authorities
,
accessTokenValidity
,
refreshTokenValidity
,
additionalInformation
,
autoapprove
);
}
@Override
public
String
getPersistentKey
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
clientId
);
}
public
String
getSmsRegisterTemplate
()
{
return
smsRegisterTemplate
;
}
public
void
setSmsRegisterTemplate
(
String
smsRegisterTemplate
)
{
this
.
smsRegisterTemplate
=
smsRegisterTemplate
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/ProductLoginEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
;
import
cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity
;
import
cn.quantgroup.xyqb.util.StringUtils
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
import
java.util.Objects
;
/**
* Created with IntelliJ IDEA.
*
* @author: Li JianHua
* @Date: 2021/9/23
* @Time: 11:03
* Description: No Description
*/
@Entity
@Table
(
name
=
"product_login"
)
public
class
ProductLoginEntity
extends
PartitionEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
6495491112527859057L
;
private
final
static
String
CLASS_NAME
=
ProductLoginEntity
.
class
.
getSimpleName
();
@Id
@Column
(
name
=
"ID"
,
nullable
=
false
)
private
long
id
;
@Column
(
name
=
"CUSTOMER_ID"
,
nullable
=
false
)
private
long
customerId
;
@Column
(
name
=
"CUSTOMER_NAME"
,
nullable
=
false
,
length
=
255
)
private
String
customerName
;
@Column
(
name
=
"INSTITUTION_ID"
,
nullable
=
false
,
length
=
4
)
private
String
institutionId
;
@Column
(
name
=
"PHONE_NO"
,
nullable
=
false
,
length
=
15
)
private
String
phoneNo
;
@Column
(
name
=
"PASSWORD"
,
nullable
=
true
,
length
=
256
)
private
String
password
;
@Column
(
name
=
"SALT_VALUE"
,
nullable
=
true
,
length
=
128
)
private
String
saltValue
;
@Column
(
name
=
"STATUS"
,
nullable
=
false
,
length
=
4
)
private
String
status
;
@Column
(
name
=
"STATUS_DATE"
,
nullable
=
false
)
private
LocalDate
statusDate
;
@Column
(
name
=
"LAST_STATUS"
,
nullable
=
true
,
length
=
4
)
private
String
lastStatus
;
@Column
(
name
=
"LAST_LOGIN_TIME"
,
nullable
=
true
)
private
Integer
lastLoginTime
;
@Column
(
name
=
"BATCH_NO"
,
nullable
=
true
)
private
Integer
batchNo
;
@Column
(
name
=
"PRODUCT_ID"
,
nullable
=
false
,
length
=
4
)
private
String
productId
;
@Column
(
name
=
"EXTENSION_ACCOUNT_ID"
,
nullable
=
true
)
private
Long
extensionAccountId
;
public
long
getCustomerId
()
{
return
customerId
;
}
public
void
setCustomerId
(
long
customrId
)
{
this
.
customerId
=
customrId
;
}
public
String
getCustomerName
()
{
return
customerName
;
}
public
void
setCustomerName
(
String
customerName
)
{
this
.
customerName
=
customerName
;
}
public
String
getInstitutionId
()
{
return
institutionId
;
}
public
void
setInstitutionId
(
String
institutionId
)
{
this
.
institutionId
=
institutionId
;
}
public
String
getPhoneNo
()
{
return
phoneNo
;
}
public
void
setPhoneNo
(
String
phoneNo
)
{
this
.
phoneNo
=
phoneNo
;
}
public
String
getPassword
()
{
return
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
String
getSaltValue
()
{
return
saltValue
;
}
public
void
setSaltValue
(
String
saltValue
)
{
this
.
saltValue
=
saltValue
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
LocalDate
getStatusDate
()
{
return
statusDate
;
}
public
void
setStatusDate
(
LocalDate
statusDate
)
{
this
.
statusDate
=
statusDate
;
}
public
String
getLastStatus
()
{
return
lastStatus
;
}
public
void
setLastStatus
(
String
lastStatus
)
{
this
.
lastStatus
=
lastStatus
;
}
public
Integer
getLastLoginTime
()
{
return
lastLoginTime
;
}
public
void
setLastLoginTime
(
Integer
lastLoginTime
)
{
this
.
lastLoginTime
=
lastLoginTime
;
}
public
String
getProductId
()
{
return
productId
;
}
public
void
setProductId
(
String
productId
)
{
this
.
productId
=
productId
;
}
public
Long
getExtensionAccountId
()
{
return
extensionAccountId
;
}
public
void
setExtensionAccountId
(
Long
extensionAccountId
)
{
this
.
extensionAccountId
=
extensionAccountId
;
}
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
ProductLoginEntity
that
=
(
ProductLoginEntity
)
o
;
return
customerId
==
that
.
customerId
&&
statusDate
==
that
.
statusDate
&&
Objects
.
equals
(
customerName
,
that
.
customerName
)
&&
Objects
.
equals
(
institutionId
,
that
.
institutionId
)
&&
Objects
.
equals
(
phoneNo
,
that
.
phoneNo
)
&&
Objects
.
equals
(
password
,
that
.
password
)
&&
Objects
.
equals
(
saltValue
,
that
.
saltValue
)
&&
Objects
.
equals
(
status
,
that
.
status
)
&&
Objects
.
equals
(
lastStatus
,
that
.
lastStatus
)
&&
Objects
.
equals
(
lastLoginTime
,
that
.
lastLoginTime
)
&&
Objects
.
equals
(
productId
,
that
.
productId
)
&&
Objects
.
equals
(
extensionAccountId
,
that
.
extensionAccountId
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
customerId
,
customerName
,
institutionId
,
phoneNo
,
password
,
saltValue
,
status
,
statusDate
,
lastStatus
,
lastLoginTime
,
productId
,
extensionAccountId
);
}
@Override
public
String
getPersistentKey
()
{
return
StringUtils
.
toDelimitedString
(
CLASS_NAME
,
institutionId
,
productId
,
phoneNo
);
}
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Integer
getBatchNo
()
{
return
batchNo
;
}
public
void
setBatchNo
(
Integer
batchNo
)
{
this
.
batchNo
=
batchNo
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/baseEntity/BasicEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
.
baseEntity
;
public
interface
BasicEntity
{
}
src/main/java/cn/quantgroup/xyqb/entity/baseEntity/OptimisticEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
.
baseEntity
;
import
java.util.Date
;
import
javax.persistence.Column
;
import
javax.persistence.EntityListeners
;
import
javax.persistence.MappedSuperclass
;
import
javax.persistence.Version
;
import
javax.validation.constraints.NotNull
;
import
org.springframework.data.annotation.CreatedBy
;
import
org.springframework.data.annotation.CreatedDate
;
import
org.springframework.data.annotation.LastModifiedBy
;
import
org.springframework.data.annotation.LastModifiedDate
;
import
org.springframework.data.jpa.domain.support.AuditingEntityListener
;
@EntityListeners
({
AuditingEntityListener
.
class
})
@MappedSuperclass
public
abstract
class
OptimisticEntity
implements
PersistentKey
,
BasicEntity
{
@NotNull
@LastModifiedBy
@Column
(
name
=
"MODIFIED_BY"
,
nullable
=
false
,
updatable
=
false
,
length
=
36
)
private
String
modifiedBy
;
@NotNull
@LastModifiedDate
@Column
(
name
=
"MODIFIED_DATE"
,
nullable
=
false
)
private
Date
modifiedDate
;
@NotNull
@CreatedBy
@Column
(
name
=
"CREATED_BY"
,
nullable
=
false
,
updatable
=
false
,
length
=
36
)
public
String
createdBy
;
@NotNull
@CreatedDate
@Column
(
name
=
"CREATED_DATE"
,
nullable
=
false
,
updatable
=
false
)
public
Date
createdDate
;
@NotNull
@Version
@Column
(
name
=
"MODIFIED_NO"
,
nullable
=
false
)
private
Integer
modifiedNo
=
1
;
public
OptimisticEntity
()
{
}
public
String
getModifiedBy
()
{
return
this
.
modifiedBy
;
}
public
void
setModifiedBy
(
String
modifiedBy
)
{
this
.
modifiedBy
=
modifiedBy
;
}
public
Date
getModifiedDate
()
{
return
this
.
modifiedDate
;
}
public
void
setModifiedDate
(
Date
modifiedDate
)
{
this
.
modifiedDate
=
modifiedDate
;
}
public
String
getCreatedBy
()
{
return
this
.
createdBy
;
}
public
void
setCreatedBy
(
String
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
public
Date
getCreatedDate
()
{
return
this
.
createdDate
;
}
public
void
setCreatedDate
(
Date
createdDate
)
{
this
.
createdDate
=
createdDate
;
}
public
Integer
getModifiedNo
()
{
return
this
.
modifiedNo
;
}
public
void
setModifiedNo
(
Integer
modifiedNo
)
{
this
.
modifiedNo
=
modifiedNo
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/baseEntity/PartitionEntity.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
.
baseEntity
;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
import
javax.persistence.Column
;
import
javax.persistence.MappedSuperclass
;
@MappedSuperclass
public
abstract
class
PartitionEntity
extends
OptimisticEntity
{
@Column
(
name
=
"PARTITION_KEY"
,
nullable
=
false
,
updatable
=
false
)
private
Integer
partitionKey
;
public
PartitionEntity
()
{
}
public
Integer
getPartitionKey
()
{
return
this
.
partitionKey
;
}
public
void
setPartitionKey
(
Integer
partitionKey
)
{
this
.
partitionKey
=
partitionKey
;
}
}
src/main/java/cn/quantgroup/xyqb/entity/baseEntity/PersistentKey.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
entity
.
baseEntity
;
public
interface
PersistentKey
{
String
getPersistentKey
();
}
src/main/java/cn/quantgroup/xyqb/repository/ICustomerInfoRepository.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.CustomerInfoEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by Li Jianhua
*/
@Repository
public
interface
ICustomerInfoRepository
extends
JpaRepository
<
CustomerInfoEntity
,
Long
>
{
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/repository/ICustomerLoginRepository.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.CustomerLoginEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by hechao on 2020/2/17.
*/
@Repository
public
interface
ICustomerLoginRepository
extends
JpaRepository
<
CustomerLoginEntity
,
Long
>
{
CustomerLoginEntity
findFirstByCustomerId
(
long
customerId
);
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/repository/IOauthClientDetailsRepository.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
/**
* Created by hechao on 2020/2/17.
*/
@Repository
public
interface
IOauthClientDetailsRepository
extends
JpaRepository
<
OauthClientDetailsEntity
,
Long
>
{
OauthClientDetailsEntity
findFirstByClientId
(
Long
clientID
);
OauthClientDetailsEntity
findFirstByInstitutionIdAndProductId
(
String
institutionId
,
String
productId
);
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/repository/IProductLoginRepository.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
repository
;
import
cn.quantgroup.xyqb.entity.ProductLoginEntity
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
javax.transaction.Transactional
;
/**
* Li Jianhua
*/
@Repository
public
interface
IProductLoginRepository
extends
JpaRepository
<
ProductLoginEntity
,
Long
>
{
ProductLoginEntity
findFirstByInstitutionIdAndProductIdAndPhoneNo
(
String
institutionId
,
String
productId
,
String
phoneNo
);
ProductLoginEntity
findFirstByPhoneNo
(
String
phoneNo
);
}
\ No newline at end of file
src/main/java/cn/quantgroup/xyqb/service/user/IOauthClientDetailsService.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.Address
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
java.util.List
;
/**
* Created by Miraculous on 2017/1/3.
*/
public
interface
IOauthClientDetailsService
{
OauthClientDetailsEntity
findFirstByClientId
(
Long
clientId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/IOauthLoginInfoService.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
service
.
user
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.User
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* Created by Li Jianhua on 2017/1/3.
*/
public
interface
IOauthLoginInfoService
{
void
addLoginInfo
(
User
user
,
Long
clientId
);
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthClientDetailsServiceImpl.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.tech.db.DSType
;
import
cn.quantgroup.tech.db.TargetDataSource
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.entity.OauthClientDetailsEntity
;
import
cn.quantgroup.xyqb.entity.UserDetail
;
import
cn.quantgroup.xyqb.event.UserDetailUpdateEvent
;
import
cn.quantgroup.xyqb.model.Gender
;
import
cn.quantgroup.xyqb.model.IdCardInfo
;
import
cn.quantgroup.xyqb.model.IdType
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IUserDetailRepository
;
import
cn.quantgroup.xyqb.repository.IUserRepository
;
import
cn.quantgroup.xyqb.service.auth.IIdCardService
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IUserDetailService
;
import
cn.quantgroup.xyqb.service.user.vo.UserDetailVO
;
import
cn.quantgroup.xyqb.util.AddressFilter
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.dao.DataIntegrityViolationException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.persistence.criteria.Predicate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
OauthClientDetailsServiceImpl
implements
IOauthClientDetailsService
{
@Autowired
private
IOauthClientDetailsRepository
oauthClientDetailsRepository
;
@Override
public
OauthClientDetailsEntity
findFirstByClientId
(
Long
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
clientId
);
return
oauthClientDetailsEntity
;
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/OauthLoginInfoServiceImpl.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
service
.
user
.
impl
;
import
cn.quantgroup.xyqb.entity.*
;
import
cn.quantgroup.xyqb.repository.ICustomerInfoRepository
;
import
cn.quantgroup.xyqb.repository.ICustomerLoginRepository
;
import
cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository
;
import
cn.quantgroup.xyqb.repository.IProductLoginRepository
;
import
cn.quantgroup.xyqb.service.user.IOauthClientDetailsService
;
import
cn.quantgroup.xyqb.service.user.IOauthLoginInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDate
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* Created by 11 on 2016/12/29.
*/
@Slf4j
@Service
public
class
OauthLoginInfoServiceImpl
implements
IOauthLoginInfoService
{
@Autowired
private
IOauthClientDetailsRepository
oauthClientDetailsRepository
;
@Autowired
private
IProductLoginRepository
productLoginRepository
;
@Autowired
private
ICustomerInfoRepository
customerInfoRepository
;
@Autowired
private
ICustomerLoginRepository
customerLoginRepository
;
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
addLoginInfo
(
User
user
,
Long
clientId
)
{
OauthClientDetailsEntity
oauthClientDetailsEntity
=
oauthClientDetailsRepository
.
findFirstByClientId
(
clientId
);
String
institutionId
=
oauthClientDetailsEntity
.
getInstitutionId
();
String
productId
=
oauthClientDetailsEntity
.
getProductId
();
String
phoneNo
=
user
.
getPhoneNo
();
Long
userId
=
user
.
getId
();
ProductLoginEntity
productLoginEntity
=
productLoginRepository
.
findFirstByInstitutionIdAndProductIdAndPhoneNo
(
institutionId
,
productId
,
phoneNo
);
String
uuid
=
""
;
// 如果找不到该用户就创建
if
(
""
.
equals
(
productLoginEntity
)
||
productLoginEntity
==
null
)
{
// 添加用户到产品登录表
long
customerId
=
12321321
;
// long id = session.nextId();
long
id
=
1212
;
String
customerName
=
customerId
+
""
;
uuid
=
UUID
.
randomUUID
().
toString
();
ProductLoginEntity
entity
=
new
ProductLoginEntity
();
// Integer partitionKey = session.partitionKey(customerId);
Integer
partitionKey
=
2
;
productLoginEntity
=
EntityBuilder
.
productLogin
(
productId
,
institutionId
,
phoneNo
,
customerId
,
customerName
,
partitionKey
,
id
);
productLoginEntity
.
setExtensionAccountId
(
userId
);
productLoginRepository
.
save
(
productLoginEntity
);
// 根据customerId 获取uuid
CustomerLoginEntity
customerLoginEntity
=
customerLoginRepository
.
findFirstByCustomerId
(
productLoginEntity
.
getCustomerId
());
if
(
null
!=
customerLoginEntity
)
{
uuid
=
customerLoginEntity
.
getUuid
();
}
// 添加用户到登录表
CustomerLoginEntity
customerLogin
=
new
CustomerLoginEntity
();
customerLogin
.
setId
(
12312312
);
customerLogin
.
setInstitutionId
(
institutionId
);
customerLogin
.
setProductId
(
productId
);
customerLogin
.
setCustomerId
(
customerId
);
customerLogin
.
setUuid
(
uuid
);
customerLogin
.
setPartitionKey
(
partitionKey
);
customerLogin
.
setCreatedDate
(
new
Date
());
customerLogin
.
setModifiedDate
(
new
Date
());
customerLogin
.
setCreatedBy
(
""
);
customerLogin
.
setModifiedBy
(
""
);
customerLoginRepository
.
save
(
customerLogin
);
// 添加用户信息表
CustomerInfoEntity
customerInfo
=
new
CustomerInfoEntity
();
customerInfo
.
setId
(
1231111111
);
customerInfo
.
setCustomerId
(
customerId
);
customerInfo
.
setInstitutionId
(
institutionId
);
customerInfo
.
setProductId
(
productId
);
customerInfo
.
setPartitionKey
(
partitionKey
);
customerInfo
.
setCreatedDate
(
new
Date
());
customerInfo
.
setModifiedDate
(
new
Date
());
customerInfo
.
setCreatedBy
(
""
);
customerInfo
.
setModifiedBy
(
""
);
customerInfoRepository
.
save
(
customerInfo
);
}
}
}
src/main/java/cn/quantgroup/xyqb/util/StringUtils.java
0 → 100644
View file @
bab6d0a4
package
cn
.
quantgroup
.
xyqb
.
util
;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
import
java.io.Serializable
;
import
org.slf4j.helpers.MessageFormatter
;
public
class
StringUtils
extends
org
.
springframework
.
util
.
StringUtils
{
public
static
final
char
DELIMITED_ID_SEP
=
'$'
;
public
static
final
char
DELIMITED_ID_WCHAR
=
'*'
;
public
StringUtils
()
{
}
public
static
String
defaultIfNull
(
String
object
,
String
defaultValue
)
{
return
object
==
null
?
defaultValue
:
object
;
}
public
static
<
T
extends
Serializable
>
String
toDelimitedString
(
T
...
ids
)
{
return
toDelimitedString
(
'$'
,
ids
);
}
public
static
<
T
extends
Serializable
>
String
toDelimitedString
(
char
separator
,
T
...
ids
)
{
int
len
=
ids
.
length
;
StringBuilder
builder
=
new
StringBuilder
();
Serializable
[]
var4
=
ids
;
int
var5
=
ids
.
length
;
for
(
int
var6
=
0
;
var6
<
var5
;
++
var6
)
{
Object
id
=
var4
[
var6
];
if
(
id
==
null
)
{
builder
.
append
(
'*'
);
}
else
{
builder
.
append
(
id
.
toString
());
}
--
len
;
if
(
len
==
0
)
{
break
;
}
builder
.
append
(
separator
);
}
return
builder
.
toString
();
}
public
static
String
format
(
String
msg
,
Object
...
args
)
{
return
MessageFormatter
.
arrayFormat
(
msg
,
args
).
getMessage
();
}
}
xyqb-user2.2021-11-13-0.log
0 → 100644
View file @
bab6d0a4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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