Kaynağa Gözat

添加获取文件信息的服务

tuonina 6 yıl önce
ebeveyn
işleme
a982f3b290

+ 197 - 0
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/model/CommonFile.java

@@ -0,0 +1,197 @@
+package cn.gygxzc.envir.sys.model;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by niantuo on 2018/12/10.
+ * 文件属性.
+ */
+@TableName("common_files")
+public class CommonFile implements Serializable, Cloneable {
+
+    public static final long serialVersionUID = 1L;
+
+    private Long id;
+    private Boolean enable;
+    private String fileName;
+    private Long fileSize;
+    private String originName;
+    private String fileType;
+    private String fileDesc;
+    private String fullPath;
+    private String clientKey;
+    private String useType;
+    private String remark;
+    private String createBy;
+    private Date createTime;
+    private String updateBy;
+    private Date updateTime;
+    private String fileMd5;
+    private Boolean failed;
+
+
+    public CommonFile() {
+
+    }
+
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileMd5(String fileMd5) {
+        this.fileMd5 = fileMd5;
+    }
+
+    public String getFileMd5() {
+        return fileMd5;
+    }
+
+    public void setFailed(Boolean failed) {
+        this.failed = failed;
+    }
+
+    public Boolean getFailed() {
+        return failed;
+    }
+
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Long getFileSize() {
+        return fileSize;
+    }
+
+    public void setFileSize(Long fileSize) {
+        this.fileSize = fileSize;
+    }
+
+    public String getOriginName() {
+        return originName;
+    }
+
+    public void setOriginName(String originName) {
+        this.originName = originName;
+    }
+
+    public String getFileType() {
+        return fileType;
+    }
+
+    public void setFileType(String fileType) {
+        this.fileType = fileType;
+    }
+
+    public String getFileDesc() {
+        return fileDesc;
+    }
+
+    public void setFileDesc(String fileDesc) {
+        this.fileDesc = fileDesc;
+    }
+
+    public String getFullPath() {
+        return fullPath;
+    }
+
+    public void setFullPath(String fullPath) {
+        this.fullPath = fullPath;
+    }
+
+    public String getClientKey() {
+        return clientKey;
+    }
+
+    public void setClientKey(String clientKey) {
+        this.clientKey = clientKey;
+    }
+
+    public String getUseType() {
+        return useType;
+    }
+
+    public void setUseType(String useType) {
+        this.useType = useType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public CommonFile clone() throws CloneNotSupportedException {
+        CommonFile commonFile = (CommonFile) super.clone();
+        commonFile.setOriginName(originName);
+        commonFile.setFileName(fileName);
+        commonFile.setClientKey(clientKey);
+        commonFile.setRemark(remark);
+        commonFile.setUseType(useType);
+        commonFile.setFileDesc(fileDesc);
+        commonFile.setFileSize(fileSize);
+        commonFile.setFullPath(fullPath);
+        commonFile.setFileMd5(fileMd5);
+        return commonFile;
+    }
+
+    @Override
+    public String toString() {
+        return String.format("{ fileName: %s  originName: %s ,fullPath:%s }", fileName, originName, fullPath);
+    }
+}

+ 33 - 0
zen-api/src/main/kotlin/cn/gygxzc/envir/sys/service/IFileInfoService.kt

@@ -0,0 +1,33 @@
+package cn.gygxzc.envir.sys.service
+
+import cn.gygxzc.envir.sys.model.CommonFile
+import org.springframework.cloud.openfeign.FeignClient
+import org.springframework.web.bind.annotation.RequestBody
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestMethod
+
+/**
+ * Created by niantuo on 2018/12/20.
+ * 获取文件的信息服务
+ */
+@FeignClient("gateway")
+interface IFileInfoService {
+
+    /**
+     * 根据文件的id获取文件的详细信息
+     *
+     * @param ids 文件的id
+     * @return 文件的详细信息
+     */
+    @RequestMapping(value = ["/info"], method = [RequestMethod.POST])
+    fun queryByIds(@RequestBody ids: List<Long>): List<CommonFile>
+
+    /**
+     * 根据文件的id获取文件的简单信息
+     *
+     * @param ids 文件的id
+     * @return 文件的简略信息
+     */
+    @RequestMapping(value = ["/info/simp"], method = [RequestMethod.POST])
+    fun querySimpByIds(@RequestBody ids: List<Long>): List<CommonFile>
+}