Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
OSmall
/
linjiashop
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3692987c
authored
Dec 19, 2020
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
app注册、注销接口代码--think.wang
1 parent
cc19b0a8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
265 additions
and
0 deletions
shop-core/pom.xml
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/PlatformCustomer.java
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/PlatformUser.java
shop-core/src/main/java/com/glsx/shop/bean/exception/ApplicationExceptionEnum.java
shop-core/src/main/java/com/glsx/shop/bean/vo/JwtUser.java
shop-core/src/main/java/com/glsx/shop/bean/vo/front/Rets.java
shop-core/src/main/java/com/glsx/shop/dao/shop/PlatformCustomerRepository.java
shop-core/src/main/java/com/glsx/shop/dao/shop/PlatformUserRepository.java
shop-core/src/main/java/com/glsx/shop/service/shop/PlatformCustomerService.java
shop-core/src/main/java/com/glsx/shop/service/shop/PlatformUserService.java
shop-core/src/main/java/com/glsx/shop/utils/HttpUtils.java
shop-core/src/main/java/com/glsx/shop/utils/SSLClient.java
shop-core/pom.xml
View file @
3692987
...
...
@@ -169,6 +169,20 @@
<groupId>
io.projectreactor
</groupId>
<artifactId>
reactor-core
</artifactId>
</dependency>
<!--json-->
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
fastjson
</artifactId>
<version>
${fastjson.version}
</version>
</dependency>
<dependency>
<groupId>
commons-httpclient
</groupId>
<artifactId>
commons-httpclient
</artifactId>
<version>
3.1
</version>
</dependency>
</dependencies>
<build>
...
...
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/PlatformCustomer.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
bean
.
entity
.
shop
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.hibernate.annotations.Table
;
import
org.springframework.data.annotation.CreatedDate
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author glsx
* @date :Created in 2019/10/29 17:41
*/
@Data
@Table
(
appliesTo
=
"t_platform_customer"
,
comment
=
"客户管理表"
)
@Entity
(
name
=
"t_platform_customer"
)
@JsonIgnoreProperties
(
value
=
{
"hibernateLazyInitializer"
,
"handler"
})
public
class
PlatformCustomer
implements
Serializable
{
@Id
@GeneratedValue
private
Long
id
;
@CreatedDate
@Column
(
columnDefinition
=
"DATETIME COMMENT '创建时间 注册时间'"
)
private
Date
createTime
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '客户名称'"
)
private
String
customerName
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '联系人'"
)
private
String
contactPerson
;
@Column
(
columnDefinition
=
"VARCHAR(64) COMMENT '密码'"
)
private
String
password
;
@Column
(
columnDefinition
=
"VARCHAR(11) COMMENT '联系电话'"
)
private
String
contactNumber
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '联系邮箱'"
)
private
String
contactEmail
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '省份 sys_area的id'"
)
private
Integer
province
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '城市 sys_area的id'"
)
private
Integer
city
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '区 sys_area的id'"
)
private
Integer
area
;
@Column
(
columnDefinition
=
"VARCHAR(128) COMMENT '详细地址'"
)
private
String
address
;
@Column
(
columnDefinition
=
"TINYINT(11) COMMENT '账号状态 0 停用 1 正常 2 待审核 3 审核未通过'"
)
private
Integer
status
;
@Column
(
columnDefinition
=
"VARCHAR(256) COMMENT '公钥'"
)
private
String
publicKey
;
@Column
(
columnDefinition
=
"VARCHAR(256) COMMENT '私钥'"
)
private
String
privateKey
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '渠道号'"
)
private
String
channelNumber
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '创建人'"
)
private
Integer
createBy
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '更新人'"
)
private
Integer
updateBy
;
@Column
(
columnDefinition
=
"DATETIME COMMENT '更新时间'"
)
private
Date
updateTime
;
@Column
(
columnDefinition
=
"VARCHAR(50) COMMENT '备注'"
)
private
String
remark
;
}
shop-core/src/main/java/com/glsx/shop/bean/entity/shop/PlatformUser.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
bean
.
entity
.
shop
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.hibernate.annotations.Table
;
import
org.springframework.data.annotation.CreatedDate
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author glsx
* @date :Created in 2019/10/29 17:41
*/
@Data
@Table
(
appliesTo
=
"t_platform_user"
,
comment
=
"用户管理表"
)
@Entity
(
name
=
"t_platform_user"
)
@JsonIgnoreProperties
(
value
=
{
"hibernateLazyInitializer"
,
"handler"
})
public
class
PlatformUser
implements
Serializable
{
@Id
@GeneratedValue
private
Long
id
;
@CreatedDate
@Column
(
columnDefinition
=
"DATETIME COMMENT '创建时间 注册时间'"
)
private
Date
createTime
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '昵称,账号'"
)
private
String
nickname
;
@Column
(
columnDefinition
=
"VARCHAR(11) COMMENT '联系电话'"
)
private
String
contactNumber
;
@Column
(
columnDefinition
=
"VARCHAR(32) COMMENT '微信ID'"
)
private
String
wechatId
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '省份 sys_area的id'"
)
private
Integer
province
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '城市 sys_area的id'"
)
private
Integer
city
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '客户id t_platform_customer表的id'"
)
private
Integer
customerId
;
@Column
(
columnDefinition
=
"TINYINT(11) COMMENT '用户状态 0 注销 1 正常'"
)
private
Integer
status
;
@Column
(
columnDefinition
=
"INT(11) COMMENT 'APP 账户ID'"
)
private
Integer
appAccountId
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '涂鸦平台ID'"
)
private
Integer
tuYaId
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '创建人'"
)
private
Integer
createBy
;
@Column
(
columnDefinition
=
"INT(11) COMMENT '更新人'"
)
private
Integer
updateBy
;
@Column
(
columnDefinition
=
"DATETIME COMMENT '最后登陆时间'"
)
private
Date
lastLoginTime
;
@Column
(
columnDefinition
=
"DATETIME COMMENT '更新时间'"
)
private
Date
updateTime
;
@Column
(
columnDefinition
=
"VARCHAR(50) COMMENT '备注'"
)
private
String
remark
;
}
shop-core/src/main/java/com/glsx/shop/bean/exception/ApplicationExceptionEnum.java
View file @
3692987
...
...
@@ -12,6 +12,7 @@ public enum ApplicationExceptionEnum implements ServiceExceptionEnum {
TOKEN_EXPIRED
(
3002
,
"token 已过期"
),
REQUEST_ERROR
(
4001
,
"请求错误"
),
PARAM_ERROR
(
4002
,
"参数错误"
),
PARAM_IS_EMPTY
(
4002
,
"参数不能为空"
),
FILE_UPLOAD_ERROR
(
5001
,
"文件上传错误"
),
FILE_DELETE_ERROR
(
5002
,
"文件删除错误"
),
...
...
shop-core/src/main/java/com/glsx/shop/bean/vo/JwtUser.java
View file @
3692987
...
...
@@ -4,6 +4,7 @@ import com.glsx.shop.bean.core.AuthorizationUser;
import
com.glsx.shop.bean.entity.shop.ShopUser
;
import
com.glsx.shop.bean.entity.system.User
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 由于前后端使用一个基础模块:shop-core公用了一些权限处理代码,所以封装奔雷用来做前后端处理登录的用户信息实体类
...
...
@@ -12,6 +13,7 @@ import lombok.Data;
* @date :Created in 11/4/2019 8:16 PM
*/
@Data
@NoArgsConstructor
public
class
JwtUser
{
public
static
int
MANAGER
=
0
;
public
static
int
FRONT_USER
=
1
;
...
...
shop-core/src/main/java/com/glsx/shop/bean/vo/front/Rets.java
View file @
3692987
...
...
@@ -23,6 +23,10 @@ public class Rets {
return
new
Ret
<>(
code
,
msg
,
null
);
}
public
static
Ret
<?>
failure
(
ApplicationExceptionEnum
exceptionEnum
)
{
return
new
Ret
<>(
exceptionEnum
.
getCode
(),
exceptionEnum
.
getMessage
(),
null
);
}
public
static
Ret
<?>
failure
(
ApplicationException
e
)
{
return
new
Ret
<>(
e
.
getCode
(),
e
.
getMessage
(),
null
);
}
...
...
shop-core/src/main/java/com/glsx/shop/dao/shop/PlatformCustomerRepository.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
dao
.
shop
;
import
com.glsx.shop.bean.entity.shop.PlatformCustomer
;
import
com.glsx.shop.dao.BaseRepository
;
public
interface
PlatformCustomerRepository
extends
BaseRepository
<
PlatformCustomer
,
Long
>
{
PlatformCustomer
findByChannelNumber
(
String
channelNumber
);
}
shop-core/src/main/java/com/glsx/shop/dao/shop/PlatformUserRepository.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
dao
.
shop
;
import
com.glsx.shop.bean.entity.shop.PlatformUser
;
import
com.glsx.shop.dao.BaseRepository
;
public
interface
PlatformUserRepository
extends
BaseRepository
<
PlatformUser
,
Long
>
{
PlatformUser
findByContactNumber
(
String
contactNumber
);
}
shop-core/src/main/java/com/glsx/shop/service/shop/PlatformCustomerService.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
service
.
shop
;
import
com.glsx.shop.bean.entity.shop.PlatformCustomer
;
import
com.glsx.shop.dao.shop.PlatformCustomerRepository
;
import
com.glsx.shop.service.BaseService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
PlatformCustomerService
extends
BaseService
<
PlatformCustomer
,
Long
,
PlatformCustomerRepository
>
{
@Autowired
private
PlatformCustomerRepository
platformCustomerRepository
;
public
PlatformCustomer
findByChannelNumber
(
String
channelNumber
){
return
platformCustomerRepository
.
findByChannelNumber
(
channelNumber
);
}
}
shop-core/src/main/java/com/glsx/shop/service/shop/PlatformUserService.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
service
.
shop
;
import
com.glsx.shop.bean.entity.shop.PlatformUser
;
import
com.glsx.shop.dao.shop.PlatformUserRepository
;
import
com.glsx.shop.service.BaseService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
PlatformUserService
extends
BaseService
<
PlatformUser
,
Long
,
PlatformUserRepository
>
{
@Autowired
private
PlatformUserRepository
platformUserRepository
;
public
PlatformUser
findByContactNumber
(
String
contactNumber
)
{
return
platformUserRepository
.
findByContactNumber
(
contactNumber
);
}
}
shop-core/src/main/java/com/glsx/shop/utils/HttpUtils.java
0 → 100644
View file @
3692987
This diff is collapsed.
Click to expand it.
shop-core/src/main/java/com/glsx/shop/utils/SSLClient.java
0 → 100644
View file @
3692987
package
com
.
glsx
.
shop
.
utils
;
import
org.apache.http.conn.ClientConnectionManager
;
import
org.apache.http.conn.scheme.Scheme
;
import
org.apache.http.conn.scheme.SchemeRegistry
;
import
org.apache.http.conn.ssl.SSLSocketFactory
;
import
org.apache.http.impl.client.DefaultHttpClient
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.TrustManager
;
import
javax.net.ssl.X509TrustManager
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
/**
* JAVA利用HttpClient进行HTTPS接口调用
* @author duanlq
* @createTime 2018-1-8
*/
@SuppressWarnings
(
"deprecation"
)
public
class
SSLClient
extends
DefaultHttpClient
{
public
SSLClient
()
throws
Exception
{
super
();
SSLContext
ctx
=
SSLContext
.
getInstance
(
"TLS"
);
X509TrustManager
tm
=
new
X509TrustManager
()
{
@Override
public
void
checkClientTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
@Override
public
void
checkServerTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
@Override
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
};
ctx
.
init
(
null
,
new
TrustManager
[]{
tm
},
null
);
SSLSocketFactory
ssf
=
new
SSLSocketFactory
(
ctx
,
SSLSocketFactory
.
ALLOW_ALL_HOSTNAME_VERIFIER
);
ClientConnectionManager
ccm
=
this
.
getConnectionManager
();
SchemeRegistry
sr
=
ccm
.
getSchemeRegistry
();
sr
.
register
(
new
Scheme
(
"https"
,
443
,
ssf
));
}
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment