Skip to content

Commit ff0fb0c

Browse files
committed
优化代码
1 parent f57022c commit ff0fb0c

File tree

3 files changed

+20
-31
lines changed

3 files changed

+20
-31
lines changed

java110-core/src/main/java/com/java110/core/factory/AuthenticationFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ public static void main(String[] args) throws Exception {
665665
// System.out.println("私钥:" + new String(Base64.getEncoder().encode(privateKey.getEncoded())));
666666

667667
System.out.printf("passwdMd5 " + passwdMd5("V1TAj91GZXNNMlAR"));
668+
System.out.printf("passwdMd5 " + md5("5616d148-c941-4873-9c1f-b59a08b4068320240108140611992020061452450002page=1&row=1123"));
668669

669670
}
670671

java110-db/src/main/resources/mapper/user/QuestionAnswerV1ServiceDaoImplMapper.xml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
2-
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
2+
<!DOCTYPE mapper
3+
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
34
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
45
<mapper namespace="questionAnswerV1ServiceDaoImpl">
56

7+
68
<!-- 保存问卷投票信息 add by wuxw 2018-07-03 -->
79
<insert id="saveQuestionAnswerInfo" parameterType="Map">
8-
insert into question_answer(qa_name, qa_type, start_time, remark, end_time, community_id, content, qa_id, state,
9-
obj_type, obj_id)
10-
values (#{qaName}, #{qaType}, #{startTime}, #{remark}, #{endTime}, #{communityId}, #{content}, #{qaId},
11-
#{state}, #{objType}, #{objId})
10+
insert into question_answer(
11+
qa_name,qa_type,start_time,remark,end_time,community_id,content,qa_id,state
12+
) values (
13+
#{qaName},#{qaType},#{startTime},#{remark},#{endTime},#{communityId},#{content},#{qaId},#{state}
14+
)
1215
</insert>
1316

17+
1418
<!-- 查询问卷投票信息 add by wuxw 2018-07-03 -->
1519
<select id="getQuestionAnswerInfo" parameterType="Map" resultType="Map">
1620
select t.qa_name,t.qa_name qaName,t.qa_type,t.qa_type qaType,t.start_time,t.start_time
1721
startTime,t.remark,t.status_cd,t.status_cd statusCd,t.end_time,t.end_time endTime,t.community_id,t.community_id
18-
communityId,t.content,t.qa_id,t.qa_id qaId,t.create_time createTime,t.state,t.obj_type,t.obj_type objType,
19-
t.obj_id,t.obj_id objId, count(uqa1.user_qa_id) voteCount,td.name qaTypeName
22+
communityId,t.content,t.qa_id,t.qa_id qaId,t.create_time createTime,t.state,count(uqa1.user_qa_id) voteCount
2023
from question_answer t
2124
left join user_question_answer uqa1 on t.qa_id = uqa1.qa_id and uqa1.status_cd = '0'
22-
left join t_dict td on t.qa_type = td.status_cd and td.table_name = 'question_answer' and td.table_columns =
23-
'qa_type'
2425
where 1 =1
2526
<if test="qaName !=null and qaName != ''">
2627
and t.qa_name= #{qaName}
@@ -52,20 +53,15 @@
5253
<if test="state !=null and state != ''">
5354
and t.state= #{state}
5455
</if>
55-
<if test="objType !=null and objType != ''">
56-
and t.obj_type= #{objType}
57-
</if>
58-
<if test="objId !=null and objId != ''">
59-
and t.obj_id= #{objId}
60-
</if>
61-
group by
62-
t.qa_name,t.qa_type,t.start_time,t.remark,t.status_cd,t.end_time,t.community_id,t.content,t.qa_id,t.create_time,t.state
56+
group by t.qa_name,t.qa_type,t.start_time,t.remark,t.status_cd,t.end_time,t.community_id,t.content,t.qa_id,t.create_time,t.state
6357
order by t.create_time desc
6458
<if test="page != -1 and page != null ">
6559
limit #{page}, #{row}
6660
</if>
61+
6762
</select>
6863

64+
6965
<!-- 修改问卷投票信息 add by wuxw 2018-07-03 -->
7066
<update id="updateQuestionAnswerInfo" parameterType="Map">
7167
update question_answer t set t.status_cd = #{statusCd}
@@ -93,19 +89,14 @@
9389
<if test="content !=null and content != ''">
9490
, t.content= #{content}
9591
</if>
96-
<if test="objType !=null and objType != ''">
97-
, t.obj_type= #{objType}
98-
</if>
99-
<if test="objId !=null and objId != ''">
100-
, t.obj_id= #{objId}
101-
</if>
10292
where 1=1
10393
<if test="qaId !=null and qaId != ''">
10494
and t.qa_id= #{qaId}
10595
</if>
10696
<if test="communityId !=null and communityId != ''">
10797
and t.community_id= #{communityId}
10898
</if>
99+
109100
</update>
110101

111102
<!-- 查询问卷投票数量 add by wuxw 2018-07-03 -->
@@ -143,14 +134,11 @@
143134
<if test="state !=null and state != ''">
144135
and t.state= #{state}
145136
</if>
146-
<if test="objType !=null and objType != ''">
147-
and t.obj_type= #{objType}
148-
</if>
149-
<if test="objId !=null and objId != ''">
150-
and t.obj_id= #{objId}
151-
</if>
137+
138+
152139
</select>
153140

141+
154142
<select id="queryVotedCountAndScore" parameterType="Map" resultType="Map">
155143
select qa_id qaId, count(1) votedCount,SUM(t.score) score
156144
from user_question_answer t

service-user/src/main/java/com/java110/user/cmd/user/UserSendSmsCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.java110.utils.util.Assert;
2020
import com.java110.utils.util.StringUtil;
2121
import com.java110.utils.util.ValidatorUtil;
22+
import com.java110.vo.ResultVo;
2223
import org.springframework.beans.factory.annotation.Autowired;
2324
import org.springframework.http.HttpStatus;
2425
import org.springframework.http.ResponseEntity;
@@ -105,8 +106,7 @@ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJso
105106
smsDto.setMsg("您的验证码为" + msgCode);
106107
}
107108

108-
ResponseEntity<String> sendMessageResult = new ResponseEntity<String>(smsDto.getMsg(), smsDto.isSuccess() ? HttpStatus.OK : HttpStatus.BAD_REQUEST);
109-
context.setResponseEntity(sendMessageResult);
109+
context.setResponseEntity(ResultVo.createResponseEntity(smsDto.getMsg()));
110110
} finally {
111111
//清理事务信息
112112
DistributedLock.releaseDistributedLock(key, requestId);

0 commit comments

Comments
 (0)