Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
4bf70eae
Commit
4bf70eae
authored
Sep 07, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
874032b9
b28a8c77
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
5 deletions
+30
-5
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
...es/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
.../main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
...ain/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
+0
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
...pi/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
+21
-1
No files found.
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
View file @
4bf70eae
...
...
@@ -132,6 +132,14 @@
values (#{favoritesId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT},
#{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"batchInsert"
parameterType=
"com.wwdz.ch.db.domain.FavoritesItemsRelation"
>
insert into favorites_items_relation (favorites_id, user_id, item_id,
add_time, update_time)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.favoritesId,jdbcType=BIGINT}, #{item.userId,jdbcType=BIGINT}, #{item.itemId,jdbcType=BIGINT}, #{item.addTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.FavoritesItemsRelation"
>
insert into favorites_items_relation
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/config/WebMvcConfiguration.java
View file @
4bf70eae
...
...
@@ -30,7 +30,7 @@ public class WebMvcConfiguration implements WebMvcConfigurer {
registry
.
addInterceptor
(
loginInterceptor
())
.
addPathPatterns
(
"/**"
)
.
excludePathPatterns
(
"/*.html"
,
"/**/*.html"
,
"/**/*.css"
,
"/**/*.js"
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
);
,
"/wx/user/loginByWx"
,
"/wx/user/loginByMobile"
,
"/wx/user/loginRegCaptcha"
,
"/wx/user/updateRegCaptcha"
,
"/wx/user/login"
,
"/wx/user/fillCode"
);
// , "/wx/item/page", "/wx/item/info", "/wx/item/findNames"
// , "/wx/favorites/info", "/wx/favorites/itemList"
// , "/wx/keyword/recommend", "/wx/queryPrice/**");
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/interceptor/LoginInterceptor.java
View file @
4bf70eae
...
...
@@ -68,9 +68,6 @@ public class LoginInterceptor implements HandlerInterceptor {
loginType
=
2
;
}
else
{
if
(
userTokenManager
.
checkLogin
(
token
))
{
if
(
StringUtils
.
equals
(
url
,
"/wx/user/fillCode"
))
{
return
true
;
}
User
user
=
userDao
.
queryById
(
userTokenManager
.
getUserId
(
token
));
if
(!(
Boolean
)
inviteRecordService
.
isExisted
(
user
.
getMobile
()).
getData
())
{
loginType
=
3
;
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxUserController.java
View file @
4bf70eae
...
...
@@ -3,9 +3,11 @@ package com.wwdz.ch.wx.web;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.InviteRecordRequestDto
;
import
com.wwdz.ch.wx.constant.CacheCodeConstants
;
import
com.wwdz.ch.wx.constant.LoginTypeEnum
;
import
com.wwdz.ch.wx.entity.request.UserRequestDto
;
import
com.wwdz.ch.wx.service.InviteRecordService
;
import
com.wwdz.ch.wx.service.UserService
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -31,6 +33,8 @@ public class WxUserController {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
WxUserController
.
class
);
@Autowired
private
UserService
userService
;
@Autowired
private
InviteRecordService
inviteRecordService
;
@ApiOperation
(
value
=
"快捷登录"
)
...
...
@@ -98,7 +102,7 @@ public class WxUserController {
@ApiOperation
(
value
=
"手机验证码登录"
)
@PostMapping
(
"/loginByMobile"
)
public
Result
loginByMobile
(
@RequestBody
UserRequestDto
dto
,
HttpServletRequest
request
)
{
logger
.
info
(
"【请求开始】手机号登录,请求参数
,kl_data
:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"【请求开始】手机号登录,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
StringUtils
.
isBlank
(
dto
.
getMobile
()))
{
return
Result
.
failed
(
"手机号不能为空"
);
}
...
...
@@ -108,6 +112,22 @@ public class WxUserController {
return
userService
.
loginByMobile
(
dto
,
request
);
}
@ApiOperation
(
value
=
"填写邀请码"
)
@PostMapping
(
"/fillCode"
)
public
Result
fillCode
(
@RequestBody
InviteRecordRequestDto
dto
)
{
logger
.
info
(
"【请求开始】填写邀请码,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
Objects
.
isNull
(
dto
.
getInvitee
())
||
dto
.
getInvitee
().
equals
(
0L
))
{
return
Result
.
failed
(
"受邀人id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getInviteePhone
()))
{
return
Result
.
failed
(
"受邀人手机号不能为空"
);
}
if
(
StringUtils
.
isBlank
(
dto
.
getInvitationCode
()))
{
return
Result
.
failed
(
"请填写邀请码"
);
}
return
inviteRecordService
.
create
(
dto
);
}
@ApiOperation
(
value
=
"修改个性签名"
)
@PostMapping
(
"/updateProfile"
)
public
Result
updateProfile
(
@RequestBody
UserRequestDto
dto
)
{
...
...
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