|
|
@@ -1,11 +1,58 @@
|
|
|
package cn.hobbystocks.auc.web;
|
|
|
|
|
|
+import cn.hobbystocks.auc.common.core.domain.AjaxResult;
|
|
|
+import cn.hobbystocks.auc.domain.LotNotice;
|
|
|
+import cn.hobbystocks.auc.service.LotNoticeService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
@RestController
|
|
|
@RequestMapping("/lot/notice/")
|
|
|
+@Api(tags = "拍卖公告管理")
|
|
|
public class LotNoticeController extends AdminBaseController{
|
|
|
+ @Autowired
|
|
|
+ private LotNoticeService lotNoticeService;
|
|
|
+
|
|
|
+ @PostMapping("/list")
|
|
|
+ @ApiOperation("拍卖公告列表查询")
|
|
|
+ public AjaxResult selectLotNoticeList(@RequestBody LotNotice lotNotice){
|
|
|
+ List<LotNotice> lotNoticeList = lotNoticeService.selectLotNoticeList(lotNotice);
|
|
|
+ return AjaxResult.successPage(lotNoticeList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/create")
|
|
|
+ @ApiOperation("新建拍卖公告")
|
|
|
+ public AjaxResult createLotNotice(@RequestBody LotNotice lotNotice){
|
|
|
+ boolean save = lotNoticeService.save(lotNotice);
|
|
|
+ if (save)
|
|
|
+ return AjaxResult.success();
|
|
|
+ return AjaxResult.error("保存失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/edit")
|
|
|
+ @ApiOperation("编辑拍卖公告")
|
|
|
+ public AjaxResult editLotNotice(@RequestBody LotNotice lotNotice){
|
|
|
+ //判断公告是否已发布,如已发布,仅可编辑公告内容
|
|
|
+ int i = lotNoticeService.editLotNotice(lotNotice);
|
|
|
+ if (i>0)
|
|
|
+ return AjaxResult.success();
|
|
|
+ return AjaxResult.error("编辑失败");
|
|
|
+ }
|
|
|
|
|
|
+ @PostMapping("pub")
|
|
|
+ @ApiOperation(value = "发布拍卖公告",notes = "status:0、下线;1、上线")
|
|
|
+ public AjaxResult publishLotNotice(@RequestBody LotNotice lotNotice){
|
|
|
+ int i = lotNoticeService.pubLotNotice(lotNotice);
|
|
|
+ if (i>0)
|
|
|
+ return AjaxResult.success();
|
|
|
+ return AjaxResult.error("发布失败");
|
|
|
+ }
|
|
|
|
|
|
}
|