部分初始化。
This commit is contained in:
parent
4ad81053fb
commit
18c72d0d08
|
|
@ -28,6 +28,24 @@ public class LoginInterceptor implements HandlerInterceptor {
|
|||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
// 首先校验token
|
||||
boolean isTokenValid = checkToken(request, response);
|
||||
if (!isTokenValid) {
|
||||
return false;
|
||||
}
|
||||
return checkSysAdminOperation(request);
|
||||
}
|
||||
|
||||
private boolean checkSysAdminOperation(HttpServletRequest request) {
|
||||
String requestURI = request.getRequestURI();
|
||||
if (!requestURI.startsWith("/data/ed/prj")) {
|
||||
// 校验当前用户是不是系统管理员,再进行后续权限校验
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean checkToken(HttpServletRequest request, HttpServletResponse response) {
|
||||
String token = request.getHeader("Authorization");
|
||||
if (token == null) {
|
||||
log.error("Authorization header is null");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
package com.electromagnetic.industry.software.manage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/data/ed/file")
|
||||
public class EdFileInfoController {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.electromagnetic.industry.software.manage.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/data/ed/prj")
|
||||
public class ProjectController {
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.electromagnetic.industry.software.manage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.electromagnetic.industry.software.manage.pojo.models.EdFileInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface EdFileInfoMapper extends BaseMapper<EdFileInfo> {
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
package com.electromagnetic.industry.software.manage.pojo.models;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@TableName("ed_file_info")
|
||||
public class EdFileInfo {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableField(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 文件id,如果是第一个版本,则和id一致,同一个文件不同版本,file_id是一致的
|
||||
*/
|
||||
@TableField(value = "file_id")
|
||||
private String fileId;
|
||||
|
||||
/**
|
||||
* 文件类型
|
||||
*/
|
||||
@TableField(value = "file_type")
|
||||
private String fileType;
|
||||
|
||||
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@TableField(value = "file_name")
|
||||
private String fileName;
|
||||
|
||||
/**
|
||||
* 文件备注
|
||||
*/
|
||||
@TableField(value = "file_note")
|
||||
private String fileNote;
|
||||
|
||||
/**
|
||||
* 文件内容
|
||||
*/
|
||||
@TableField(value = "file_content")
|
||||
private String fileContent;
|
||||
|
||||
/**
|
||||
* 文件当前版本,文件版本号默认从100开始
|
||||
*/
|
||||
@TableField(value = "file_version")
|
||||
private Integer fileVersion;
|
||||
|
||||
/**
|
||||
* 文件时间,文件编号的最后15位,精确到毫秒
|
||||
*/
|
||||
@TableField(value = "file_time")
|
||||
private String fileTime;
|
||||
|
||||
/**
|
||||
* 文件路径,指到文件的父目录,有各个父目录的id加下划线组成
|
||||
*/
|
||||
@TableField(value = "file_path")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 父目录id
|
||||
*/
|
||||
@TableField(value = "parent_id")
|
||||
private String parentId;
|
||||
|
||||
/**
|
||||
* 数据类型,0-文件夹 1-文件
|
||||
*/
|
||||
@TableField(value = "data_type")
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 数据状态,0-发布 1-占用
|
||||
*/
|
||||
@TableField(value = "data_status")
|
||||
private Integer dataStatus;
|
||||
|
||||
/**
|
||||
* 文件的上一个版本号
|
||||
*/
|
||||
@TableField(value = "pre_version")
|
||||
private Integer preVersion;
|
||||
|
||||
/**
|
||||
* 是否有效 0-无效 1-有效
|
||||
*/
|
||||
@TableField(value = "effect_flag")
|
||||
private Integer effectFlag;
|
||||
|
||||
/**
|
||||
*保存状态,0-上传中 1-上传成功 2-上传失败
|
||||
*/
|
||||
@TableField(value = "save_status")
|
||||
private Integer saveStatus;
|
||||
|
||||
/**
|
||||
* 文件创建时间
|
||||
*/
|
||||
@TableField(value = "created_time")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 文件创建人
|
||||
*/
|
||||
@TableField(value = "created_by")
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 文件最后更新时间
|
||||
*/
|
||||
@TableField(value = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 文件最后更新人
|
||||
*/
|
||||
@TableField(value = "updated_by")
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 文件夹发布状态,0-未发布,1-已发布
|
||||
*/
|
||||
@TableField(value = "publish_status")
|
||||
private int publishStatus;
|
||||
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@TableField(value = "file_size")
|
||||
private Long fileSize;
|
||||
|
||||
/**
|
||||
* 文件夹顺序
|
||||
*/
|
||||
@TableField("sort")
|
||||
private Integer sort;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
package com.electromagnetic.industry.software.manage.service;
|
||||
|
||||
public interface EdFileInfoService {
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
package com.electromagnetic.industry.software.manage.service.serviceimpl;
|
||||
|
||||
import com.electromagnetic.industry.software.manage.service.EdFileInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class EdFileInfoServiceImpl implements EdFileInfoService {
|
||||
}
|
||||
Loading…
Reference in New Issue