|
@@ -1,19 +1,14 @@
|
|
|
package com.fdage.controller;
|
|
|
|
|
|
-import cn.hutool.core.collection.CollectionUtil;
|
|
|
-import cn.hutool.core.collection.ListUtil;
|
|
|
-import cn.hutool.core.util.StrUtil;
|
|
|
import com.fdage.aop.WebControllerLog;
|
|
|
import com.fdage.constant.ConfigConstant;
|
|
|
-import com.fdage.constant.ConstantUrl;
|
|
|
+import com.fdage.dto.CollectionPageDto;
|
|
|
import com.fdage.enums.ResponEnum;
|
|
|
import com.fdage.pojo.TbCollection;
|
|
|
import com.fdage.request.RequestCollection;
|
|
|
-import com.fdage.respon.ResponCollection;
|
|
|
import com.fdage.service.ICollectionService;
|
|
|
import com.fdage.util.AjaxJson;
|
|
|
import com.fdage.util.FileUtil;
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -23,17 +18,16 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.List;
|
|
|
+import javax.validation.Valid;
|
|
|
|
|
|
/**
|
|
|
* Created by Hb_zzZ on 2019/9/11.
|
|
|
*/
|
|
|
-@Api(tags = "文物库模块")
|
|
|
-@Controller
|
|
|
+@Api(tags = "v2-文物库模块")
|
|
|
+@RestController
|
|
|
@RequestMapping("/zhoushan/collection")
|
|
|
@Slf4j
|
|
|
public class CollectionController {
|
|
@@ -128,7 +122,7 @@ public class CollectionController {
|
|
|
@PostMapping("findById")
|
|
|
@ResponseBody
|
|
|
@WebControllerLog(description = "文物库-查询文物库详情")
|
|
|
- @ApiOperation("查询文物库详情")
|
|
|
+ @ApiOperation("v2-查询文物库详情")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "id", value = "文物id", dataType = "String")})
|
|
|
public AjaxJson findById(@RequestBody RequestCollection bo){
|
|
@@ -139,20 +133,29 @@ public class CollectionController {
|
|
|
return AjaxJson.success(service.findById(bo.getId()));
|
|
|
}
|
|
|
|
|
|
- @PostMapping("list")
|
|
|
- @ResponseBody
|
|
|
+// @PostMapping("list")
|
|
|
+// @ResponseBody
|
|
|
+// @WebControllerLog(description = "文物库-获取文物列表")
|
|
|
+// @ApiOperation("获取文物列表")
|
|
|
+// @ApiImplicitParams({
|
|
|
+// @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
|
|
|
+// @ApiImplicitParam(name = "pageSize", value = "每页数量", dataType = "String")})
|
|
|
+// public AjaxJson list(@RequestBody RequestCollection bo){
|
|
|
+// List<ResponCollection> list = service.findList(bo);
|
|
|
+// PageInfo<ResponCollection> pageInfo = new PageInfo<>(list);
|
|
|
+// return AjaxJson.success(pageInfo);
|
|
|
+// }
|
|
|
+
|
|
|
+// @ResponseBody
|
|
|
+ @PostMapping("/list")
|
|
|
@WebControllerLog(description = "文物库-获取文物列表")
|
|
|
- @ApiOperation("获取文物列表")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "timeId", value = "年代id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "typeId", value = "类型id", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "name", value = "文物名称", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "String"),
|
|
|
- @ApiImplicitParam(name = "pageSize", value = "每页数量", dataType = "String")})
|
|
|
- public AjaxJson list(@RequestBody RequestCollection bo){
|
|
|
- List<ResponCollection> list = service.findList(bo);
|
|
|
- PageInfo<ResponCollection> pageInfo = new PageInfo<>(list);
|
|
|
- return AjaxJson.success(pageInfo);
|
|
|
+ @ApiOperation("v2-获取文物列表")
|
|
|
+ public AjaxJson listPage(@Valid @RequestBody CollectionPageDto param){
|
|
|
+
|
|
|
+ return service.listPage(param);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/upload")
|
|
@@ -177,9 +180,6 @@ public class CollectionController {
|
|
|
return AjaxJson.failure("上传图片失败");
|
|
|
}
|
|
|
|
|
|
-// Map<String, String> map = new HashMap<>();
|
|
|
-// map.put(path + "/" + fileName, "company/" + fileName);
|
|
|
-// uploadToAlibabaService.upload(map);
|
|
|
|
|
|
return AjaxJson.success((Object) ("/collection/" + fileName));
|
|
|
}
|