|
@@ -0,0 +1,83 @@
|
|
|
+package com.diagbot.web;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.diagbot.annotation.SysLogger;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.entity.LantoneProduct;
|
|
|
+import com.diagbot.facade.DiagLantoneProductFacade;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 朗通产品 前端控制器
|
|
|
+ * @Author: wangyu
|
|
|
+ * @Date: 15:46 2018/9/17
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/diagLantoneProduct")
|
|
|
+public class DiagLantoneProductController {
|
|
|
+ @Autowired
|
|
|
+ private DiagLantoneProductFacade diagLantoneProductFacade;
|
|
|
+
|
|
|
+ @ApiOperation(value = "添加产品线",
|
|
|
+ notes = "name:产品名,必填<br>" +
|
|
|
+ "decription:产品描述,必填<br> " +
|
|
|
+ "url:产品访问路径,必填<br>" +
|
|
|
+ "charge_type:支付方式,必填<br>")
|
|
|
+ @PostMapping("/addProducts")
|
|
|
+ @SysLogger("addProducts")
|
|
|
+ @Transactional
|
|
|
+ public RespDTO<LantoneProduct> addProducts(LantoneProduct lantoneProduct){
|
|
|
+ return RespDTO.onSuc(diagLantoneProductFacade.addProducts(lantoneProduct));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "分页查询查询产品线",
|
|
|
+ notes = "name:添加后则根据产品名称查询,选填<br>"+
|
|
|
+ "根据每页显示条数,默认 10,和当前页<br>")
|
|
|
+ @GetMapping("/selectProduct")
|
|
|
+ @SysLogger("selectProduct")
|
|
|
+ public RespDTO<LantoneProduct> selectProduct(Page page , String name){
|
|
|
+ IPage<LantoneProduct> pages = diagLantoneProductFacade.selectProduct(page,name);
|
|
|
+ return RespDTO.onSuc(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "修改产品",
|
|
|
+ notes = "id:根据产品id修改产品内容,必填<br>")
|
|
|
+ @PostMapping("/updateProduct")
|
|
|
+ @SysLogger("updateProduct")
|
|
|
+ public RespDTO<LantoneProduct> updateProduct(LantoneProduct lantoneProduct){
|
|
|
+ return RespDTO.onSuc(diagLantoneProductFacade.updateProduct(lantoneProduct));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除产品",
|
|
|
+ notes = "id:根据产品id删除产品,必填<br>")
|
|
|
+ @PostMapping("/deleteProduct")
|
|
|
+ @SysLogger("deleteProduct")
|
|
|
+ public RespDTO<LantoneProduct> deleteProduct(LantoneProduct lantoneProduct){
|
|
|
+ return RespDTO.onSuc(diagLantoneProductFacade.deleteProduct(lantoneProduct));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "更改产品状态(启用/停用)",
|
|
|
+ notes = "id:根据产品id更改产品状态,必填<br>")
|
|
|
+ @PostMapping("/productStatus")
|
|
|
+ @SysLogger("productStatus")
|
|
|
+ public RespDTO<LantoneProduct> productStatus(LantoneProduct lantoneProduct){
|
|
|
+ return RespDTO.onSuc(diagLantoneProductFacade.productStatus(lantoneProduct));
|
|
|
+ }
|
|
|
+
|
|
|
+ /* @ApiOperation(value = "查询当条产品线所有已开通用户",
|
|
|
+ notes = "id:根据产品id查询所有已开通本产品用户,必填<br>")
|
|
|
+ @PostMapping("/opendedProduct")
|
|
|
+ @SysLogger("opendedProduct")
|
|
|
+ public RespDTO<DiagLantoneProduct> opendedProduct(DiagLantoneProduct diagLantoneProduct){
|
|
|
+ return RespDTO.onSuc(diagLantoneProductFacade.productStatus(diagLantoneProduct));
|
|
|
+ }*/
|
|
|
+}
|
|
|
+
|