| | |
| | | import com.lf.server.service.data.UploaderService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 数据上传 |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "上传元数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "path", value = "路径", dataType = "String", paramType = "query") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/uploadMetas") |
| | | public ResponseMsg<Object> uploadMetas(String path, HttpServletRequest req, HttpServletResponse res) { |
| | |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除元数据") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "list", value = "实体类集合", dataType = "MetaFileEntity", paramType = "body") |
| | | }) |
| | | @ResponseBody |
| | | @PostMapping(value = "/deleteMetas") |
| | | public ResponseMsg<Object> deleteMetas(List<MetaFileEntity> list, HttpServletRequest req) { |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | public ResponseMsg<Object> insertMetas(String path, Map<String, String> map, HttpServletRequest req) { |
| | | try { |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue == null) { |
| | | return fail("用户未登录", null); |
| | | } |
| | | |
| | | //int rows = uploaderService.deleteFiles(list); |
| | | |
| | | return success("成功", 0); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |