Commit a2759a33 by jscat

nyx javaapp: 页面更新 & 功能更新

1. 多个活动显示
parent fb953241
package cn.com.fun.nyxkey.api.domain.query;
package cn.com.fun.nyxkey.api.domain.query;
......@@ -17,16 +17,47 @@ import java.util.List;
@AllArgsConstructor
public class Rockwell_keyT_productQuery {
private String productId;
private String activityId;
private List<Rockwell_keyT_product> listRockwell_keyT_product;
private Pagination pagination;
//默认返回1页4条记录
public Rockwell_keyT_productQuery()
{
this.pagination = new Pagination(1, 10);
}
public void setProductId(String strProductId)
{
if(strProductId.equals("0"))
{
this.productId = null;
}
else
{
this.productId = strProductId;
}
}
public void setActivityId(String strActivityId)
{
if(strActivityId.equals("0"))
{
this.activityId = null;
}
else
{
this.activityId = strActivityId;
}
}
@Override
public String toString() {
return "Rockwell_keyT_productQuery{" +
"productId='" + productId + '\'' +
"activityId='" + activityId + '\'' +
"listRockwell_keyT_product='" + listRockwell_keyT_product + '\'' +
'}';
}
......
package cn.com.fun.nyxkey.api.repository;
package cn.com.fun.nyxkey.api.repository;
......@@ -41,6 +41,7 @@ public interface Rockwell_keyMapper {
void delT_activityLike(Rockwell_keyT_activity rockwell_keyT_activity);
void addT_activity(Rockwell_keyT_activity rockwell_keyT_activity);
void addT_product(Rockwell_keyT_productQuery rockwell_keyT_productQuery);
List<Rockwell_keyT_product>getT_product(Rockwell_keyT_productQuery rockwell_keyT_productQuery);
/* 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;
......@@ -54,6 +54,7 @@ public interface Rockwell_keyService {
int Rockwell_keyServiceAddT_activity(String userId, String memberId, String addressId, String noteImage, String tag, String title, String content,
String startDatetime, String endDatetime,
List<String> desc, List<Double> price, List<Integer> stock) throws UnsupportedEncodingException;
JSONResult Rockwell_keyServiceGetT_product(String productId, String activityId, int pageNum, int pageCount);
/* 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;
......@@ -416,6 +416,7 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
return 0;
}
// activity api - addT_activity
public int Rockwell_keyServiceAddT_activity(String userId, String memberId, String addressId, String noteImage, String tag, String title, String content,
String startDatetime, String endDatetime,
List<String> desc, List<Double> price, List<Integer> stock)
......@@ -483,6 +484,28 @@ public class Rockwell_keyServiceImpl implements Rockwell_keyService {
}
// activity api - getT_product
public JSONResult Rockwell_keyServiceGetT_product(String productId, String activityId, int pageNum, int pageCount)
{
Rockwell_keyT_productQuery rockwell_keyT_productQuery = new Rockwell_keyT_productQuery();
rockwell_keyT_productQuery.setProductId(productId);
rockwell_keyT_productQuery.setActivityId(activityId);
rockwell_keyT_productQuery.setPagination(new Pagination(pageNum, pageCount));
//判断某字符串是否为空,为空的标准是 str==null 或 str.length()==0
//如果所有的id 全为"0",默认值,则返回参数错误
if(activityId.equals("0") && productId.equals("0"))
{
return new JSONResult(ExceptionMsg.ParamError);
}
List<Rockwell_keyT_product> listRockwell_keyT_product= new ArrayList<Rockwell_keyT_product>();
listRockwell_keyT_product = rockwell_keyMapper.getT_product(rockwell_keyT_productQuery);
int totalCount = listRockwell_keyT_product.size();
JSONResult jsonResult = new JSONResult(totalCount, listRockwell_keyT_product);
return jsonResult;
}
/* post api */
// getV_post_info
public JSONResult Rockwell_keyServiceGetV_post_info(String tag, String title, String top, int pageNum, int pageCount)
......
package cn.com.fun.nyxkey.api.web.controller;
package cn.com.fun.nyxkey.api.web.controller;
......@@ -360,6 +360,24 @@ public class NyxApiController {
keyService.Rockwell_keyServiceDelT_activityLike(activityId);
}
// 3.6 通过activity_id获取productInfo
@ApiOperation(value="获取活动分类表(tbl_product)的信息", notes="获取活动分类表(tbl_product)的信息")
@ApiImplicitParams({
@ApiImplicitParam(name = "productId", value = "按活动分类id查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "activityId", value = "按活动id查找", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageNum", value = "页码,从1开始", required = false, dataType = "String", defaultValue = "1"),
@ApiImplicitParam(name = "pageCount", value = "每页的数据个数,默认是10个", required = false, dataType = "String", defaultValue = "10")
})
@RequestMapping(value = "/nyx/product/query", method = RequestMethod.GET)
public JSONResult RockwellQueryProduct(
@RequestParam(value = "productId", required = false, defaultValue = "0") String productId,
@RequestParam(value = "activityId", required = false, defaultValue = "0") String activityId,
@RequestParam(value = "pageNum", required = false, defaultValue = "1") int pageNum,
@RequestParam(value = "pageCount", required = false, defaultValue = "4") int pageCount
) {
return keyService.Rockwell_keyServiceGetT_product(productId, activityId, pageNum, pageCount);
}
// 4.0 post info api
@ApiOperation(value="获取用户的post info", notes="获取用户的post info")
@ApiImplicitParams({
......
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
......@@ -348,6 +348,22 @@ limitations under the License.
</foreach>
</insert>
<select id="getT_product" parameterType="cn.com.fun.nyxkey.api.domain.query.Rockwell_keyT_productQuery" resultType="cn.com.fun.nyxkey.api.domain.Rockwell_keyT_product">
SELECT * FROM tbl_product
WHERE 1=1
AND product_status='01'
<if test="productId != null and productId != '' ">
AND product_id=#{productId}
</if>
<if test="activityId != null and activityId != '' ">
AND activity_id=#{activityId}
</if>
ORDER BY default_status DESC, product_id desc
<if test="pagination != null ">
<include refid="pagination"/>
</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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论