Commit f4cd7cdb by jscat

nyx java app: 更新

1. 添加2.6 get v_match_point by page
2. 添加2.7 get t_match_bonus by matchId
parent 5104cef7
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -31,6 +31,7 @@ public interface Rockwell_keyMapper {
void updateT_match_status(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
void addT_match_bonusItem(Rockwell_keyT_match_bonus rockwell_keyT_match_bonus);
List<Rockwell_keyV_match_point> getV_match_point_by_page(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
List<Rockwell_keyT_match_bonus> getT_match_bonus_by_id(Rockwell_keyT_matchQuery rockwell_keyT_matchQuery);
/* post api */
List<Rockwell_keyV_post_info> getV_post_info(Rockwell_keyT_postQuery rockwell_keyT_postQuery);
......
package cn.com.fun.nyxkey.api.service;
package cn.com.fun.nyxkey.api.service;
......@@ -33,7 +33,9 @@ public interface Rockwell_keyService {
Double matchPoint, String matchResult, String qrcodeUrl);
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);
JSONResult Rockwell_keyServiceGetV_match_point_by_page(String memberId, String userId, String matchStatus,
int pageNum, int pageCount);
JSONResult Rockwell_keyServiceGetT_match_bonus_by_id(String matchId);
/* post api */
......
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
package cn.com.fun.nyxkey.api.service.impl;
import cn.com.fun.nyxkey.api.common.ExceptionMsg;
import cn.com.fun.nyxkey.api.common.JSONResult;
import cn.com.fun.nyxkey.api.common.Pagination;
import cn.com.fun.nyxkey.api.repository.*;
......@@ -218,7 +219,8 @@ 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)
public JSONResult Rockwell_keyServiceGetV_match_point_by_page(String memberId, String userId, String matchStatus,
int pageNum, int pageCount)
{
LOGGER.debug("find Rockwell_keyServiceGetV_match_point_by_page");
......@@ -227,12 +229,33 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
rockwell_keyT_matchQuery.setMemberId(memberId);
rockwell_keyT_matchQuery.setUserId(userId);
rockwell_keyT_matchQuery.setMatchStatus(matchStatus);
rockwell_keyT_matchQuery.setPagination(new Pagination(pageNum, pageCount));
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;
}
/*
从t_match_bonus表获取bonus助力详情 jscat 20200803
*/
public JSONResult Rockwell_keyServiceGetT_match_bonus_by_id(String matchId)
{
LOGGER.debug("find Rockwell_keyServiceGetT_match_bonus_by_id");
//判断某字符串是否为空,为空的标准是 str==null 或 str.length()==0
if(StringUtils.isEmpty(matchId))
{
return new JSONResult(ExceptionMsg.ParamError);
}
List<Rockwell_keyT_match_bonus> listRockwell_keyT_match_bonus = new ArrayList<Rockwell_keyT_match_bonus>();
Rockwell_keyT_matchQuery rockwell_keyT_matchQuery = new Rockwell_keyT_matchQuery();
rockwell_keyT_matchQuery.setMatchId(matchId);
listRockwell_keyT_match_bonus = rockwell_keyMapper.getT_match_bonus_by_id(rockwell_keyT_matchQuery);
int totalCount = listRockwell_keyT_match_bonus.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_match_bonus);
return jsonResult;
}
/* post api */
// getV_post_info
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -211,18 +211,35 @@ public class NyxApiController {
// 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 = "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")
@ApiImplicitParam(name = "matchStatus", value = "积分使用状态(00:不可用|01:可使用)", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是5个", required = false, dataType = "String", defaultValue = "5")
})
@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
@RequestParam(value = "matchStatus", required = false, defaultValue = "01" ) String matchStatus,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "5") int pageCount
) {
return keyService.Rockwell_keyServiceGetV_match_point_by_page(memberId, userId, matchStatus);
return keyService.Rockwell_keyServiceGetV_match_point_by_page(memberId, userId, matchStatus, pageNum, pageCount);
}
// 2.7 get t_match_bonus by matchId
@ApiOperation(value="get t_match_bonus by matchId", notes="get t_match_bonus by matchId")
@ApiImplicitParams({
@ApiImplicitParam(name = "matchId", value = "竞答的id", required = true, dataType = "String")
})
@RequestMapping(value = "/nyx/match/bonus/query/id", method = RequestMethod.GET)
public JSONResult RockwellGetMatchBonusByMatchId(
@RequestParam(value = "matchId", required = false, defaultValue = "0" ) String matchId
) {
return keyService.Rockwell_keyServiceGetT_match_bonus_by_id(matchId);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
......@@ -204,6 +204,18 @@ limitations under the License.
</if>
</select>
<!-- match api 1-9 获取t_match_bonus的值 update jscat 20200803 -->
<select id="getT_match_bonus_by_id" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_matchQuery"
resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_match_bonus">
select * from tbl_match_bonus
where 1=1
<if test="matchId != null and matchId != '' ">
AND match_id=#{matchId}
</if>
</select>
<!-- post api 4.1 从 view_post_info 获取 post信息
-->
<select id="getV_post_info" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_postQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyV_post_info">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论