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
e8c18c66
Commit
e8c18c66
authored
Dec 23, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
签到笔记点赞
parent
19ad3519
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
504 additions
and
41 deletions
+504
-41
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdGiveLikeRecordDao.java
.../java/com/wwdz/ch/db/dao/qiandao/QdGiveLikeRecordDao.java
+2
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInDao.java
...main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInDao.java
+6
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInNoteDao.java
.../java/com/wwdz/ch/db/dao/qiandao/QdUserSignInNoteDao.java
+2
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
.../java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
+7
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdGiveLikeRecord.java
.../java/com/wwdz/ch/db/domain/qiandao/QdGiveLikeRecord.java
+5
-3
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdGiveLikeRecordExample.java
...om/wwdz/ch/db/domain/qiandao/QdGiveLikeRecordExample.java
+10
-10
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInNote.java
.../java/com/wwdz/ch/db/domain/qiandao/QdUserSignInNote.java
+14
-3
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInNoteExample.java
...om/wwdz/ch/db/domain/qiandao/QdUserSignInNoteExample.java
+132
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdGiveLikeRecordDaoImpl.java
.../com/wwdz/ch/db/impl/qiandao/QdGiveLikeRecordDaoImpl.java
+14
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInDaoImpl.java
...java/com/wwdz/ch/db/impl/qiandao/QdUserSignInDaoImpl.java
+9
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInNoteDaoImpl.java
.../com/wwdz/ch/db/impl/qiandao/QdUserSignInNoteDaoImpl.java
+14
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInTaskDaoImpl.java
.../com/wwdz/ch/db/impl/qiandao/QdUserSignInTaskDaoImpl.java
+10
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdGiveLikeRecordMapper.xml
.../com/wwdz/ch/db/mapper/qiandao/QdGiveLikeRecordMapper.xml
+10
-10
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdUserSignInNoteMapper.xml
.../com/wwdz/ch/db/mapper/qiandao/QdUserSignInNoteMapper.xml
+28
-13
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/QdHomePageRequestDto.java
...a/com/wwdz/ch/wx/entity/request/QdHomePageRequestDto.java
+16
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/qiandao/QdHomePageVo.java
...n/java/com/wwdz/ch/wx/entity/vo/qiandao/QdHomePageVo.java
+9
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdGiveLikeRecordServiceImpl.java
.../wwdz/ch/wx/impl/qiandao/QdGiveLikeRecordServiceImpl.java
+74
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdHomePageServiceImpl.java
...va/com/wwdz/ch/wx/impl/qiandao/QdHomePageServiceImpl.java
+53
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdGiveLikeRecordService.java
...m/wwdz/ch/wx/service/qiandao/QdGiveLikeRecordService.java
+20
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
...ava/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
+17
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdGiveLikeRecordController.java
...om/wwdz/ch/wx/web/qiandao/QdGiveLikeRecordController.java
+50
-0
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
+1
-1
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdGiveLikeRecordDao.java
View file @
e8c18c66
...
...
@@ -8,4 +8,6 @@ public interface QdGiveLikeRecordDao {
boolean
insert
(
QdGiveLikeRecord
qdGiveLikeRecord
);
long
countByNoteId
(
long
noteId
);
boolean
cancel
(
long
userId
,
long
noteId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInDao.java
View file @
e8c18c66
...
...
@@ -42,4 +42,10 @@ public interface QdUserSignInDao {
boolean
updateInvalid
(
QdUserSignInRequestDto
dto
);
/**
* 查询总打卡数
* 签到任务id为空时,则统计所有任务
*/
long
countTotalRecord
(
Long
userId
,
Long
taskId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInNoteDao.java
View file @
e8c18c66
...
...
@@ -11,5 +11,7 @@ public interface QdUserSignInNoteDao {
List
<
QdUserSignInNote
>
findByPage
(
QdUserSignInNoteRequestDto
dto
);
QdUserSignInNote
findByNoteId
(
long
noteId
);
boolean
updateByPrimaryKey
(
QdUserSignInNote
qdUserSignInNote
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
View file @
e8c18c66
...
...
@@ -10,4 +10,11 @@ public interface QdUserSignInTaskDao {
boolean
insert
(
QdUserSignInTask
qdUserSignInTask
);
List
<
QdUserSignInTask
>
findByPage
(
QdUserSignInTaskRequestDto
dto
);
/**
* 统计用户参加的签到任务数量
* @param userId
* @return
*/
long
count
(
long
userId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdGiveLikeRecord.java
View file @
e8c18c66
package
com.wwdz.ch.db.domain.qiandao
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2024/12/
19
* @date 2024/12/
23
*/
@Data
public
class
QdGiveLikeRecord
implements
Entity
{
...
...
@@ -40,7 +42,7 @@ public class QdGiveLikeRecord implements Entity {
/**
* 更新时间
*/
private
Integer
updateTime
;
private
Date
updateTime
;
/**
* 是否有效
...
...
@@ -115,7 +117,7 @@ public class QdGiveLikeRecord implements Entity {
noteId
(
"note_id"
,
"noteId"
,
"BIGINT"
,
false
),
noteCreatorId
(
"note_creator_id"
,
"noteCreatorId"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"
INTEGER
"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"
TIMESTAMP
"
,
false
),
isValid
(
"is_valid"
,
"isValid"
,
"BIT"
,
false
);
/**
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdGiveLikeRecordExample.java
View file @
e8c18c66
...
...
@@ -818,7 +818,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeEqualTo
(
Integer
value
)
{
public
Criteria
andUpdateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"update_time ="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -835,7 +835,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotEqualTo
(
Integer
value
)
{
public
Criteria
andUpdateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"update_time <>"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -852,7 +852,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThan
(
Integer
value
)
{
public
Criteria
andUpdateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"update_time >"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -869,7 +869,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andUpdateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"update_time >="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -886,7 +886,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThan
(
Integer
value
)
{
public
Criteria
andUpdateTimeLessThan
(
Date
value
)
{
addCriterion
(
"update_time <"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -903,7 +903,7 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThanOrEqualTo
(
Integer
value
)
{
public
Criteria
andUpdateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"update_time <="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -920,22 +920,22 @@ public class QdGiveLikeRecordExample {
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIn
(
List
<
Integer
>
values
)
{
public
Criteria
andUpdateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"update_time in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotIn
(
List
<
Integer
>
values
)
{
public
Criteria
andUpdateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"update_time not in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andUpdateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"update_time between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotBetween
(
Integer
value1
,
Integer
value2
)
{
public
Criteria
andUpdateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInNote.java
View file @
e8c18c66
package
com.wwdz.ch.db.domain.qiandao
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
* @author shiyu
* @date 2024/12/
18
* @date 2024/12/
23
*/
@Data
public
class
QdUserSignInNote
implements
Entity
{
...
...
@@ -74,6 +76,11 @@ public class QdUserSignInNote implements Entity {
*/
private
Boolean
isDeleted
;
/**
* 点赞数
*/
private
Integer
likeNum
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
...
...
@@ -95,6 +102,7 @@ public class QdUserSignInNote implements Entity {
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", isDeleted="
).
append
(
isDeleted
);
sb
.
append
(
", likeNum="
).
append
(
likeNum
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
...
...
@@ -124,7 +132,8 @@ public class QdUserSignInNote implements Entity {
&&
(
this
.
getIsPrivate
()
==
null
?
other
.
getIsPrivate
()
==
null
:
this
.
getIsPrivate
().
equals
(
other
.
getIsPrivate
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getIsDeleted
()
==
null
?
other
.
getIsDeleted
()
==
null
:
this
.
getIsDeleted
().
equals
(
other
.
getIsDeleted
()));
&&
(
this
.
getIsDeleted
()
==
null
?
other
.
getIsDeleted
()
==
null
:
this
.
getIsDeleted
().
equals
(
other
.
getIsDeleted
()))
&&
(
this
.
getLikeNum
()
==
null
?
other
.
getLikeNum
()
==
null
:
this
.
getLikeNum
().
equals
(
other
.
getLikeNum
()));
}
@Override
...
...
@@ -144,6 +153,7 @@ public class QdUserSignInNote implements Entity {
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getIsDeleted
()
==
null
)
?
0
:
getIsDeleted
().
hashCode
());
result
=
prime
*
result
+
((
getLikeNum
()
==
null
)
?
0
:
getLikeNum
().
hashCode
());
return
result
;
}
...
...
@@ -167,7 +177,8 @@ public class QdUserSignInNote implements Entity {
isPrivate
(
"is_private"
,
"isPrivate"
,
"BIT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
isDeleted
(
"is_deleted"
,
"isDeleted"
,
"BIT"
,
false
);
isDeleted
(
"is_deleted"
,
"isDeleted"
,
"BIT"
,
false
),
likeNum
(
"like_num"
,
"likeNum"
,
"INTEGER"
,
false
);
/**
* This field was generated by MyBatis Generator.
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInNoteExample.java
View file @
e8c18c66
...
...
@@ -1913,6 +1913,138 @@ public class QdUserSignInNoteExample {
addCriterion
(
"is_deleted not between"
,
value1
,
value2
,
"isDeleted"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumIsNull
()
{
addCriterion
(
"like_num is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumIsNotNull
()
{
addCriterion
(
"like_num is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumEqualTo
(
Integer
value
)
{
addCriterion
(
"like_num ="
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumEqualToColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumNotEqualTo
(
Integer
value
)
{
addCriterion
(
"like_num <>"
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumNotEqualToColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumGreaterThan
(
Integer
value
)
{
addCriterion
(
"like_num >"
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumGreaterThanColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumGreaterThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"like_num >="
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumGreaterThanOrEqualToColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumLessThan
(
Integer
value
)
{
addCriterion
(
"like_num <"
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumLessThanColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumLessThanOrEqualTo
(
Integer
value
)
{
addCriterion
(
"like_num <="
,
value
,
"likeNum"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table qd_user_sign_in_note
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andLikeNumLessThanOrEqualToColumn
(
QdUserSignInNote
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"like_num <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"like_num in"
,
values
,
"likeNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumNotIn
(
List
<
Integer
>
values
)
{
addCriterion
(
"like_num not in"
,
values
,
"likeNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"like_num between"
,
value1
,
value2
,
"likeNum"
);
return
(
Criteria
)
this
;
}
public
Criteria
andLikeNumNotBetween
(
Integer
value1
,
Integer
value2
)
{
addCriterion
(
"like_num not between"
,
value1
,
value2
,
"likeNum"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdGiveLikeRecordDaoImpl.java
View file @
e8c18c66
...
...
@@ -7,6 +7,8 @@ import com.wwdz.ch.db.mapper.qiandao.QdGiveLikeRecordMapper;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
import
java.util.Date
;
@Repository
public
class
QdGiveLikeRecordDaoImpl
implements
QdGiveLikeRecordDao
{
...
...
@@ -26,4 +28,16 @@ public class QdGiveLikeRecordDaoImpl implements QdGiveLikeRecordDao {
criteria
.
andIsValidEqualTo
(
true
);
return
qdGiveLikeRecordMapper
.
countByExample
(
example
);
}
@Override
public
boolean
cancel
(
long
userId
,
long
noteId
)
{
QdGiveLikeRecordExample
example
=
new
QdGiveLikeRecordExample
();
QdGiveLikeRecordExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andNoteIdEqualTo
(
noteId
);
QdGiveLikeRecord
qdGiveLikeRecord
=
new
QdGiveLikeRecord
();
qdGiveLikeRecord
.
setIsValid
(
false
);
qdGiveLikeRecord
.
setUpdateTime
(
new
Date
());
return
qdGiveLikeRecordMapper
.
updateByExampleSelective
(
qdGiveLikeRecord
,
example
)
>
0
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInDaoImpl.java
View file @
e8c18c66
...
...
@@ -135,4 +135,13 @@ public class QdUserSignInDaoImpl implements QdUserSignInDao {
}
@Override
public
long
countTotalRecord
(
Long
userId
,
Long
taskId
)
{
QdUserSignInExample
example
=
new
QdUserSignInExample
();
QdUserSignInExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
JdbcHelper
.
ifPresent
(
taskId
,
criteria:
:
andTaskIdEqualTo
);
criteria
.
andIsValidEqualTo
(
true
);
return
qdUserSignInMapper
.
countByExample
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInNoteDaoImpl.java
View file @
e8c18c66
...
...
@@ -30,8 +30,22 @@ public class QdUserSignInNoteDaoImpl implements QdUserSignInNoteDao {
JdbcHelper
.
ifPresent
(
dto
.
getTaskId
(),
criteria
::
andTaskIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getUserId
(),
criteria
::
andUserIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getIsPrivate
(),
criteria
::
andIsPrivateEqualTo
);
criteria
.
andIsDeletedEqualTo
(
false
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
example
.
setOrderByClause
(
"create_time desc"
);
return
qdUserSignInNoteMapper
.
selectByExample
(
example
);
}
@Override
public
QdUserSignInNote
findByNoteId
(
long
noteId
)
{
QdUserSignInNoteExample
example
=
new
QdUserSignInNoteExample
();
QdUserSignInNoteExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdEqualTo
(
noteId
);
return
qdUserSignInNoteMapper
.
selectOneByExample
(
example
);
}
@Override
public
boolean
updateByPrimaryKey
(
QdUserSignInNote
qdUserSignInNote
)
{
return
qdUserSignInNoteMapper
.
updateByPrimaryKeySelective
(
qdUserSignInNote
)
>
0
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInTaskDaoImpl.java
View file @
e8c18c66
...
...
@@ -35,4 +35,14 @@ public class QdUserSignInTaskDaoImpl implements QdUserSignInTaskDao {
example
.
setOrderByClause
(
"create_time desc"
);
return
qdUserSignInTaskMapper
.
selectByExample
(
example
);
}
@Override
public
long
count
(
long
userId
)
{
QdUserSignInTaskExample
example
=
new
QdUserSignInTaskExample
();
QdUserSignInTaskExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andIsValidEqualTo
(
true
);
return
qdUserSignInTaskMapper
.
countByExample
(
example
);
}
}
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdGiveLikeRecordMapper.xml
View file @
e8c18c66
...
...
@@ -7,7 +7,7 @@
<result
column=
"note_id"
jdbcType=
"BIGINT"
property=
"noteId"
/>
<result
column=
"note_creator_id"
jdbcType=
"BIGINT"
property=
"noteCreatorId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"
INTEGER
"
property=
"updateTime"
/>
<result
column=
"update_time"
jdbcType=
"
TIMESTAMP
"
property=
"updateTime"
/>
<result
column=
"is_valid"
jdbcType=
"BIT"
property=
"isValid"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
...
...
@@ -98,7 +98,7 @@
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
...
...
@@ -129,7 +129,7 @@
-->
select
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
...
...
@@ -159,7 +159,7 @@
create_time, update_time, is_valid
)
values (#{userId,jdbcType=BIGINT}, #{noteId,jdbcType=BIGINT}, #{noteCreatorId,jdbcType=BIGINT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=
INTEGER
}, #{isValid,jdbcType=BIT}
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=
TIMESTAMP
}, #{isValid,jdbcType=BIT}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdGiveLikeRecord"
>
...
...
@@ -201,7 +201,7 @@
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=
INTEGER
},
#{updateTime,jdbcType=
TIMESTAMP
},
</if>
<if
test=
"isValid != null"
>
#{isValid,jdbcType=BIT},
...
...
@@ -233,7 +233,7 @@
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=
INTEGER
},
update_time = #{record.updateTime,jdbcType=
TIMESTAMP
},
</if>
<if
test=
"record.isValid != null"
>
is_valid = #{record.isValid,jdbcType=BIT},
...
...
@@ -250,7 +250,7 @@
note_id = #{record.noteId,jdbcType=BIGINT},
note_creator_id = #{record.noteCreatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=
INTEGER
},
update_time = #{record.updateTime,jdbcType=
TIMESTAMP
},
is_valid = #{record.isValid,jdbcType=BIT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -272,7 +272,7 @@
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=
INTEGER
},
update_time = #{updateTime,jdbcType=
TIMESTAMP
},
</if>
<if
test=
"isValid != null"
>
is_valid = #{isValid,jdbcType=BIT},
...
...
@@ -286,7 +286,7 @@
note_id = #{noteId,jdbcType=BIGINT},
note_creator_id = #{noteCreatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=
INTEGER
},
update_time = #{updateTime,jdbcType=
TIMESTAMP
},
is_valid = #{isValid,jdbcType=BIT}
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -317,7 +317,7 @@
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdUserSignInNoteMapper.xml
View file @
e8c18c66
...
...
@@ -15,6 +15,7 @@
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"is_deleted"
jdbcType=
"BIT"
property=
"isDeleted"
/>
<result
column=
"like_num"
jdbcType=
"INTEGER"
property=
"likeNum"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -76,7 +77,7 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id, task_id, title, content, image, audio, sign_in_date, record_id, is_private,
create_time, update_time, is_deleted
create_time, update_time, is_deleted
, like_num
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInNoteExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -105,14 +106,14 @@
distinct
</if>
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, task_id, title, content, image, audio, sign_in_date, record_id, is_private,
create_time, update_time, is_deleted
create_time, update_time, is_deleted
, like_num
</otherwise>
</choose>
from qd_user_sign_in_note
...
...
@@ -137,14 +138,14 @@
-->
select
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, task_id, title, content, image, audio, sign_in_date, record_id, is_private,
create_time, update_time, is_deleted
create_time, update_time, is_deleted
, like_num
</otherwise>
</choose>
from qd_user_sign_in_note
...
...
@@ -167,13 +168,13 @@
insert into qd_user_sign_in_note (user_id, task_id, title,
content, image, audio,
sign_in_date, record_id, is_private,
create_time, update_time, is_deleted
)
create_time, update_time, is_deleted
,
like_num
)
values (#{userId,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR}, #{audio,jdbcType=VARCHAR},
#{signInDate,jdbcType=VARCHAR}, #{recordId,jdbcType=BIGINT}, #{isPrivate,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}
)
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT}
,
#{likeNum,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInNote"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
...
@@ -217,6 +218,9 @@
<if
test=
"isDeleted != null"
>
is_deleted,
</if>
<if
test=
"likeNum != null"
>
like_num,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
...
...
@@ -255,6 +259,9 @@
<if
test=
"isDeleted != null"
>
#{isDeleted,jdbcType=BIT},
</if>
<if
test=
"likeNum != null"
>
#{likeNum,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInNoteExample"
resultType=
"java.lang.Long"
>
...
...
@@ -305,6 +312,9 @@
<if
test=
"record.isDeleted != null"
>
is_deleted = #{record.isDeleted,jdbcType=BIT},
</if>
<if
test=
"record.likeNum != null"
>
like_num = #{record.likeNum,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -324,7 +334,8 @@
is_private = #{record.isPrivate,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT}
is_deleted = #{record.isDeleted,jdbcType=BIT},
like_num = #{record.likeNum,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -368,6 +379,9 @@
<if
test=
"isDeleted != null"
>
is_deleted = #{isDeleted,jdbcType=BIT},
</if>
<if
test=
"likeNum != null"
>
like_num = #{likeNum,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
...
...
@@ -384,7 +398,8 @@
is_private = #{isPrivate,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT}
is_deleted = #{isDeleted,jdbcType=BIT},
like_num = #{likeNum,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInNoteExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -414,14 +429,14 @@
select
'true' as QUERYID,
<choose>
<when
test=
"selective != null and selective.length
>
0"
>
<when
test=
"selective != null and selective.length
>
0"
>
<foreach
collection=
"selective"
item=
"column"
separator=
","
>
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
id, user_id, task_id, title, content, image, audio, sign_in_date, record_id, is_private,
create_time, update_time, is_deleted
create_time, update_time, is_deleted
, like_num
</otherwise>
</choose>
from qd_user_sign_in_note
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
e8c18c66
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.qiandao"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
sign_in_task
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
qd_user_sign_in_note
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/QdHomePageRequestDto.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.entity.request
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
QdHomePageRequestDto
implements
Entity
{
private
Long
userId
;
/**
* 只看自己
*/
private
Boolean
onlySelf
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/qiandao/QdHomePageVo.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.entity.vo.qiandao
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
@Data
public
class
QdHomePageVo
implements
Entity
{
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdGiveLikeRecordServiceImpl.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.impl.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.qiandao.QdGiveLikeRecordDao
;
import
com.wwdz.ch.db.dao.qiandao.QdUserSignInNoteDao
;
import
com.wwdz.ch.db.domain.qiandao.QdGiveLikeRecord
;
import
com.wwdz.ch.db.domain.qiandao.QdUserSignInNote
;
import
com.wwdz.ch.db.dto.request.qiandao.QdGiveLikeRecordRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdGiveLikeRecordService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
@Service
public
class
QdGiveLikeRecordServiceImpl
implements
QdGiveLikeRecordService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdGiveLikeRecordServiceImpl
.
class
);
@Autowired
QdGiveLikeRecordDao
qdGiveLikeRecordDao
;
@Autowired
QdUserSignInNoteDao
qdUserSignInNoteDao
;
@Override
public
Result
giveLike
(
QdGiveLikeRecordRequestDto
dto
)
{
try
{
Date
now
=
new
Date
();
QdGiveLikeRecord
qdGiveLikeRecord
=
new
QdGiveLikeRecord
();
qdGiveLikeRecord
.
setUserId
(
dto
.
getUserId
());
qdGiveLikeRecord
.
setNoteId
(
dto
.
getNoteId
());
//查询笔记信息
QdUserSignInNote
qdUserSignInNote
=
qdUserSignInNoteDao
.
findByNoteId
(
dto
.
getNoteId
());
qdGiveLikeRecord
.
setNoteCreatorId
(
qdUserSignInNote
.
getUserId
());
qdGiveLikeRecord
.
setCreateTime
(
now
);
qdGiveLikeRecord
.
setUpdateTime
(
now
);
qdGiveLikeRecord
.
setIsValid
(
true
);
qdGiveLikeRecordDao
.
insert
(
qdGiveLikeRecord
);
//更新笔记点赞数
QdUserSignInNote
qdUserSignInNoteUpdateDto
=
new
QdUserSignInNote
();
qdUserSignInNoteUpdateDto
.
setId
(
qdUserSignInNote
.
getId
());
qdUserSignInNoteUpdateDto
.
setLikeNum
(
qdUserSignInNote
.
getLikeNum
()
+
1
);
qdUserSignInNoteUpdateDto
.
setUpdateTime
(
now
);
qdUserSignInNoteDao
.
updateByPrimaryKey
(
qdUserSignInNote
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"点赞签到笔记失败 error:{}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
cancelLike
(
QdGiveLikeRecordRequestDto
dto
)
{
try
{
qdGiveLikeRecordDao
.
cancel
(
dto
.
getUserId
(),
dto
.
getNoteId
());
QdUserSignInNote
qdUserSignInNote
=
qdUserSignInNoteDao
.
findByNoteId
(
dto
.
getNoteId
());
//更新笔记点赞数
QdUserSignInNote
qdUserSignInNoteUpdateDto
=
new
QdUserSignInNote
();
qdUserSignInNoteUpdateDto
.
setId
(
qdUserSignInNote
.
getId
());
qdUserSignInNoteUpdateDto
.
setLikeNum
(
qdUserSignInNote
.
getLikeNum
()
-
1
);
qdUserSignInNoteUpdateDto
.
setUpdateTime
(
new
Date
());
qdUserSignInNoteDao
.
updateByPrimaryKey
(
qdUserSignInNote
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"取消点赞失败 error:{}"
,
e
);
}
return
Result
.
failed
();
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdHomePageServiceImpl.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.impl.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.qiandao.QdUserDao
;
import
com.wwdz.ch.db.dao.qiandao.QdUserSignInNoteDao
;
import
com.wwdz.ch.db.dao.qiandao.QdUserSignInTaskDao
;
import
com.wwdz.ch.db.dao.qiandao.SignInTaskDao
;
import
com.wwdz.ch.wx.entity.request.QdHomePageRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdHomePageService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
public
class
QdHomePageServiceImpl
implements
QdHomePageService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdHomePageServiceImpl
.
class
);
@Autowired
QdUserDao
qdUserDao
;
@Autowired
QdUserSignInTaskDao
qdUserSignInTaskDao
;
@Autowired
QdUserSignInNoteDao
qdUserSignInNoteDao
;
@Autowired
SignInTaskDao
signInTaskDao
;
@Override
public
Result
findHomePage
(
QdHomePageRequestDto
dto
)
{
try
{
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询乾岛首页信息失败 error:{}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
findSignInNoteList
(
QdHomePageRequestDto
dto
)
{
try
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询签到笔记失败 error:{}"
,
e
);
}
return
Result
.
failed
();
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdGiveLikeRecordService.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.service.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.qiandao.QdGiveLikeRecordRequestDto
;
public
interface
QdGiveLikeRecordService
{
/**
* 点赞
* @return
*/
Result
giveLike
(
QdGiveLikeRecordRequestDto
dto
);
/**
* 取消点赞
* @param dto
* @return
*/
Result
cancelLike
(
QdGiveLikeRecordRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.service.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.wx.entity.request.QdHomePageRequestDto
;
public
interface
QdHomePageService
{
/**
* 查询首页信息
* @param dto
* @return
*/
Result
findHomePage
(
QdHomePageRequestDto
dto
);
Result
findSignInNoteList
(
QdHomePageRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdGiveLikeRecordController.java
0 → 100644
View file @
e8c18c66
package
com.wwdz.ch.wx.web.qiandao
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.consts.ResultCode
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.qiandao.QdGiveLikeRecordRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdGiveLikeRecordService
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
"/wx/qdGiveLikeRecord"
)
public
class
QdGiveLikeRecordController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdUserController
.
class
);
@Autowired
QdGiveLikeRecordService
qdGiveLikeRecordService
;
@ApiOperation
(
value
=
"点赞"
)
@PostMapping
(
"/giveLike"
)
public
Result
giveLike
(
@RequestBody
QdGiveLikeRecordRequestDto
dto
)
{
logger
.
info
(
"【请求开始】签到笔记点赞,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getUserId
()
==
null
||
dto
.
getNoteId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
qdGiveLikeRecordService
.
giveLike
(
dto
);
}
@ApiOperation
(
value
=
"取消点赞"
)
@PostMapping
(
"/cancelLike"
)
public
Result
cancelLike
(
@RequestBody
QdGiveLikeRecordRequestDto
dto
)
{
logger
.
info
(
"【请求开始】取消点赞,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getUserId
()
==
null
||
dto
.
getNoteId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
qdGiveLikeRecordService
.
cancelLike
(
dto
);
}
}
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
e8c18c66
...
...
@@ -89,7 +89,7 @@ public class WxPayServiceTest {
@Test
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"DA2412231
150567567502"
,
"DA2412231152083026099
"
);
List
<
String
>
list
=
Arrays
.
asList
(
"DA2412231
422109063526
"
);
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
...
...
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