Commit 3717e29c by jscat

nyx_app_key 更新match point的接口

1. 添加tbl_match接口
2. 添加tbl_match_bonus接口
3. 更新match_status接口
4. 查找v_match_point接口
parent 6cbbdb3c
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -15,43 +15,28 @@ import java.util.List;
@Repository
public interface Rockwell_keyMapper {
/* quiz api */
List<Rockwell_keyT_quiz> getT_quiz(Rockwell_keyT_quizQuery rockwell_keyT_quizQuery);
List<Rockwell_keyT_quiz> getT_quizRand();
List<Rockwell_keyT_quiz> getT_quizItem(Rockwell_keyT_quizQuery rockwell_keyT_quizQuery);
List<Rockwell_keyT_quiz> getT_quiz_study_by_sql(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_quiz> getT_quiz_study_by_id(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyV_quiz_type_total> getT_quiz_type_total(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_quizDefectItem(Rockwell_keyT_quiz_defect rockwell_keyT_quiz_defect);
/* match api */
/* 通过pagination, matchId 查询t_match */
List<Rockwell_keyT_match> getT_match_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getV_match_point_by_matchid(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match> getT_match_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchList(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_matchItem(Rockwell_keyT_match rockwell_keyT_match);
// 更新match_status的状态 主要是由可用->不可用 jscat 20200731
void updateT_match_status(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_match_bonusItem(Rockwell_keyT_match_bonus rockwell_keyT_match_bonus);
/* match rank api */
// List<Rockwell_keyV_match_rank> getV_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void updateT_match_rank_defaultType(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
// void genT_match_rank(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyV_match_point> getV_match_point_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
/* post api */
List<Rockwell_keyV_post_info> getV_post_info(Rockwell_keyT_postQuery rockwell_keyT_postQuery);
void addT_post(Rockwell_keyT_post rockwell_keyT_post);
void addT_postLike(Rockwell_keyT_post rockwell_keyT_post);
/* pair api */
// List<Rockwell_keyT_pair> getT_pair(Rockwell_keyT_pairQuery rockwell_keyT_pairQuery);
// void addT_pair(Rockwell_keyT_pair rockwell_keyT_pair);
/* area api */
List<Rockwell_keyV_area_total> getCityList();
List<Rockwell_keyV_area_total> getCityInfo(Rockwell_keyT_areaQuery rockwell_keyT_areaQuery);
List<Rockwell_keyV_member_pos> getMemberPos(Rockwell_keyT_areaQuery rockwell_keyT_areaQuery);
/* testing */
void test(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -30,8 +30,10 @@ public interface Rockwell_keyService {
JSONResult Rockwell_keyServiceGetT_match_by_page(String memberId, String userId, String matchStatus);
void Rockwell_keyServiceAddT_matchList(List<Rockwell_keyT_match> listRockwell_keyT_match);
void Rockwell_keyServiceAddT_matchItem(String memberId, String userId, Double matchPoint, String matchResult);
int Rockwell_keyServiceUpdateT_match_status(String matchId);
void Rockwell_keyServiceUpdateT_match_status(String matchId);
void Rockwell_keyServiceAddT_match_bonusItem(String matchId, String userId, String userName, Double bonusPoint);
JSONResult Rockwell_keyServiceGetV_match_point_by_page(String memberId, String userId, String matchStatus);
/* post api */
JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount);
......
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
......@@ -195,13 +195,12 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
/*
* 更新tbl_match的match_status
* */
public int Rockwell_keyServiceUpdateT_match_status(String matchId)
public void Rockwell_keyServiceUpdateT_match_status(String matchId)
{
LOGGER.debug("find Rockwell_keyServiceUpdateT_match_status");
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchId(matchId);
rockwell_keyMapper.updateT_match_status(rockwell_keyT_matchQuery);
return 0;
}
public void Rockwell_keyServiceAddT_match_bonusItem(String matchId, String userId, String userName, Double bonusPoint)
......@@ -217,6 +216,21 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
rockwell_keyMapper.addT_match_bonusItem(rockwell_keyT_match_bonus);
}
public JSONResult Rockwell_keyServiceGetV_match_point_by_page(String memberId, String userId, String matchStatus)
{
LOGGER.debug("find Rockwell_keyServiceGetV_match_point_by_page");
List<Rockwell_keyV_match_point> listRockwell_keyV_match_point = new ArrayList<Rockwell_keyV_match_point>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMemberId(memberId);
rockwell_keyT_matchQuery.setUserId(userId);
rockwell_keyT_matchQuery.setMatchStatus(matchStatus);
listRockwell_keyV_match_point = rockwell_keyMapper.getV_match_point_by_page(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyV_match_point.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyV_match_point);
return jsonResult;
}
/* post api */
// getV_post_info
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -47,7 +47,7 @@ public class NyxApiController {
@RequestMapping(value = "/nyx/quiz/query", method = RequestMethod.GET)
//@GetMapping("/nyx/quiz/query")
public JSONResult RockwellGetQuizQuery(
@RequestParam(value = "questionName", required = false, defaultValue = "") String strQuestionName,
@RequestParam(value = "questionName", required = false, defaultValue = "0") String strQuestionName,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
......@@ -71,7 +71,7 @@ public class NyxApiController {
})
@RequestMapping(value = "/nyx/quiz/query/item", method = RequestMethod.GET)
public JSONResult RockwellGetQuizQueryItem(
@RequestParam(value = "questionId", required = false, defaultValue = "") String questionId
@RequestParam(value = "questionId", required = false, defaultValue = "0") String questionId
) {
LOGGER.debug("======================/nyx/quiz/query/item");
return keyService.Rockwell_keyServiceGetT_quizitem(questionId);
......@@ -115,19 +115,19 @@ public class NyxApiController {
// 2.2 为t_match添加match,对应tbl_match
/* 积分生成流程:
1) user_id 参与 member_id 竞答
2) 得到 match_point, match_result, 默认match_status为1
3) 生成match_id
2) 得到 match_point, match_result, 默认 match_status 为1
3) 生成 match_id
4)存储到数据库
积分使用流程:
5)小程序前端基于match_id生成qrcode (pros: 1.不需要存储到oss; 2.小程序前端直接生成)
6)扫一扫识别qrcode,拿到match_id, 然后后台调用updateT_match_status()
5)小程序前端基于 match_id 生成 qrcode (pros: 1.不需要存储到oss; 2.小程序前端直接生成)
6)扫一扫识别 qrcode 拿到 match_id 然后后台调用 updateT_match_status()
7) 完成
*/
@ApiOperation(value="为t_match添加match,对应tbl_match", notes="为t_match添加match,对应tbl_match")
@ApiImplicitParams({
@ApiImplicitParam(name = "memberId", value = "商户的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "matchPoint", value = "得分: 4.5 or 5.0", required = true, dataType = "Double"),
@ApiImplicitParam(name = "matchPoint", value = "得分: 4.5 or 5.0", required = true, dataType = "String"),
@ApiImplicitParam(name = "matchResult", value = "结果: 9/10", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/add/item", method = RequestMethod.POST)
......@@ -142,7 +142,52 @@ public class NyxApiController {
keyService.Rockwell_keyServiceAddT_matchItem(memberId, userId, matchPoint, matchResult);
}
// 1.8 get t_match by matchId
// APi2 t_match接口 jscat 20200731
// 2.3 为 t_match_bonus 添加 bonus_point 对应 tbl_match_bonus
/* 好友助力流程:
1) 针对某具体的 match_id
2)user_id 参与助力
3)存储到数据库
*/
@ApiOperation(value="为t_match_bonus添加bonus_point对应tbl_match_bonus", notes="为t_match_bonus添加bonus_point对应tbl_match_bonus")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchId", value = "竞答的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户的id", required = true, dataType = "String"),
@ApiImplicitParam(name = "userName", value = "用户名", required = true, dataType = "String"),
@ApiImplicitParam(name = "bonusPoint", value = "得分: 默认0.5", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/bonus/add/item", method = RequestMethod.POST)
@ResponseBody
public void RockwellAddMatchBonusItem(
@RequestParam(value = "matchId", required = true, defaultValue = "0") String matchId,
@RequestParam(value = "userId", required = true, defaultValue = "0") String userId,
@RequestParam(value = "userName", required = true, defaultValue = "0") String userName,
@RequestParam(value = "bonusPoint", required = true, defaultValue = "0.5") Double bonusPoint
) {
keyService.Rockwell_keyServiceAddT_match_bonusItem(matchId, userId, userName, bonusPoint);
}
// APi2 t_match接口 jscat 20200801
// 2.4 更新 t_match 的match_status 状态
/* 更新积分的使用状态:
1) set match_status=0
*/
@ApiOperation(value="更新 t_match 的match_status 状态", notes="更新 t_match 的match_status 状态")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchId", value = "竞答的id", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/status/update", method = RequestMethod.POST)
@ResponseBody
public void RockwellUpdateMatchStatus(
@RequestParam(value = "matchId", required = true, defaultValue = "0") String matchId
) {
keyService.Rockwell_keyServiceUpdateT_match_status(matchId);
}
// 2.5 get t_match by matchId
@ApiOperation(value="get t_match by matchId", notes="get t_match by matchId")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchId", value = "竞答id", required = true, dataType = "String")
......@@ -155,6 +200,23 @@ public class NyxApiController {
return keyService.Rockwell_keyServiceGetT_match_by_matchid(matchId);
}
// 2.6 get v_match_point by page
@ApiOperation(value="get t_match by matchId", notes="get t_match by matchId")
@ApiImplicitParams({
@ApiImplicitParam(name = "memberId", value = "竞答id", required = false, dataType = "String"),
@ApiImplicitParam(name = "userId", value = "用户id", required = false, dataType = "String"),
@ApiImplicitParam(name = "matchStatus", value = "积分使用状态(00:不可用|01:可使用)", required = false, dataType = "String")
})
@RequestMapping(value = "/nyx/match/point/query", method = RequestMethod.GET)
public JSONResult RockwellGetMatchPointByPage(
@RequestParam(value = "memberId", required = false, defaultValue = "0" ) String memberId,
@RequestParam(value = "userId", required = false, defaultValue = "0" ) String userId,
@RequestParam(value = "matchStatus", required = false, defaultValue = "01" ) String matchStatus
) {
return keyService.Rockwell_keyServiceGetV_match_point_by_page(memberId, userId, matchStatus);
}
// 4.0 post info api
@ApiOperation(value="获取用户的post info", notes="获取用户的post info")
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
......@@ -101,7 +101,7 @@ limitations under the License.
<!-- match api1-1 新增一条 match 记录 update jscat 20200731 -->
<insert id="addT_matchList" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, qrcode_url, create_datetime,update_datetime)
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, create_datetime,update_datetime)
values
<foreach collection="listRockwell_keyT_match" index="index" item="item" open="" separator="," close="">
(
......@@ -111,7 +111,6 @@ limitations under the License.
#{item.matchStatus},
#{item.matchPoint},
#{item.matchResult},
#{item.qrcodeUrl},
#{item.createDatetime},
#{item.updateDatetime}
)
......@@ -120,7 +119,7 @@ limitations under the License.
<!-- match api1-2 新增一条 tbl_match 记录 update jscat 20200731 -->
<insert id="addT_matchItem" parameterType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match">
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, qrcode_url, create_datetime,update_datetime)
insert into tbl_match(match_id, member_id, user_id, match_status, match_point, match_result, create_datetime,update_datetime)
values
(
#{matchId},
......@@ -129,7 +128,6 @@ limitations under the License.
#{matchStatus},
#{matchPoint},
#{matchResult},
#{qrcodeUrl},
#{createDatetime},
#{updateDatetime}
)
......@@ -167,7 +165,7 @@ limitations under the License.
<!-- match api 1-6 更新match_status的状态 -->
<select id="updateT_match_status" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery">
update tbl_match
set match_status=0
set match_status='00'
where match_id=#{matchId}
</select>
......@@ -187,11 +185,22 @@ limitations under the License.
</insert>
<!-- match api 1-8 获取v_match_point的值 update jscat 20200731 -->
<select id="getV_match_point_by_matchid" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
<select id="getV_match_point_by_page" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_match_point">
select * from view_match_point
where 1=1
AND match_id=#{matchId}
<if test="memberId != null and memberId != '' ">
AND member_id=#{memberId}
</if>
<if test="userId != null and userId != '' ">
AND user_id=#{userId}
</if>
<if test="matchStatus != null and matchStatus != '' ">
AND match_status=#{matchStatus}
</if>
<if test="pagination != null ">
<include refid="pagination"/>
</if>
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论