|
@@ -4,7 +4,10 @@ import cn.com.ctop.manage.modules.actor.entity.Yard;
|
|
|
import cn.com.ctop.manage.modules.actor.entity.YardComment;
|
|
|
import cn.com.ctop.manage.modules.actor.entity.YardPhoto;
|
|
|
import cn.com.ctop.manage.modules.actor.entity.YardVideo;
|
|
|
-import cn.com.ctop.manage.modules.actor.service.*;
|
|
|
+import cn.com.ctop.manage.modules.actor.service.IYardCommentService;
|
|
|
+import cn.com.ctop.manage.modules.actor.service.IYardPhotoService;
|
|
|
+import cn.com.ctop.manage.modules.actor.service.IYardService;
|
|
|
+import cn.com.ctop.manage.modules.actor.service.IYardVideoService;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -15,7 +18,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.io.File;
|
|
|
|
|
|
/**
|
|
|
* @author yumeng
|
|
@@ -28,8 +30,6 @@ public class YardController {
|
|
|
@Autowired
|
|
|
private IYardPhotoService yardPhotoService;
|
|
|
@Autowired
|
|
|
- private IYardSchedulerService yardSchedulerService;
|
|
|
- @Autowired
|
|
|
private IYardService yardService;
|
|
|
@Autowired
|
|
|
private IYardVideoService yardVideoService;
|
|
@@ -79,8 +79,9 @@ public class YardController {
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
HttpServletRequest req) {
|
|
|
- Result<IPage<Yard>> result = new Result<IPage<Yard>>();
|
|
|
+ Result<IPage<Yard>> result = new Result<>();
|
|
|
QueryWrapper<Yard> queryWrapper = QueryGenerator.initQueryWrapper(yard, req.getParameterMap());
|
|
|
+ queryWrapper.orderByDesc("create_time");
|
|
|
Page<Yard> page = new Page<Yard>(pageNo, pageSize);
|
|
|
IPage<Yard> pageList = yardService.page(page, queryWrapper);
|
|
|
|
|
@@ -217,4 +218,17 @@ public class YardController {
|
|
|
result.setResult(pageList);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @DeleteMapping(value = "/delete")
|
|
|
+ public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
|
|
|
+ try {
|
|
|
+ yardService.removeById(id);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("删除失败",e.getMessage());
|
|
|
+ return Result.error("删除失败!");
|
|
|
+ }
|
|
|
+ return Result.ok("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|