Commit fce9933f by “Kongxiangkun”

增加积分商城相关代码

parent 3574c578
...@@ -138,12 +138,14 @@ public class PointProductController { ...@@ -138,12 +138,14 @@ public class PointProductController {
@ApiOperation(value = "积分商品、分页列表", notes = "积分商品、分页列表", response = PointProductVo.class) @ApiOperation(value = "积分商品、分页列表", notes = "积分商品、分页列表", response = PointProductVo.class)
@GetMapping("/list") @GetMapping("/list")
public Response<Page<PointProductVo>> productList(@RequestBody PointSearchParamVO searchParamVO){ //public Response<Page<PointProductVo>> productList(@RequestBody PointSearchParamVO searchParamVO){
Page<PointProductVo> list = null; public Response<Page<PointProductVo>> productList(@RequestParam(value = "pageNo", required = false) int pageNo,
RequestContext requestContext = ContextHolder.get(); @RequestParam(value = "pageSize", required = false) int pageSize,
if(null == requestContext){ @RequestParam(value = "name", required = false) String name){
Response.fail(); PointSearchParamVO searchParamVO = new PointSearchParamVO();
} searchParamVO.setName(name);
searchParamVO.setPageNo(pageNo);
searchParamVO.setPageSize(pageSize);
try { try {
return Response.ok(pointProductFeignClients.productList(searchParamVO)); return Response.ok(pointProductFeignClients.productList(searchParamVO));
} catch (Exception e) { } catch (Exception e) {
......
...@@ -167,8 +167,14 @@ public class PointUserController { ...@@ -167,8 +167,14 @@ public class PointUserController {
@ApiOperation(value = "用户的积分分页列表", notes = "用户的积分分页列表", response = PointProductVo.class) @ApiOperation(value = "用户的积分分页列表", notes = "用户的积分分页列表", response = PointProductVo.class)
@GetMapping("/list") @GetMapping("/list")
public Response<Page<PointUserPageListVO>> list(@RequestBody PointSearchParamVO searchParamVO){ //public Response<Page<PointUserPageListVO>> list(@RequestBody PointSearchParamVO searchParamVO){
Page<PointUserListVO> list = null; public Response<Page<PointUserPageListVO>> list(@RequestParam(value = "pageNo", required = false) int pageNo,
@RequestParam(value = "pageSize", required = false) int pageSize,
@RequestParam(value = "name", required = false) String name){
PointSearchParamVO searchParamVO = new PointSearchParamVO();
searchParamVO.setName(name);
searchParamVO.setPageNo(pageNo);
searchParamVO.setPageSize(pageSize);
try { try {
return Response.ok(pointUserClients.list(searchParamVO)); return Response.ok(pointUserClients.list(searchParamVO));
} catch (Exception e) { } catch (Exception e) {
...@@ -178,8 +184,11 @@ public class PointUserController { ...@@ -178,8 +184,11 @@ public class PointUserController {
} }
@ApiOperation(value = "用户积分兑换", notes = "用户积分兑换", response = PointProductVo.class) @ApiOperation(value = "用户积分兑换", notes = "用户积分兑换", response = PointProductVo.class)
@GetMapping("/exchange") @PostMapping("/exchange")
public Response<Object> exchange(@RequestBody PointUserExchangeVO pointUserExchangeVO){ public Response<Object> exchange(@RequestBody PointUserExchangeVO pointUserExchangeVO){
if(pointUserExchangeVO.getPoint() <= 0) {
return Response.fail("兑换积分必须大于0");
}
int ret = pointUserClients.exchange(pointUserExchangeVO); int ret = pointUserClients.exchange(pointUserExchangeVO);
if(ret > 0) { if(ret > 0) {
return Response.ok(); return Response.ok();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment