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
cf078818
Commit
cf078818
authored
Dec 26, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录后生成token2
parent
78163dbf
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
572 additions
and
64 deletions
+572
-64
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
.../java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
+8
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/SignInTaskDao.java
...c/main/java/com/wwdz/ch/db/dao/qiandao/SignInTaskDao.java
+2
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInTask.java
.../java/com/wwdz/ch/db/domain/qiandao/QdUserSignInTask.java
+9
-7
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInTaskExample.java
...om/wwdz/ch/db/domain/qiandao/QdUserSignInTaskExample.java
+36
-36
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/qiandao/QdUserSignInTaskRequestDto.java
...ch/db/dto/request/qiandao/QdUserSignInTaskRequestDto.java
+1
-1
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/qiandao/SignInTaskRequestDto.java
.../wwdz/ch/db/dto/request/qiandao/SignInTaskRequestDto.java
+8
-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/java/com/wwdz/ch/db/impl/qiandao/SignInTaskDaoImpl.java
...n/java/com/wwdz/ch/db/impl/qiandao/SignInTaskDaoImpl.java
+9
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdUserSignInTaskMapper.xml
.../com/wwdz/ch/db/mapper/qiandao/QdUserSignInTaskMapper.xml
+17
-17
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/vo/qiandao/SignInTaskVo.java
...n/java/com/wwdz/ch/wx/entity/vo/qiandao/SignInTaskVo.java
+97
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdSignInTaskServiceImpl.java
.../com/wwdz/ch/wx/impl/qiandao/QdSignInTaskServiceImpl.java
+41
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdUserSignInTaskServiceImpl.java
.../wwdz/ch/wx/impl/qiandao/QdUserSignInTaskServiceImpl.java
+123
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
...ava/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
+0
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdSignInTaskService.java
...a/com/wwdz/ch/wx/service/qiandao/QdSignInTaskService.java
+14
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdUserSignInNoteService.java
...m/wwdz/ch/wx/service/qiandao/QdUserSignInNoteService.java
+5
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdUserSignInTaskService.java
...m/wwdz/ch/wx/service/qiandao/QdUserSignInTaskService.java
+22
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdHomePageController.java
...java/com/wwdz/ch/wx/web/qiandao/QdHomePageController.java
+34
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdSignInTaskController.java
...va/com/wwdz/ch/wx/web/qiandao/QdSignInTaskController.java
+43
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdUserSignInNoteController.java
...om/wwdz/ch/wx/web/qiandao/QdUserSignInNoteController.java
+35
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdUserSignInTaskController.java
...om/wwdz/ch/wx/web/qiandao/QdUserSignInTaskController.java
+57
-0
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/QdUserSignInTaskDao.java
View file @
cf078818
...
...
@@ -17,4 +17,12 @@ public interface QdUserSignInTaskDao {
* @return
*/
long
count
(
long
userId
);
/**
* 统计签到任务参加的人数
* @param taskId
* @return
*/
long
countByTaskId
(
long
taskId
);
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/qiandao/SignInTaskDao.java
View file @
cf078818
...
...
@@ -12,4 +12,6 @@ public interface SignInTaskDao {
List
<
SignInTask
>
findByPage
(
SignInTaskRequestDto
dto
);
SignInTask
findById
(
long
taskId
);
boolean
updateByPrimaryKey
(
SignInTask
signInTask
);
}
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInTask.java
View file @
cf078818
...
...
@@ -4,14 +4,16 @@ 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/
25
*/
@Data
public
class
QdUserSignInTask
implements
Serializable
{
public
class
QdUserSignInTask
implements
Entity
{
private
Long
id
;
/**
...
...
@@ -32,7 +34,7 @@ public class QdUserSignInTask implements Serializable {
/**
* 创建时间
*/
private
Date
createTime
Time
;
private
Date
createTime
;
/**
* 更新时间
...
...
@@ -61,7 +63,7 @@ public class QdUserSignInTask implements Serializable {
sb
.
append
(
", userId="
).
append
(
userId
);
sb
.
append
(
", taskId="
).
append
(
taskId
);
sb
.
append
(
", isSelf="
).
append
(
isSelf
);
sb
.
append
(
", createTime
Time="
).
append
(
createTim
eTime
);
sb
.
append
(
", createTime
="
).
append
(
creat
eTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", isValid="
).
append
(
isValid
);
sb
.
append
(
", state="
).
append
(
state
);
...
...
@@ -86,7 +88,7 @@ public class QdUserSignInTask implements Serializable {
&&
(
this
.
getUserId
()
==
null
?
other
.
getUserId
()
==
null
:
this
.
getUserId
().
equals
(
other
.
getUserId
()))
&&
(
this
.
getTaskId
()
==
null
?
other
.
getTaskId
()
==
null
:
this
.
getTaskId
().
equals
(
other
.
getTaskId
()))
&&
(
this
.
getIsSelf
()
==
null
?
other
.
getIsSelf
()
==
null
:
this
.
getIsSelf
().
equals
(
other
.
getIsSelf
()))
&&
(
this
.
getCreateTime
Time
()
==
null
?
other
.
getCreateTimeTime
()
==
null
:
this
.
getCreateTimeTime
().
equals
(
other
.
getCreateTim
eTime
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreat
eTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()))
&&
(
this
.
getIsValid
()
==
null
?
other
.
getIsValid
()
==
null
:
this
.
getIsValid
().
equals
(
other
.
getIsValid
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()));
...
...
@@ -100,7 +102,7 @@ public class QdUserSignInTask implements Serializable {
result
=
prime
*
result
+
((
getUserId
()
==
null
)
?
0
:
getUserId
().
hashCode
());
result
=
prime
*
result
+
((
getTaskId
()
==
null
)
?
0
:
getTaskId
().
hashCode
());
result
=
prime
*
result
+
((
getIsSelf
()
==
null
)
?
0
:
getIsSelf
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
Time
()
==
null
)
?
0
:
getCreateTim
eTime
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreat
eTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
result
=
prime
*
result
+
((
getIsValid
()
==
null
)
?
0
:
getIsValid
().
hashCode
());
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
...
...
@@ -119,7 +121,7 @@ public class QdUserSignInTask implements Serializable {
userId
(
"user_id"
,
"userId"
,
"BIGINT"
,
false
),
taskId
(
"task_id"
,
"taskId"
,
"BIGINT"
,
false
),
isSelf
(
"is_self"
,
"isSelf"
,
"BIT"
,
false
),
createTime
Time
(
"create_time_time"
,
"createTim
eTime"
,
"TIMESTAMP"
,
false
),
createTime
(
"create_time"
,
"creat
eTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
),
isValid
(
"is_valid"
,
"isValid"
,
"BIT"
,
false
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/qiandao/QdUserSignInTaskExample.java
View file @
cf078818
...
...
@@ -676,18 +676,18 @@ public class QdUserSignInTaskExample {
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
IsNull
()
{
addCriterion
(
"create_time
_time
is null"
);
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
IsNotNull
()
{
addCriterion
(
"create_time
_time
is not null"
);
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
EqualTo
(
Date
value
)
{
addCriterion
(
"create_time
_time ="
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
="
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -698,13 +698,13 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
EqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
NotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
_time <>"
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeNotEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
<>"
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -715,13 +715,13 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
NotEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
<> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeNotEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
GreaterThan
(
Date
value
)
{
addCriterion
(
"create_time
_time >"
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeGreaterThan
(
Date
value
)
{
addCriterion
(
"create_time
>"
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -732,13 +732,13 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
GreaterThanColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeGreaterThanColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
GreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
_time >="
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
>="
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -749,13 +749,13 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
GreaterThanOrEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
>= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeGreaterThanOrEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
LessThan
(
Date
value
)
{
addCriterion
(
"create_time
_time <"
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeLessThan
(
Date
value
)
{
addCriterion
(
"create_time
<"
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -766,13 +766,13 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
LessThanColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
< "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeLessThanColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
LessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
_time <="
,
value
,
"createTim
eTime"
);
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"create_time
<="
,
value
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
@@ -783,28 +783,28 @@ public class QdUserSignInTaskExample {
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andCreateTime
Time
LessThanOrEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time
_time
<= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
public
Criteria
andCreateTimeLessThanOrEqualToColumn
(
QdUserSignInTask
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"create_time <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
In
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time
_time in"
,
values
,
"createTim
eTime"
);
public
Criteria
andCreateTimeIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time
in"
,
values
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
NotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time
_time not in"
,
values
,
"createTim
eTime"
);
public
Criteria
andCreateTimeNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"create_time
not in"
,
values
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
Between
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time
_time between"
,
value1
,
value2
,
"createTim
eTime"
);
public
Criteria
andCreateTimeBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time
between"
,
value1
,
value2
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTime
Time
NotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time
_time not between"
,
value1
,
value2
,
"createTim
eTime"
);
public
Criteria
andCreateTimeNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"create_time
not between"
,
value1
,
value2
,
"creat
eTime"
);
return
(
Criteria
)
this
;
}
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/qiandao/QdUserSignInTaskRequestDto.java
View file @
cf078818
...
...
@@ -24,7 +24,7 @@ public class QdUserSignInTaskRequestDto extends BaseRequestDto implements Entity
/**
* 创建时间
*/
private
Date
createTime
Time
;
private
Date
createTime
;
/**
* 更新时间
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/qiandao/SignInTaskRequestDto.java
View file @
cf078818
...
...
@@ -4,6 +4,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
...
...
@@ -31,6 +32,11 @@ public class SignInTaskRequestDto extends BaseRequestDto implements Entity {
*/
private
Date
endValidTime
;
/**
* 用于已经过期的任务
*/
private
Date
filterEndValidTime
;
/**
* 打卡开始时间
*/
...
...
@@ -56,6 +62,8 @@ public class SignInTaskRequestDto extends BaseRequestDto implements Entity {
*/
private
Integer
state
;
private
List
<
Integer
>
stateList
;
/**
* 描述
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/QdUserSignInTaskDaoImpl.java
View file @
cf078818
...
...
@@ -45,4 +45,14 @@ public class QdUserSignInTaskDaoImpl implements QdUserSignInTaskDao {
criteria
.
andIsValidEqualTo
(
true
);
return
qdUserSignInTaskMapper
.
countByExample
(
example
);
}
@Override
public
long
countByTaskId
(
long
taskId
)
{
QdUserSignInTaskExample
example
=
new
QdUserSignInTaskExample
();
QdUserSignInTaskExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andTaskIdEqualTo
(
taskId
);
criteria
.
andIsValidEqualTo
(
true
);
return
qdUserSignInTaskMapper
.
countByExample
(
example
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/qiandao/SignInTaskDaoImpl.java
View file @
cf078818
...
...
@@ -33,6 +33,10 @@ public class SignInTaskDaoImpl implements SignInTaskDao {
SignInTaskExample
example
=
new
SignInTaskExample
();
SignInTaskExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
dto
.
getCreatorId
(),
criteria
::
andCreatorIdEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getFilterEndValidTime
(),
criteria
::
andEndValidTimeLessThanOrEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getType
(),
criteria
::
andTypeEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getState
(),
criteria
::
andStateEqualTo
);
JdbcHelper
.
ifPresent
(
dto
.
getStateList
(),
criteria
::
andStateIn
);
PageHelper
.
startPage
(
dto
.
getPage
(),
dto
.
getLimit
());
example
.
setOrderByClause
(
"create_time desc"
);
return
signInTaskMapper
.
selectByExample
(
example
);
...
...
@@ -43,4 +47,9 @@ public class SignInTaskDaoImpl implements SignInTaskDao {
public
SignInTask
findById
(
long
taskId
)
{
return
signInTaskMapper
.
selectByPrimaryKey
(
taskId
);
}
@Override
public
boolean
updateByPrimaryKey
(
SignInTask
signInTask
)
{
return
signInTaskMapper
.
updateByPrimaryKey
(
signInTask
)
>
0
;
}
}
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/qiandao/QdUserSignInTaskMapper.xml
View file @
cf078818
...
...
@@ -6,7 +6,7 @@
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"task_id"
jdbcType=
"BIGINT"
property=
"taskId"
/>
<result
column=
"is_self"
jdbcType=
"BIT"
property=
"isSelf"
/>
<result
column=
"create_time
_time"
jdbcType=
"TIMESTAMP"
property=
"createTim
eTime"
/>
<result
column=
"create_time
"
jdbcType=
"TIMESTAMP"
property=
"creat
eTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"is_valid"
jdbcType=
"BIT"
property=
"isValid"
/>
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
...
...
@@ -70,7 +70,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id, task_id, is_self, create_time
_time
, update_time, is_valid, `state`
id, user_id, task_id, is_self, create_time, update_time, is_valid, `state`
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInTaskExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -105,7 +105,7 @@
</foreach>
</when>
<otherwise>
id, user_id, task_id, is_self, create_time
_time
, update_time, is_valid, `state`
id, user_id, task_id, is_self, create_time, update_time, is_valid, `state`
</otherwise>
</choose>
from qd_user_sign_in_task
...
...
@@ -136,7 +136,7 @@
</foreach>
</when>
<otherwise>
id, user_id, task_id, is_self, create_time
_time
, update_time, is_valid, `state`
id, user_id, task_id, is_self, create_time, update_time, is_valid, `state`
</otherwise>
</choose>
from qd_user_sign_in_task
...
...
@@ -157,10 +157,10 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into qd_user_sign_in_task (user_id, task_id, is_self,
create_time
_time
, update_time, is_valid,
create_time, update_time, is_valid,
`state`)
values (#{userId,jdbcType=BIGINT}, #{taskId,jdbcType=BIGINT}, #{isSelf,jdbcType=BIT},
#{createTime
Time
,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{isValid,jdbcType=BIT},
#{state,jdbcType=INTEGER})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.qiandao.QdUserSignInTask"
>
...
...
@@ -178,8 +178,8 @@
<if
test=
"isSelf != null"
>
is_self,
</if>
<if
test=
"createTime
Time
!= null"
>
create_time
_time
,
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
...
...
@@ -201,8 +201,8 @@
<if
test=
"isSelf != null"
>
#{isSelf,jdbcType=BIT},
</if>
<if
test=
"createTime
Time
!= null"
>
#{createTime
Time
,jdbcType=TIMESTAMP},
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
...
...
@@ -236,8 +236,8 @@
<if
test=
"record.isSelf != null"
>
is_self = #{record.isSelf,jdbcType=BIT},
</if>
<if
test=
"record.createTime
Time
!= null"
>
create_time
_time = #{record.createTim
eTime,jdbcType=TIMESTAMP},
<if
test=
"record.createTime != null"
>
create_time
= #{record.creat
eTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
...
...
@@ -259,7 +259,7 @@
user_id = #{record.userId,jdbcType=BIGINT},
task_id = #{record.taskId,jdbcType=BIGINT},
is_self = #{record.isSelf,jdbcType=BIT},
create_time
_time = #{record.createTim
eTime,jdbcType=TIMESTAMP},
create_time
= #{record.creat
eTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_valid = #{record.isValid,jdbcType=BIT},
`state` = #{record.state,jdbcType=INTEGER}
...
...
@@ -279,8 +279,8 @@
<if
test=
"isSelf != null"
>
is_self = #{isSelf,jdbcType=BIT},
</if>
<if
test=
"createTime
Time
!= null"
>
create_time
_time = #{createTim
eTime,jdbcType=TIMESTAMP},
<if
test=
"createTime != null"
>
create_time
= #{creat
eTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
...
...
@@ -299,7 +299,7 @@
set user_id = #{userId,jdbcType=BIGINT},
task_id = #{taskId,jdbcType=BIGINT},
is_self = #{isSelf,jdbcType=BIT},
create_time
_time = #{createTim
eTime,jdbcType=TIMESTAMP},
create_time
= #{creat
eTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_valid = #{isValid,jdbcType=BIT},
`state` = #{state,jdbcType=INTEGER}
...
...
@@ -338,7 +338,7 @@
</foreach>
</when>
<otherwise>
id, user_id, task_id, is_self, create_time
_time
, update_time, is_valid, `state`
id, user_id, task_id, is_self, create_time, update_time, is_valid, `state`
</otherwise>
</choose>
from qd_user_sign_in_task
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
cf078818
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.qiandao"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"qd_user_sign_in_
note
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"qd_user_sign_in_
task
"
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/vo/qiandao/SignInTaskVo.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.entity.vo.qiandao
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
SignInTaskVo
implements
Entity
{
private
Long
id
;
/**
* 签到任务名称
*/
private
String
name
;
/**
* 图片
*/
private
String
image
;
/**
* 开始生效时间
*/
private
Date
startValidTime
;
/**
* 有效截止时间
*/
private
Date
endValidTime
;
/**
* 打卡开始时间
*/
private
Date
signInStartTime
;
/**
* 打卡结束时间
*/
private
Date
signInEndTime
;
/**
* 打卡目标天数
*/
private
Integer
goalDays
;
/**
* 打开类型(1连续,2累计)
*/
private
Integer
type
;
/**
* 状态
*/
private
Integer
state
;
/**
* 描述
*/
private
String
desc
;
/**
* 创建人id
*/
private
Long
creatorId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 是否私有
*/
private
Boolean
isPrivate
;
/**
* 是否有奖励
*/
private
Boolean
hasReward
;
/**
* 参加的人数
*/
private
Long
joinPeopleNum
;
/**
* 今天是否签到
*/
private
Boolean
isTodaySignIn
=
false
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/qiandao/QdSignInTaskServiceImpl.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.impl.qiandao
;
import
com.wwdz.ch.core.consts.qiandao.SignInTaskEnum
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.qiandao.SignInTaskDao
;
import
com.wwdz.ch.db.domain.qiandao.SignInTask
;
import
com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdSignInTaskService
;
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
QdSignInTaskServiceImpl
implements
QdSignInTaskService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdSignInTaskServiceImpl
.
class
);
@Autowired
SignInTaskDao
signInTaskDao
;
@Override
public
Result
add
(
SignInTaskRequestDto
dto
)
{
try
{
Date
now
=
new
Date
();
SignInTask
signInTask
=
new
SignInTask
();
signInTask
.
setState
(
SignInTaskEnum
.
StateEnum
.
PROCESSING
.
getCode
());
signInTask
.
setName
(
dto
.
getName
());
signInTask
.
setDesc
(
dto
.
getDesc
());
signInTask
.
setCreateTime
(
now
);
signInTask
.
setUpdateTime
(
now
);
signInTaskDao
.
insert
(
signInTask
);
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/QdUserSignInTaskServiceImpl.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.impl.qiandao
;
import
com.wwdz.ch.core.consts.qiandao.SignInTaskEnum
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dao.qiandao.QdUserSignInDao
;
import
com.wwdz.ch.db.dao.qiandao.QdUserSignInTaskDao
;
import
com.wwdz.ch.db.dao.qiandao.SignInTaskDao
;
import
com.wwdz.ch.db.domain.qiandao.QdUserSignIn
;
import
com.wwdz.ch.db.domain.qiandao.QdUserSignInTask
;
import
com.wwdz.ch.db.domain.qiandao.SignInTask
;
import
com.wwdz.ch.db.dto.request.qiandao.QdUserSignInTaskRequestDto
;
import
com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto
;
import
com.wwdz.ch.wx.entity.vo.qiandao.SignInTaskVo
;
import
com.wwdz.ch.wx.service.qiandao.QdUserSignInTaskService
;
import
com.xxdxxs.utils.EntityMapper
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
@Service
public
class
QdUserSignInTaskServiceImpl
implements
QdUserSignInTaskService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdUserSignInTaskServiceImpl
.
class
);
@Autowired
QdUserSignInDao
qdUserSignInDao
;
@Autowired
SignInTaskDao
signInTaskDao
;
@Autowired
QdUserSignInTaskDao
qdUserSignInTaskDao
;
@Override
public
Result
join
(
QdUserSignInTaskRequestDto
dto
)
{
try
{
SignInTask
signInTask
=
signInTaskDao
.
findById
(
dto
.
getTaskId
());
QdUserSignInTask
qdUserSignInTask
=
new
QdUserSignInTask
();
qdUserSignInTask
.
setUserId
(
dto
.
getUserId
());
qdUserSignInTask
.
setTaskId
(
dto
.
getTaskId
());
qdUserSignInTask
.
setIsSelf
(
signInTask
.
getCreatorId
()
==
dto
.
getUserId
().
longValue
());
qdUserSignInTask
.
setCreateTime
(
new
Date
());
qdUserSignInTask
.
setUpdateTime
(
new
Date
());
qdUserSignInTask
.
setIsValid
(
true
);
qdUserSignInTask
.
setState
(
SignInTaskEnum
.
StateEnum
.
PROCESSING
.
getCode
());
qdUserSignInTaskDao
.
insert
(
qdUserSignInTask
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"加入签到任务 error:{}"
,
e
);
}
return
Result
.
failed
();
}
@Override
public
Result
findTaskList
(
QdUserSignInTaskRequestDto
dto
)
{
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
List
<
SignInTaskVo
>
selfTaskVoList
=
new
ArrayList
<>();
//查询自己创建的任务
dto
.
setIsSelf
(
true
);
List
<
QdUserSignInTask
>
selfTaskList
=
qdUserSignInTaskDao
.
findByPage
(
dto
);
for
(
QdUserSignInTask
qdUserSignInTask
:
selfTaskList
)
{
SignInTaskVo
signInTaskVo
=
new
SignInTaskVo
();
SignInTask
signInTask
=
signInTaskDao
.
findById
(
qdUserSignInTask
.
getTaskId
());
EntityMapper
.
copyAttribute
(
signInTask
,
signInTaskVo
);
QdUserSignIn
qdUserSignIn
=
qdUserSignInDao
.
findTodayRecord
(
qdUserSignInTask
.
getUserId
(),
qdUserSignInTask
.
getTaskId
());
if
(
qdUserSignIn
!=
null
)
{
signInTaskVo
.
setIsTodaySignIn
(
true
);
}
selfTaskVoList
.
add
(
signInTaskVo
);
}
map
.
put
(
"selfTaskVoList"
,
selfTaskVoList
);
//查询其它参加的任务
List
<
SignInTaskVo
>
otherTaskVoList
=
new
ArrayList
<>();
dto
.
setIsSelf
(
false
);
List
<
QdUserSignInTask
>
taskList
=
qdUserSignInTaskDao
.
findByPage
(
dto
);
for
(
QdUserSignInTask
qdUserSignInTask
:
taskList
)
{
SignInTaskVo
signInTaskVo
=
new
SignInTaskVo
();
SignInTask
signInTask
=
signInTaskDao
.
findById
(
qdUserSignInTask
.
getTaskId
());
EntityMapper
.
copyAttribute
(
signInTask
,
signInTaskVo
);
long
joinPeopleNum
=
qdUserSignInTaskDao
.
countByTaskId
(
qdUserSignInTask
.
getTaskId
());
signInTaskVo
.
setJoinPeopleNum
(
joinPeopleNum
);
QdUserSignIn
qdUserSignIn
=
qdUserSignInDao
.
findTodayRecord
(
qdUserSignInTask
.
getUserId
(),
qdUserSignInTask
.
getTaskId
());
if
(
qdUserSignIn
!=
null
)
{
signInTaskVo
.
setIsTodaySignIn
(
true
);
}
otherTaskVoList
.
add
(
signInTaskVo
);
}
map
.
put
(
"otherTaskVoList"
,
otherTaskVoList
);
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询用户签到任务列表 error:{}"
,
e
);
}
return
Result
.
failed
();
}
private
void
checkInvalidTask
()
{
Date
now
=
new
Date
();
SignInTaskRequestDto
signInTaskRequestDto
=
new
SignInTaskRequestDto
();
signInTaskRequestDto
.
setStateList
(
Arrays
.
asList
(
SignInTaskEnum
.
StateEnum
.
NOT_START
.
getCode
(),
SignInTaskEnum
.
StateEnum
.
PROCESSING
.
getCode
()));
List
<
SignInTask
>
signInTaskList
=
signInTaskDao
.
findByPage
(
signInTaskRequestDto
);
for
(
SignInTask
signInTask
:
signInTaskList
)
{
if
(
signInTask
.
getState
().
intValue
()
==
SignInTaskEnum
.
StateEnum
.
PROCESSING
.
getCode
()
&&
signInTask
.
getEndValidTime
().
before
(
now
))
{
SignInTask
updateDto
=
new
SignInTask
();
updateDto
.
setId
(
signInTask
.
getId
());
updateDto
.
setState
(
SignInTaskEnum
.
StateEnum
.
END
.
getCode
());
signInTaskDao
.
updateByPrimaryKey
(
updateDto
);
}
else
if
(
signInTask
.
getState
().
intValue
()
==
SignInTaskEnum
.
StateEnum
.
NOT_START
.
getCode
()
&&
signInTask
.
getStartValidTime
().
after
(
now
))
{
SignInTask
updateDto
=
new
SignInTask
();
updateDto
.
setId
(
signInTask
.
getId
());
updateDto
.
setState
(
SignInTaskEnum
.
StateEnum
.
PROCESSING
.
getCode
());
signInTaskDao
.
updateByPrimaryKey
(
updateDto
);
}
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdHomePageService.java
View file @
cf078818
package
com.wwdz.ch.wx.service.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.domain.qiandao.QdUserSignInNote
;
import
com.wwdz.ch.db.dto.request.qiandao.QdUserSignInNoteRequestDto
;
import
com.wwdz.ch.wx.entity.request.QdHomePageRequestDto
;
public
interface
QdHomePageService
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdSignInTaskService.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.service.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto
;
public
interface
QdSignInTaskService
{
/**
* 创建签到任务
* @param dto
* @return
*/
Result
add
(
SignInTaskRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdUserSignInNoteService.java
View file @
cf078818
...
...
@@ -8,5 +8,10 @@ import com.wwdz.ch.db.dto.request.qiandao.QdUserSignInNoteRequestDto;
*/
public
interface
QdUserSignInNoteService
{
/**
* 查询用户签到笔记
* @param dto
* @return
*/
Result
findSignInNoteList
(
QdUserSignInNoteRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/qiandao/QdUserSignInTaskService.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.service.qiandao
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.qiandao.QdUserSignInTaskRequestDto
;
public
interface
QdUserSignInTaskService
{
/**
* 参加任务
* @param dto
* @return
*/
Result
join
(
QdUserSignInTaskRequestDto
dto
);
/**
* 查询用户参加的签到任务
* @param dto
* @return
*/
Result
findTaskList
(
QdUserSignInTaskRequestDto
dto
);
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdHomePageController.java
0 → 100644
View file @
cf078818
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.entity.request.QdHomePageRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdHomePageService
;
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/qdHomePage"
)
public
class
QdHomePageController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdHomePageController
.
class
);
@Autowired
private
QdHomePageService
qdHomePageService
;
@ApiOperation
(
value
=
"查询首页展示的用户信息"
)
@PostMapping
(
"/findUserInfo"
)
public
Result
findUserInfo
(
@RequestBody
QdHomePageRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询首页展示的用户信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
return
qdHomePageService
.
findUserInfo
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdSignInTaskController.java
0 → 100644
View file @
cf078818
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.SignInTaskRequestDto
;
import
com.wwdz.ch.wx.entity.request.QdHomePageRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdHomePageService
;
import
com.wwdz.ch.wx.service.qiandao.QdSignInTaskService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
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/qdSignInTask"
)
public
class
QdSignInTaskController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdHomePageController
.
class
);
@Autowired
private
QdSignInTaskService
qdSignInTaskService
;
@ApiOperation
(
value
=
"创建签到任务"
)
@PostMapping
(
"/add"
)
public
Result
add
(
@RequestBody
SignInTaskRequestDto
dto
)
{
logger
.
info
(
"【请求开始】创建签到任务,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
set
(
"name"
,
"名称"
).
must
().
string
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
qdSignInTaskService
.
add
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdUserSignInNoteController.java
0 → 100644
View file @
cf078818
package
com.wwdz.ch.wx.web.qiandao
;
import
com.alibaba.fastjson.JSON
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.db.dto.request.qiandao.QdUserSignInNoteRequestDto
;
import
com.wwdz.ch.wx.entity.request.QdHomePageRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdHomePageService
;
import
com.wwdz.ch.wx.service.qiandao.QdUserSignInNoteService
;
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/qdUserSignInNote"
)
public
class
QdUserSignInNoteController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdHomePageController
.
class
);
@Autowired
private
QdUserSignInNoteService
qdUserSignInNoteService
;
@ApiOperation
(
value
=
"查询用户签到笔记"
)
@PostMapping
(
"/findSignInNoteList"
)
public
Result
findSignInNoteList
(
@RequestBody
QdUserSignInNoteRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询用户签到笔记,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
return
qdUserSignInNoteService
.
findSignInNoteList
(
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/qiandao/QdUserSignInTaskController.java
0 → 100644
View file @
cf078818
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.QdUserSignInTaskRequestDto
;
import
com.wwdz.ch.db.dto.request.qiandao.SignInTaskRequestDto
;
import
com.wwdz.ch.wx.service.qiandao.QdSignInTaskService
;
import
com.wwdz.ch.wx.service.qiandao.QdUserSignInTaskService
;
import
com.xxdxxs.service.FormHandler
;
import
com.xxdxxs.validation.Validator
;
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/qdUserSignInTask"
)
public
class
QdUserSignInTaskController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdHomePageController
.
class
);
@Autowired
private
QdUserSignInTaskService
qdUserSignInTaskService
;
@ApiOperation
(
value
=
"参加任务"
)
@PostMapping
(
"/add"
)
public
Result
add
(
@RequestBody
QdUserSignInTaskRequestDto
dto
)
{
logger
.
info
(
"【请求开始】参加任务,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
set
(
"taskId"
,
"任务id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
qdUserSignInTaskService
.
join
(
dto
);
}
@ApiOperation
(
value
=
"查询用户参加的签到任务"
)
@PostMapping
(
"/findTaskList"
)
public
Result
findTaskList
(
@RequestBody
QdUserSignInTaskRequestDto
dto
)
{
logger
.
info
(
"【请求开始】查询用户参加的签到任务,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
qdUserSignInTaskService
.
findTaskList
(
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