Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
2f4f38c8
Commit
2f4f38c8
authored
Jul 05, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
427b3d04
dd3357f5
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
604 additions
and
123 deletions
+604
-123
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+3
-2
IUserService.java
.../com/github/wxiaoqi/security/auth/feign/IUserService.java
+2
-1
AuthService.java
...com/github/wxiaoqi/security/auth/service/AuthService.java
+1
-1
AppAuthServiceImpl.java
...xiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
+2
-2
AuthServiceImpl.java
...b/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
+2
-2
AppUserRelation.java
...github/wxiaoqi/security/admin/entity/AppUserRelation.java
+87
-0
AppUserRelationTemp.java
...ub/wxiaoqi/security/admin/entity/AppUserRelationTemp.java
+80
-0
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+149
-0
AppUserRelationTempBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserRelationTempBiz.java
+17
-0
AppUserRelationMapper.java
.../wxiaoqi/security/admin/mapper/AppUserRelationMapper.java
+15
-0
AppUserRelationTempMapper.java
...aoqi/security/admin/mapper/AppUserRelationTempMapper.java
+15
-0
AppUserRelationController.java
...xiaoqi/security/admin/rest/AppUserRelationController.java
+29
-0
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+4
-2
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+24
-15
application.yml
ace-modules/ace-generator/src/main/resources/application.yml
+1
-1
generator.properties
...les/ace-generator/src/main/resources/generator.properties
+1
-1
CampsiteShopDetailDTO.java
...com/xxfc/platform/campsite/dto/CampsiteShopDetailDTO.java
+3
-0
CampsiteShopDetailVo.java
...a/com/xxfc/platform/campsite/vo/CampsiteShopDetailVo.java
+3
-0
CampSiteApplication.java
.../java/com/xxfc/platform/campsite/CampSiteApplication.java
+0
-1
CampsiteShopBiz.java
.../java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
+160
-92
RedisConfiguration.java
...com/xxfc/platform/campsite/config/RedisConfiguration.java
+5
-2
CampsiteShopMapper.xml
...e-server/src/main/resources/mapper/CampsiteShopMapper.xml
+1
-1
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
2f4f38c8
...
...
@@ -192,8 +192,9 @@ public class AuthController {
public
JSONObject
registryWithApplet
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"nickname"
,
defaultValue
=
""
)
String
nickname
,
@RequestParam
(
value
=
"headimgurl"
,
defaultValue
=
""
)
String
headimgurl
)
throws
Exception
{
JSONObject
data
=
appAuthService
.
appletRegistry
(
username
,
nickname
,
headimgurl
);
@RequestParam
(
value
=
"headimgurl"
,
defaultValue
=
""
)
String
headimgurl
,
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
)
throws
Exception
{
JSONObject
data
=
appAuthService
.
appletRegistry
(
username
,
nickname
,
headimgurl
,
userid
);
if
(
data
!=
null
&&
data
.
getInteger
(
"status"
)==
ResultCode
.
SUCCESS_CODE
){
JSONObject
result
=
data
.
getJSONObject
(
"data"
);
if
(
result
==
null
){
...
...
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/feign/IUserService.java
View file @
2f4f38c8
...
...
@@ -65,5 +65,6 @@ public interface IUserService {
* @return
*/
@PostMapping
(
"/api/app/applet/registry"
)
public
JSONObject
appletRegistry
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"nickname"
)
String
nickname
,
@RequestParam
(
value
=
"headimgurl"
)
String
headimgurl
);
public
JSONObject
appletRegistry
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"nickname"
)
String
nickname
,
@RequestParam
(
value
=
"headimgurl"
)
String
headimgurl
,
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
);
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
View file @
2f4f38c8
...
...
@@ -32,5 +32,5 @@ public interface AuthService {
* @param nickname
* @return
*/
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
);
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
,
Integer
userid
);
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
View file @
2f4f38c8
...
...
@@ -92,8 +92,8 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
)
{
return
userService
.
appletRegistry
(
username
,
headimgurl
,
nickname
);
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
,
Integer
userid
)
{
return
userService
.
appletRegistry
(
username
,
headimgurl
,
nickname
,
userid
);
}
}
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AuthServiceImpl.java
View file @
2f4f38c8
...
...
@@ -90,7 +90,7 @@ public class AuthServiceImpl implements AuthService {
}
@Override
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
)
{
return
userService
.
appletRegistry
(
username
,
headimgurl
,
nickname
);
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
,
Integer
userid
)
{
return
userService
.
appletRegistry
(
username
,
headimgurl
,
nickname
,
userid
);
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserRelation.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 用户关系表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
@Data
@Table
(
name
=
"app_user_relation"
)
public
class
AppUserRelation
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userId
;
/**
* 父id
*/
@Column
(
name
=
"parent_id"
)
@ApiModelProperty
(
value
=
"父id"
)
private
Integer
parentId
;
/**
* 绑定的来源:1-app;2-小程序
*/
@Column
(
name
=
"bind_type"
)
@ApiModelProperty
(
value
=
"绑定的来源:1-app;2-小程序"
)
private
Integer
bindType
;
/**
* 绑定时间
*/
@Column
(
name
=
"bind_time"
)
@ApiModelProperty
(
value
=
"绑定时间"
)
private
Long
bindTime
;
/**
* 是否永久绑定关系:0-否;1-是
*/
@Column
(
name
=
"is_forever"
)
@ApiModelProperty
(
value
=
"是否永久绑定关系:0-否;1-是"
)
private
Integer
isForever
;
/**
* 创建时间
*/
@Column
(
name
=
"ctr_time"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Long
ctrTime
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
private
Integer
isDel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserRelationTemp.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 用户临时关系绑定表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
@Data
@Table
(
name
=
"app_user_relation_temp"
)
public
class
AppUserRelationTemp
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键id
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
/**
* 别的服务(比如小程序)用户id
*/
@Column
(
name
=
"temp_id"
)
@ApiModelProperty
(
value
=
"别的服务(比如小程序)用户id"
)
private
Integer
tempId
;
/**
* 类型:1-小程序
*/
@Column
(
name
=
"type"
)
@ApiModelProperty
(
value
=
"类型:1-小程序"
)
private
Integer
type
;
/**
* app用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"app用户id"
)
private
Integer
userId
;
/**
* 是否有效:0-有效;1-无效
*/
@Column
(
name
=
"is_valid"
)
@ApiModelProperty
(
value
=
"是否有效:0-有效;1-无效"
)
private
Integer
isValid
;
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除:0-正常;1-删除"
)
private
Integer
isDel
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelationTemp
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
org.springframework.aop.framework.AopContext
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
/**
* 用户关系表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
@Service
public
class
AppUserRelationBiz
extends
BaseBiz
<
AppUserRelationMapper
,
AppUserRelation
>
{
@Autowired
AppUserRelationTempBiz
relationTempBiz
;
@Autowired
AppUserDetailBiz
userDetailBiz
;
/**
* 关系绑定
* @param userId
* @param parentId
*/
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
){
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
insertSelective
(
relation
);
}
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
2
);
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
}
else
{
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&(
time
-
relation
.
getBindTime
())>
3600
)){
relation
.
setParentId
(
parentId
);
relation
.
setBindType
(
2
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
}
}
}
/**
* 小程序分享上下线绑定
* @param userid 当前人小程序id
* @param pid 分享人id
* @param platform_userid 当前人统一平台id
*/
public
ObjectRestResponse
shareParentByUserId
(
Integer
userid
,
Integer
pid
,
Integer
platform_userid
){
if
(
pid
==
null
||
pid
==
0
||((
platform_userid
==
null
||
platform_userid
==
0
)&&(
userid
==
0
||
userid
==
null
))){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
if
(
platform_userid
==
null
||
platform_userid
==
0
){
upRelationTemp
(
pid
,
userid
);
}
else
{
AppUserVo
userVo
=
userDetailBiz
.
getUserInfoById
(
platform_userid
);
if
(
userVo
==
null
){
upRelationTemp
(
pid
,
userid
);
}
else
{
bindRelation
(
platform_userid
,
pid
);
}
}
return
ObjectRestResponse
.
succ
();
}
/**
* 新增临时关系
* @param pid
* @param userid
*/
public
void
upRelationTemp
(
Integer
pid
,
Integer
userid
){
AppUserRelationTemp
relationTemp
=
new
AppUserRelationTemp
();
relationTemp
.
setUserId
(
pid
);
relationTemp
.
setIsDel
(
0
);
relationTemp
.
setType
(
1
);
AppUserRelationTemp
relationTemp1
=
relationTempBiz
.
selectOne
(
relationTemp
);
if
(
relationTemp1
==
null
){
relationTemp
.
setTempId
(
userid
);
relationTempBiz
.
insertSelective
(
relationTemp
);
}
}
/**
* 小程序上下线绑定
* @param platform_userid 当前人统一平台id
* @param userid 当前人小程序id
*/
public
void
bindByUserId
(
Integer
platform_userid
,
Integer
userid
){
if
(
platform_userid
==
null
||
platform_userid
==
0
||
userid
==
null
||
userid
==
0
){
return
;
}
AppUserRelationTemp
relationTemp
=
new
AppUserRelationTemp
();
relationTemp
.
setTempId
(
userid
);
relationTemp
.
setIsValid
(
0
);
relationTemp
.
setType
(
1
);
relationTemp
.
setIsDel
(
0
);
relationTemp
=
relationTempBiz
.
selectOne
(
relationTemp
);
if
(
relationTemp
==
null
){
return
;
}
Integer
parentId
=
relationTemp
.
getUserId
();
bindRelation
(
platform_userid
,
parentId
);
}
/**
* 获取用户的上线关系
* @param userId
* @return
*/
@Cache
(
key
=
"user:relation{1}"
)
public
AppUserRelation
getRelationByUserId
(
Integer
userId
){
AppUserRelation
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
return
selectOne
(
relation
);
}
@CacheClear
(
key
=
"user:relation{1.userId}"
)
public
int
updRelation
(
AppUserRelation
appUserRelation
){
return
super
.
updateSelectiveByIdRe
(
appUserRelation
);
}
private
AppUserRelationBiz
getMyBiz
()
{
return
AopContext
.
currentProxy
()
!=
null
?
(
AppUserRelationBiz
)
AopContext
.
currentProxy
()
:
this
;
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationTempBiz.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelationTemp
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationTempMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
/**
* 用户临时关系绑定表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
@Service
public
class
AppUserRelationTempBiz
extends
BaseBiz
<
AppUserRelationTempMapper
,
AppUserRelationTemp
>
{
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserRelationMapper.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 用户关系表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
public
interface
AppUserRelationMapper
extends
Mapper
<
AppUserRelation
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserRelationTempMapper.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelationTemp
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 用户临时关系绑定表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
public
interface
AppUserRelationTempMapper
extends
Mapper
<
AppUserRelationTemp
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserRelationController.java
0 → 100644
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.admin.biz.AppUserRelationBiz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"relation"
)
public
class
AppUserRelationController
extends
BaseController
<
AppUserRelationBiz
,
AppUserRelation
>
{
@RequestMapping
(
value
=
"app/unauth/small/share"
,
method
=
RequestMethod
.
GET
)
@ApiModelProperty
(
"小程序分享绑定"
)
public
ObjectRestResponse
share
(
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
,
@RequestParam
(
value
=
"pid"
,
defaultValue
=
"0"
)
Integer
pid
,
@RequestParam
(
value
=
"platform_userid"
,
defaultValue
=
"0"
)
Integer
platform_userid
){
return
baseBiz
.
shareParentByUserId
(
userid
,
pid
,
platform_userid
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
2f4f38c8
...
...
@@ -186,14 +186,16 @@ public class AppUserRest {
public
JSONObject
appletRegistry
(
@RequestParam
(
value
=
"username"
,
defaultValue
=
""
)
String
username
,
@RequestParam
(
value
=
"nickname"
,
defaultValue
=
""
)
String
nickname
,
@RequestParam
(
value
=
"headimgurl"
,
defaultValue
=
""
)
String
headimgurl
){
@RequestParam
(
value
=
"headimgurl"
,
defaultValue
=
""
)
String
headimgurl
,
@RequestParam
(
value
=
"userid"
,
defaultValue
=
"0"
)
Integer
userid
){
if
(
StringUtils
.
isBlank
(
headimgurl
)){
headimgurl
=
SystemConfig
.
USER_HEADER_URL_DEFAULT
;
}
if
(
StringUtils
.
isBlank
(
nickname
)){
nickname
=
SystemConfig
.
USER_NIKENAME_DEFAULT
+(
int
)((
Math
.
random
()*
9
+
1
)*
100000
);
}
return
appPermissionService
.
appletRegistry
(
username
,
headimgurl
,
nickname
);
return
appPermissionService
.
appletRegistry
(
username
,
headimgurl
,
nickname
,
userid
);
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
2f4f38c8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rpc
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.biz.*
;
import
com.github.wxiaoqi.security.admin.biz.AppUserBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserDetailBiz
;
import
com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz
;
...
...
@@ -32,7 +33,6 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.client.RestTemplate
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -62,6 +62,9 @@ public class AppPermissionService {
@Autowired
ActivityFeign
activityFeign
;
@Autowired
AppUserRelationBiz
relationBiz
;
@Resource
private
RegionFeign
regionFeign
;
...
...
@@ -701,7 +704,7 @@ public class AppPermissionService {
* @param nickname
*/
@Transactional
public
JSONObject
applyRegister
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
)
{
public
JSONObject
applyRegister
(
String
username
,
String
password
,
String
headimgurl
,
String
nickname
,
Integer
small_id
)
{
// 判断参数
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
password
))
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
...
...
@@ -740,6 +743,8 @@ public class AppPermissionService {
rsUserDetail
.
setChannel
(
UserSourceEnum
.
APPLET
.
getCode
());
appUserDetailBiz
.
insertSelective
(
rsUserDetail
);
log
.
error
(
"注册:新增用户详情: "
+
userid
);
//上线绑定
relationBiz
.
bindByUserId
(
userid
,
small_id
);
//自动登录获取优惠卷
authCoupn
(
userid
);
//发送短信通知用户
...
...
@@ -747,7 +752,7 @@ public class AppPermissionService {
// 登录结果要做做统一处理
JSONObject
data
=
autoLogin
(
userid
,
username
,
headimgurl
,
nickname
);
// 到im注册,获取返回结果
Map
<
String
,
Object
>
map
=
registerIm
(
username
,
appUserLogin
.
getPassword
(),
nickname
);
/*
Map<String,Object> map=registerIm(username,appUserLogin.getPassword(),nickname);
if(map!=null){
Integer imUserId=Integer.parseInt(map.get("userId").toString());
String access_token=map.get("access_token").toString();
...
...
@@ -763,7 +768,7 @@ public class AppPermissionService {
}
data.put("imToken",access_token);
data.put("imUserId",imUserId);
}
}
*/
if
(
data
!=
null
)
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
data
);
...
...
@@ -783,7 +788,7 @@ public class AppPermissionService {
* @param username
* @return
*/
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
){
public
JSONObject
appletRegistry
(
String
username
,
String
headimgurl
,
String
nickname
,
Integer
small_id
){
try
{
// 是否已存在
...
...
@@ -791,9 +796,13 @@ public class AppPermissionService {
JSONObject
data
=
new
JSONObject
();
if
(
null
==
user
)
{
String
password
=
"12345678"
;
data
=
applyRegister
(
username
,
password
,
headimgurl
,
nickname
);
data
=
applyRegister
(
username
,
password
,
headimgurl
,
nickname
,
small_id
);
}
else
{
data
=
appletLoginByUserId
(
user
.
getId
());
Integer
userid
=
user
.
getId
();
//上线绑定
relationBiz
.
bindByUserId
(
userid
,
small_id
);
//登录
data
=
appletLoginByUserId
(
userid
);
}
return
data
;
}
catch
(
Exception
e
)
{
...
...
@@ -808,14 +817,14 @@ public class AppPermissionService {
*/
public
void
setCreateIPInfo
(
AppUserLogin
appUserLogin
){
String
crtHost
=
appUserLogin
.
getCrtHost
();
String
ip
info
=
restTemplate
.
getForObject
(
String
.
format
(
"%s%s"
,
IPCommon
.
BASE_IP_PARSING_URL
,
crtHost
),
String
.
class
);
String
base_data
=
JSONObject
.
parseObject
(
ipinfo
).
getString
(
IPCommon
.
BASE_DATA
);
JSONObject
ipJsonObject
=
JSONObject
.
parseObject
(
base_
data
);
// Integer provinceCode = ipJsonObject.getInteger(IP
Common
.PROVINCE_CODE);
// Integer cityCode = ipJsonObject.getInteger(IP
Common
.CITY_CODE);
String
ip
Address
=
restTemplate
.
getForObject
(
String
.
format
(
"%s%s"
,
IPAddress
.
BASE_IP_PARSING_URL
,
crtHost
),
String
.
class
);
String
data
=
JSONObject
.
parseObject
(
ipAddress
).
getString
(
IPAddress
.
BASE_DATA
);
JSONObject
ipJsonObject
=
JSONObject
.
parseObject
(
data
);
// Integer provinceCode = ipJsonObject.getInteger(IP
Address
.PROVINCE_CODE);
// Integer cityCode = ipJsonObject.getInteger(IP
Address
.CITY_CODE);
//appUserLogin.setProvinceCode(provinceCode);
//appUserLogin.setCityCode(cityCode);
String
cityName
=
ipJsonObject
.
getString
(
IP
Common
.
CITY_NAME
);
String
cityName
=
ipJsonObject
.
getString
(
IP
Address
.
CITY_NAME
);
RegionDTO
regionDTO
=
regionFeign
.
getRegionByCityName
(
cityName
);
if
(
null
!=
regionDTO
){
appUserLogin
.
setProvinceCode
(
Integer
.
valueOf
(
String
.
valueOf
(
regionDTO
.
getParentId
())));
...
...
@@ -826,9 +835,9 @@ public class AppPermissionService {
/**
* @author libin
* @version 1.0.0
* @dec ip
返回字段名常量
* @dec ip
解析返回的地址信息
*/
static
class
IPCommon
{
private
static
class
IPAddress
{
public
static
final
String
BASE_IP_PARSING_URL
=
"http://ip.taobao.com/service/getIpInfo.php?ip="
;
public
static
final
String
BASE_DATA
=
"data"
;
public
static
final
String
PROVINCE_CODE
=
"region_id"
;
...
...
ace-modules/ace-generator/src/main/resources/application.yml
View file @
2f4f38c8
...
...
@@ -10,7 +10,7 @@ spring:
datasource
:
type
:
com.alibaba.druid.pool.DruidDataSource
driverClassName
:
com.mysql.jdbc.Driver
url
:
jdbc:mysql://10.5.52.3:3306/
xxfc_tour
?useUnicode=true&characterEncoding=UTF-8
url
:
jdbc:mysql://10.5.52.3:3306/
ag_admin_v1
?useUnicode=true&characterEncoding=UTF-8
username
:
root
password
:
sslcloud123*()
jackson
:
...
...
ace-modules/ace-generator/src/main/resources/generator.properties
View file @
2f4f38c8
#\u4EE3\u7801\u751F\u6210\u5668\uFF0C\u914D\u7F6E\u4FE1\u606F
#\u5305\u540D
package
=
com.
xxfc.platform.tour
package
=
com.
github.wxiaoqi.security.admin
#\u4F5C\u8005
author
=
libin
#Email
...
...
xx-campsite/xx-campsite-api/src/main/java/com/xxfc/platform/campsite/dto/CampsiteShopDetailDTO.java
View file @
2f4f38c8
...
...
@@ -65,4 +65,7 @@ public class CampsiteShopDetailDTO {
@ApiModelProperty
(
value
=
"纬度"
)
private
Double
latitude
;
@ApiModelProperty
(
value
=
"电话"
)
private
String
phone
;
}
xx-campsite/xx-campsite-api/src/main/java/com/xxfc/platform/campsite/vo/CampsiteShopDetailVo.java
View file @
2f4f38c8
...
...
@@ -89,4 +89,7 @@ public class CampsiteShopDetailVo {
*/
@ApiModelProperty
(
"轮播图列表"
)
private
List
<
CampsiteShopCarouselDetailVo
>
campsiteShopCarouselDetailVos
;
@ApiModelProperty
(
value
=
"電話"
)
private
String
phone
;
}
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/CampSiteApplication.java
View file @
2f4f38c8
...
...
@@ -26,7 +26,6 @@ import tk.mybatis.spring.annotation.MapperScan;
@EnableScheduling
@EnableFeignClients
(
value
=
{
"com.github.wxiaoqi.security.auth.client.feign"
,
"com.github.wxiaoqi.security.admin.feign"
,
"com.xxfc.platform"
},
defaultConfiguration
=
HeaderConfig
.
class
)
@EnableAceCache
@EnableCaching
@MapperScan
(
basePackages
=
"com.xxfc.platform.campsite.mapper"
)
public
class
CampSiteApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
View file @
2f4f38c8
This diff is collapsed.
Click to expand it.
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/config/RedisConfiguration.java
View file @
2f4f38c8
...
...
@@ -5,9 +5,12 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.data.redis.connection.RedisConnectionFactory
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
;
import
org.springframework.data.redis.serializer.RedisSerializer
;
import
org.springframework.data.redis.serializer.StringRedisSerializer
;
import
java.util.Objects
;
/**
* ${DESCRIPTION}
*
...
...
@@ -19,7 +22,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
@Primary
public
class
RedisConfiguration
{
@Bean
@Bean
(
"customRedisTemplate"
)
public
RedisTemplate
<
String
,
Object
>
customRedisTemplate
(
RedisConnectionFactory
factory
)
{
RedisTemplate
redisTemplate
=
new
RedisTemplate
();
redisTemplate
.
setConnectionFactory
(
factory
);
...
...
@@ -27,7 +30,7 @@ public class RedisConfiguration {
redisTemplate
.
setKeySerializer
(
stringSerializer
);
redisTemplate
.
setValueSerializer
(
stringSerializer
);
redisTemplate
.
setHashKeySerializer
(
stringSerializer
);
redisTemplate
.
setHashValueSerializer
(
stringSerializer
);
redisTemplate
.
setHashValueSerializer
(
new
Jackson2JsonRedisSerializer
<
Object
>(
Object
.
class
)
);
redisTemplate
.
afterPropertiesSet
();
return
redisTemplate
;
}
...
...
xx-campsite/xx-campsite-server/src/main/resources/mapper/CampsiteShopMapper.xml
View file @
2f4f38c8
...
...
@@ -58,7 +58,7 @@
<!--根据id查询详情-->
<select
id=
"findCampsiteShopDetailById"
resultType=
"com.xxfc.platform.campsite.dto.CampsiteShopDetailDTO"
>
select `name` as `name`,`province_name` as `provinceName`,`city_name` as `cityName`,`address` as `address`,
select `name` as `name`,`province_name` as `provinceName`,`city_name` as `cityName`,`address` as `address`,
`service_phone` as `phone`,
`content` as `content`,`configure` as `configure`,`longitude` as `longitude`,`latitude` as `latitude` from `campsite_shop` where `id`=#{id}
</select>
...
...
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