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
68c5d996
Commit
68c5d996
authored
Apr 08, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
版本更新
parent
3c64f57e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
167 additions
and
9 deletions
+167
-9
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserDao.java
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserDao.java
+1
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/FollowFansRecord.java
...src/main/java/com/wwdz/ch/db/domain/FollowFansRecord.java
+10
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/FollowFansRecordExample.java
...n/java/com/wwdz/ch/db/domain/FollowFansRecordExample.java
+132
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
+0
-1
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/FollowFansRecordRequestDto.java
...om/wwdz/ch/db/dto/request/FollowFansRecordRequestDto.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserDaoImpl.java
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserDaoImpl.java
+16
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
...java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
+2
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/FollowFansRecordController.java
...n/java/com/wwdz/ch/wx/web/FollowFansRecordController.java
+1
-1
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/UserDao.java
View file @
68c5d996
...
@@ -15,6 +15,7 @@ public interface UserDao {
...
@@ -15,6 +15,7 @@ public interface UserDao {
int
insertByMapper
(
User
user
);
int
insertByMapper
(
User
user
);
/**
/**
* 通过oid查询未删除的记录
* 通过oid查询未删除的记录
*
*
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/FollowFansRecord.java
View file @
68c5d996
...
@@ -10,7 +10,7 @@ import lombok.Data;
...
@@ -10,7 +10,7 @@ import lombok.Data;
/**
/**
* @author shiyu
* @author shiyu
* @date 202
3/09/15
* @date 202
4/04/08
*/
*/
@Data
@Data
public
class
FollowFansRecord
implements
Entity
{
public
class
FollowFansRecord
implements
Entity
{
...
@@ -26,6 +26,11 @@ public class FollowFansRecord implements Entity {
...
@@ -26,6 +26,11 @@ public class FollowFansRecord implements Entity {
*/
*/
private
Long
followerId
;
private
Long
followerId
;
/**
* 介绍人id
*/
private
Long
introducerId
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -52,6 +57,7 @@ public class FollowFansRecord implements Entity {
...
@@ -52,6 +57,7 @@ public class FollowFansRecord implements Entity {
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", fansId="
).
append
(
fansId
);
sb
.
append
(
", fansId="
).
append
(
fansId
);
sb
.
append
(
", followerId="
).
append
(
followerId
);
sb
.
append
(
", followerId="
).
append
(
followerId
);
sb
.
append
(
", introducerId="
).
append
(
introducerId
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", state="
).
append
(
state
);
sb
.
append
(
", state="
).
append
(
state
);
...
@@ -75,6 +81,7 @@ public class FollowFansRecord implements Entity {
...
@@ -75,6 +81,7 @@ public class FollowFansRecord implements Entity {
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getFansId
()
==
null
?
other
.
getFansId
()
==
null
:
this
.
getFansId
().
equals
(
other
.
getFansId
()))
&&
(
this
.
getFansId
()
==
null
?
other
.
getFansId
()
==
null
:
this
.
getFansId
().
equals
(
other
.
getFansId
()))
&&
(
this
.
getFollowerId
()
==
null
?
other
.
getFollowerId
()
==
null
:
this
.
getFollowerId
().
equals
(
other
.
getFollowerId
()))
&&
(
this
.
getFollowerId
()
==
null
?
other
.
getFollowerId
()
==
null
:
this
.
getFollowerId
().
equals
(
other
.
getFollowerId
()))
&&
(
this
.
getIntroducerId
()
==
null
?
other
.
getIntroducerId
()
==
null
:
this
.
getIntroducerId
().
equals
(
other
.
getIntroducerId
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
...
@@ -87,6 +94,7 @@ public class FollowFansRecord implements Entity {
...
@@ -87,6 +94,7 @@ public class FollowFansRecord implements Entity {
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getFansId
()
==
null
)
?
0
:
getFansId
().
hashCode
());
result
=
prime
*
result
+
((
getFansId
()
==
null
)
?
0
:
getFansId
().
hashCode
());
result
=
prime
*
result
+
((
getFollowerId
()
==
null
)
?
0
:
getFollowerId
().
hashCode
());
result
=
prime
*
result
+
((
getFollowerId
()
==
null
)
?
0
:
getFollowerId
().
hashCode
());
result
=
prime
*
result
+
((
getIntroducerId
()
==
null
)
?
0
:
getIntroducerId
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
...
@@ -104,6 +112,7 @@ public class FollowFansRecord implements Entity {
...
@@ -104,6 +112,7 @@ public class FollowFansRecord implements Entity {
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
id
(
"id"
,
"id"
,
"INTEGER"
,
false
),
fansId
(
"fans_id"
,
"fansId"
,
"BIGINT"
,
false
),
fansId
(
"fans_id"
,
"fansId"
,
"BIGINT"
,
false
),
followerId
(
"follower_id"
,
"followerId"
,
"BIGINT"
,
false
),
followerId
(
"follower_id"
,
"followerId"
,
"BIGINT"
,
false
),
introducerId
(
"introducer_id"
,
"introducerId"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/FollowFansRecordExample.java
View file @
68c5d996
...
@@ -544,6 +544,138 @@ public class FollowFansRecordExample {
...
@@ -544,6 +544,138 @@ public class FollowFansRecordExample {
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andIntroducerIdIsNull
()
{
addCriterion
(
"introducer_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdIsNotNull
()
{
addCriterion
(
"introducer_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdEqualTo
(
Long
value
)
{
addCriterion
(
"introducer_id ="
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdEqualToColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdNotEqualTo
(
Long
value
)
{
addCriterion
(
"introducer_id <>"
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdNotEqualToColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdGreaterThan
(
Long
value
)
{
addCriterion
(
"introducer_id >"
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdGreaterThanColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"introducer_id >="
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdGreaterThanOrEqualToColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdLessThan
(
Long
value
)
{
addCriterion
(
"introducer_id <"
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdLessThanColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"introducer_id <="
,
value
,
"introducerId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table follow_fans_record
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andIntroducerIdLessThanOrEqualToColumn
(
FollowFansRecord
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"introducer_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdIn
(
List
<
Long
>
values
)
{
addCriterion
(
"introducer_id in"
,
values
,
"introducerId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"introducer_id not in"
,
values
,
"introducerId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"introducer_id between"
,
value1
,
value2
,
"introducerId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIntroducerIdNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"introducer_id not between"
,
value1
,
value2
,
"introducerId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
View file @
68c5d996
package
com.wwdz.ch.db.domain
;
package
com.wwdz.ch.db.domain
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/FollowFansRecordRequestDto.java
View file @
68c5d996
...
@@ -20,6 +20,11 @@ public class FollowFansRecordRequestDto extends BaseRequestDto implements Entity
...
@@ -20,6 +20,11 @@ public class FollowFansRecordRequestDto extends BaseRequestDto implements Entity
*/
*/
private
Long
fansId
;
private
Long
fansId
;
/**
* 介绍人id
*/
private
Long
introducerId
;
/**
/**
* 被关注者id
* 被关注者id
*/
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/UserDaoImpl.java
View file @
68c5d996
...
@@ -38,6 +38,12 @@ public class UserDaoImpl implements UserDao {
...
@@ -38,6 +38,12 @@ public class UserDaoImpl implements UserDao {
return
0
;
return
0
;
}
}
@Override
@Override
public
User
queryByOid
(
String
openId
)
{
public
User
queryByOid
(
String
openId
)
{
CloudServerResponse
<
com
.
wwdz
.
user
.
api
.
model
.
user
.
User
>
cloudServerResponse
=
userReadService
.
getUserByOpenIdOrUnionId
(
null
,
openId
);
CloudServerResponse
<
com
.
wwdz
.
user
.
api
.
model
.
user
.
User
>
cloudServerResponse
=
userReadService
.
getUserByOpenIdOrUnionId
(
null
,
openId
);
...
@@ -70,12 +76,14 @@ public class UserDaoImpl implements UserDao {
...
@@ -70,12 +76,14 @@ public class UserDaoImpl implements UserDao {
@Override
@Override
public
User
queryById
(
Long
id
)
{
public
User
queryById
(
Long
id
)
{
CloudServerResponse
<
com
.
wwdz
.
user
.
api
.
model
.
user
.
User
>
cloudServerResponse
=
userReadService
.
getUserIsNotDelete
(
id
);
return
userMapper
.
selectByPrimaryKey
(
id
);
/*CloudServerResponse<com.wwdz.user.api.model.user.User> cloudServerResponse = userReadService.getUserIsNotDelete(id);
if (cloudServerResponse.getCode() != 1001) {
if (cloudServerResponse.getCode() != 1001) {
return new User();
return new User();
}
}
com.wwdz.user.api.model.user.User wUser = cloudServerResponse.getResult();
com.wwdz.user.api.model.user.User wUser = cloudServerResponse.getResult();
return
User
.
of
(
wUser
);
return User.of(wUser);
*/
}
}
@Override
@Override
...
@@ -110,8 +118,12 @@ public class UserDaoImpl implements UserDao {
...
@@ -110,8 +118,12 @@ public class UserDaoImpl implements UserDao {
@Override
@Override
public
int
updateById
(
User
user
)
{
public
int
updateById
(
User
user
)
{
CloudServerResponse
<
Integer
>
cloudServerResponse
=
userWriteService
.
updateByUserId
(
User
.
convertToWWDZUser
(
user
));
UserExample
example
=
new
UserExample
();
return
cloudServerResponse
.
getResult
();
UserExample
.
Criteria
criteria
=
example
.
or
();
criteria
.
andIdEqualTo
(
user
.
getId
());
return
userMapper
.
updateByPrimaryKeySelective
(
user
);
//CloudServerResponse<Integer> cloudServerResponse = userWriteService.updateByUserId(User.convertToWWDZUser(user));
// return cloudServerResponse.getResult();
}
}
@Override
@Override
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
View file @
68c5d996
...
@@ -78,7 +78,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -78,7 +78,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"recordId"
,
id
);
map
.
put
(
"recordId"
,
id
);
String
messageKey
=
StringUtil
.
formatMessageKey
(
dto
.
getFansId
(),
MessageEnum
.
TypeEnum
.
FOLLOW
.
getCode
(),
dto
.
getFollowerId
());
/*
String messageKey = StringUtil.formatMessageKey(dto.getFansId(), MessageEnum.TypeEnum.FOLLOW.getCode(), dto.getFollowerId());
if (redisUtils.hasKey(messageKey)) {
if (redisUtils.hasKey(messageKey)) {
return Result.success(map);
return Result.success(map);
}
}
...
@@ -95,7 +95,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
...
@@ -95,7 +95,7 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
messageRequestDto.setContent(JsonUtils.from(messageContentText));
messageRequestDto.setContent(JsonUtils.from(messageContentText));
messageService.add(messageRequestDto);
messageService.add(messageRequestDto);
//五分钟内再次关注不会发送消息
//五分钟内再次关注不会发送消息
redisUtils
.
set
(
messageKey
,
LocalDateTime
.
now
(),
60
*
5
);
redisUtils.set(messageKey, LocalDateTime.now(), 60 * 5);
*/
return
Result
.
success
(
map
);
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"{} 关注 {} error {}"
,
dto
.
getFansId
(),
dto
.
getFollowerId
(),
e
);
logger
.
error
(
"{} 关注 {} error {}"
,
dto
.
getFansId
(),
dto
.
getFollowerId
(),
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/FollowFansRecordController.java
View file @
68c5d996
...
@@ -30,7 +30,7 @@ public class FollowFansRecordController {
...
@@ -30,7 +30,7 @@ public class FollowFansRecordController {
@PostMapping
(
"/addFollow"
)
@PostMapping
(
"/addFollow"
)
public
Result
addFollow
(
@RequestBody
FollowFansRecordRequestDto
dto
)
{
public
Result
addFollow
(
@RequestBody
FollowFansRecordRequestDto
dto
)
{
logger
.
info
(
"新增关注,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"新增关注,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getFollowerId
()
==
null
||
dto
.
getFansId
()
==
null
)
{
if
(
dto
.
getFollowerId
()
==
null
||
dto
.
getFansId
()
==
null
||
dto
.
getIntroducerId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
}
return
followFansRecordService
.
follow
(
dto
);
return
followFansRecordService
.
follow
(
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