|
@@ -1,5 +1,6 @@
|
|
|
package com.txz.mall.controller.appcontroller;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.txz.mall.business.PinkServiceBusiness;
|
|
@@ -7,6 +8,7 @@ import com.txz.mall.core.Result;
|
|
|
import com.txz.mall.core.ResultCode;
|
|
|
import com.txz.mall.model.StorePink;
|
|
|
import com.txz.mall.service.StorePinkService;
|
|
|
+import com.txz.mall.web.param.StorePinkParam;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.slf4j.Logger;
|
|
@@ -54,7 +56,7 @@ public class AppPinkController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/delete")
|
|
|
+ @DeleteMapping("/delete")
|
|
|
@ApiOperation(value = "拼团删除")
|
|
|
public Result delete(@RequestParam Long id) {
|
|
|
if (id == null) {
|
|
@@ -72,7 +74,7 @@ public class AppPinkController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/update")
|
|
|
+ @PutMapping("/update")
|
|
|
@ApiOperation(value = "拼团更新")
|
|
|
public Result update(@RequestBody StorePink storePink) {
|
|
|
if (storePink == null) {
|
|
@@ -92,7 +94,7 @@ public class AppPinkController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/detail")
|
|
|
+ @GetMapping("/detail")
|
|
|
@ApiOperation(value = "拼团获取详情")
|
|
|
public Result<StorePink> detail(@RequestParam Long id) {
|
|
|
if (id == null) {
|
|
@@ -110,10 +112,10 @@ public class AppPinkController {
|
|
|
|
|
|
@PostMapping("/list")
|
|
|
@ApiOperation(value = "拼团获取列表")
|
|
|
- public Result<List<StorePink>> list(@RequestBody StorePink storePink, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
|
|
|
- PageHelper.startPage(page, size);
|
|
|
+ public Result<List<StorePink>> list(@RequestBody StorePinkParam storePink) {
|
|
|
+ PageHelper.startPage(storePink.getPage(), storePink.getSize());
|
|
|
|
|
|
- Condition condition = new Condition(storePink.getClass());
|
|
|
+ Condition condition = new Condition(StorePink.class);
|
|
|
Example.Criteria criteria = condition.createCriteria();
|
|
|
criteria.andEqualTo("isDelete", 0);
|
|
|
criteria.andEqualTo("orderId", storePink.getOrderId());
|
|
@@ -135,8 +137,10 @@ public class AppPinkController {
|
|
|
|
|
|
@ApiOperation(value = "已存在的拼团列表")
|
|
|
@PostMapping(value = "/ongoing/list")
|
|
|
- public Result<List<StorePinkOngoingVO>> ongoingList(@RequestBody StorePink storePink, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size) {
|
|
|
- PageHelper.startPage(page, size);
|
|
|
+ public Result<List<StorePinkOngoingVO>> ongoingList(@RequestBody StorePinkParam storePinkParam) {
|
|
|
+ PageHelper.startPage(storePinkParam.getPage(), storePinkParam.getSize());
|
|
|
+
|
|
|
+ StorePink storePink = BeanUtil.toBean(storePinkParam, StorePink.class);
|
|
|
List<StorePinkOngoingVO> list = storePinkService.ongoingList(storePink);
|
|
|
PageInfo pageInfo = new PageInfo(list);
|
|
|
return Result.success(pageInfo);
|
|
@@ -146,8 +150,8 @@ public class AppPinkController {
|
|
|
* 拼团订单列表
|
|
|
*/
|
|
|
@ApiOperation(value = "拼团订单列表")
|
|
|
- @GetMapping(value = "/orderPink/{id}")
|
|
|
- public Result<List<StorePinkDetailVO>> getPinkList(@PathVariable(value = "id") Integer id) {
|
|
|
+ @GetMapping(value = "/orderPink")
|
|
|
+ public Result<List<StorePinkDetailVO>> getPinkList(@RequestParam("id") Integer id) {
|
|
|
return Result.success(pinkServiceBusiness.getAdminList(id));
|
|
|
}
|
|
|
|