| | |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.UploadEntity; |
| | | import com.lf.server.entity.data.DirEntity; |
| | | import com.lf.server.entity.data.MetaEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.data.VerEntity; |
| | | import com.lf.server.entity.sys.DepEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.data.DataUploadService; |
| | | import com.lf.server.service.data.DirService; |
| | | import com.lf.server.service.data.VerService; |
| | | import com.lf.server.service.sys.DepService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | @RequestMapping("/dataUpload") |
| | | public class DataUploadController extends BaseController { |
| | | @Autowired |
| | | DepService depService; |
| | | |
| | | @Autowired |
| | | DirService dirService; |
| | | |
| | | @Autowired |
| | | VerService verService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Autowired |
| | | DataUploadService dataUploadService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询目录") |
| | | @ApiOperation(value = "查询所有单位") |
| | | @GetMapping(value = "/selectDepAll") |
| | | public ResponseMsg<List<DepEntity>> selectDepAll() { |
| | | try { |
| | | List<DepEntity> list = depService.selectDepAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询所有目录") |
| | | @GetMapping(value = "/selectDirAll") |
| | | public ResponseMsg<List<DirEntity>> selectDirAll() { |
| | | try { |
| | | List<DirEntity> list = dirService.selectDirAll(); |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据目录ID查询版本列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "dirid", value = "目录ID", dataType = "Integer", paramType = "query") |
| | | }) |
| | | @GetMapping(value = "/selectVerByDirid") |
| | | public ResponseMsg<List<VerEntity>> selectVerByDirid(Integer dirid) { |
| | | try { |
| | | if (null == dirid || dirid < 0) { |
| | | dirid = 0; |
| | | } |
| | | |
| | | List<VerEntity> list = verService.selectByDirid(dirid); |
| | | if (null == list || list.isEmpty()) { |
| | | list = verService.selectByDirid(0); |
| | | } |
| | | |
| | | return success(list); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询路径") |
| | | @GetMapping(value = "/selectPath") |
| | | public ResponseMsg<String> selectPath() { |
| | | try { |