|
|
@@ -1,8 +1,13 @@
|
|
|
package com.zhongzheng.controller.goods;
|
|
|
|
|
|
+import com.zhongzheng.common.annotation.Log;
|
|
|
import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
+import com.zhongzheng.common.enums.BusinessType;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsAddBo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsBankAddBo;
|
|
|
+import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.TopGoodsVo;
|
|
|
import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
|
|
|
import com.zhongzheng.modules.top.goods.service.ITopGoodsService;
|
|
|
@@ -10,9 +15,8 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -30,6 +34,8 @@ public class TopGoodsController extends BaseController {
|
|
|
|
|
|
private final ITopGoodsService iTopGoodsService;
|
|
|
|
|
|
+ private final IGoodsService iGoodsService;
|
|
|
+
|
|
|
/**
|
|
|
* 商品批量复制
|
|
|
*/
|
|
|
@@ -59,4 +65,14 @@ public class TopGoodsController extends BaseController {
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增题库商品
|
|
|
+ */
|
|
|
+ @ApiOperation("新增积分商品")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:goods:add')")
|
|
|
+ @Log(title = "新增积分商品", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/points")
|
|
|
+ public AjaxResult<Void> addPoints(@RequestBody GoodsAddBo bo) {
|
|
|
+ return toAjax(iGoodsService.insertPointsByAddBo(bo)>0 ? 1 : 0);
|
|
|
+ }
|
|
|
}
|