All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hn.doc.xyj.domain.Doc Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.hn.doc.xyj.domain;

import cn.hutool.json.JSONUtil;

import java.util.HashMap;
import java.util.Map;

/**
 *  文档
 */
public class Doc {
    private Map map = new HashMap(3);

    public Doc setParentId(String parentId) {
        map.put("parentId", parentId);
        return this;
    }

    public Doc setName(String name) {
        map.put("name", name);
        return this;
    }

    public Doc setProjectId(String projectId) {
        map.put("projectId", projectId);
        return this;
    }

    public String getDocId() {
        return map.get("docId").toString();
    }

    public Doc setDocId(String docId) {
        map.put("docId", docId);
        return this;
    }

    /**
     * 文档类型
     * @param type sys.http=http文档 sys.folder=文件夹
     * @return doc
     */
    public Doc setType(String type) {
        map.put("type", type);
        return this;
    }

    /**
     * 备注
     * @param comment 备注
     * @return Doc
     */
    public Doc setComment(String comment) {
        map.put("comment", comment);
        return this;
    }

    /**
     * 内容
     * @param content 内容 {@link DocContent 转成json}
     * @return Doc
     */
    public Doc setContent(DocContent content) {
        map.put("content", JSONUtil.toJsonStr(content));
        return this;
    }

    public Map build() {
        return map;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy