// Path: src/main/java/com/monkeyk/sos/domain/shared/GuidGenerator.java
// public abstract class GuidGenerator {
// 
// 
//     private static RandomValueStringGenerator defaultClientSecretGenerator = new RandomValueStringGenerator(32);
// 
// 
//     /**
//      * private constructor
//      */
//     private GuidGenerator() {
//     }
// 
//     public static String generate() {
//         return UUID.randomUUID().toString().replaceAll("-", "");
//     }
// 
//     public static String generateClientSecret() {
//         return defaultClientSecretGenerator.generate();
//     }
// 
// }
// 
// Path: src/main/java/com/monkeyk/sos/infrastructure/DateUtils.java
// public abstract class DateUtils {
// 
//     public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
// 
// 
//     /**
//      * Private constructor
//      */
//     private DateUtils() {
//     }
// 
//     public static LocalDateTime now() {
//         return LocalDateTime.now();
//     }
// 
// 
//     public static String toDateTime(LocalDateTime date) {
//         return toDateTime(date, DEFAULT_DATE_TIME_FORMAT);
//     }
// 
//     public static String toDateTime(LocalDateTime dateTime, String pattern) {
//         return dateTime.format(DateTimeFormatter.ofPattern(pattern, Locale.SIMPLIFIED_CHINESE));
//     }
// 
// 
// 
//     public static String toDateText(LocalDate date, String pattern) {
//         if (date == null || pattern == null) {
//             return null;
//         }
//         return date.format(DateTimeFormatter.ofPattern(pattern, Locale.SIMPLIFIED_CHINESE));
//     }
// 
// 
// }


import com.monkeyk.sos.domain.shared.GuidGenerator;
import com.monkeyk.sos.infrastructure.DateUtils;
import java.io.Serializable;
import java.time.LocalDateTime;
package com.monkeyk.sos.domain;



/**
 * @author Shengzhao Li
 */
public abstract class AbstractDomain implements Serializable {

    private static final long serialVersionUID = 6569365774429340632L;
    /**
     * Database id
     */
    protected int id;

    protected boolean archived;
    /**
     * Domain business guid.
     */
    protected String guid = GuidGenerator.generate();

    /**
     * The domain create time.
     */
    protected LocalDateTime createTime = DateUtils.now();

    public AbstractDomain() {
    }

    public int id() {
        return id;
    }

    public void id(int id) {
        this.id = id;
    }

    public boolean archived() {
        return archived;
    }

    public AbstractDomain archived(boolean archived) {
        this.archived = archived;
        return this;
    }

    public String guid() {
        return guid;
    }

    public void guid(String guid) {
        this.guid = guid;
    }

    public LocalDateTime createTime() {
// Path: src/main/java/com/monkeyk/sos/domain/shared/GuidGenerator.java
// public abstract class GuidGenerator {
// 
// 
//     private static RandomValueStringGenerator defaultClientSecretGenerator = new RandomValueStringGenerator(32);
// 
// 
//     /**
//      * private constructor
//      */
//     private GuidGenerator() {
//     }
// 
//     public static String generate() {
//         return UUID.randomUUID().toString().replaceAll("-", "");
//     }
// 
//     public static String generateClientSecret() {
//         return defaultClientSecretGenerator.generate();
//     }
// 
// }
// 
// Path: src/main/java/com/monkeyk/sos/infrastructure/DateUtils.java
// public abstract class DateUtils {
// 
//     public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
// 
// 
//     /**
//      * Private constructor
//      */
//     private DateUtils() {
//     }
// 
//     public static LocalDateTime now() {
//         return LocalDateTime.now();
//     }
// 
// 
//     public static String toDateTime(LocalDateTime date) {
//         return toDateTime(date, DEFAULT_DATE_TIME_FORMAT);
//     }
// 
//     public static String toDateTime(LocalDateTime dateTime, String pattern) {
//         return dateTime.format(DateTimeFormatter.ofPattern(pattern, Locale.SIMPLIFIED_CHINESE));
//     }
// 
// 
// 
//     public static String toDateText(LocalDate date, String pattern) {
//         if (date == null || pattern == null) {
//             return null;
//         }
//         return date.format(DateTimeFormatter.ofPattern(pattern, Locale.SIMPLIFIED_CHINESE));
//     }
// 
// 
// }


// Path: src/main/java/com/monkeyk/sos/domain/AbstractDomain.java
import com.monkeyk.sos.domain.shared.GuidGenerator;
import com.monkeyk.sos.infrastructure.DateUtils;
import java.io.Serializable;
import java.time.LocalDateTime;

package com.monkeyk.sos.domain;



/**
 * @author Shengzhao Li
 */
public abstract class AbstractDomain implements Serializable {

    private static final long serialVersionUID = 6569365774429340632L;
    /**
     * Database id
     */
    protected int id;

    protected boolean archived;
    /**
     * Domain business guid.
     */
    protected String guid = GuidGenerator.generate();

    /**
     * The domain create time.
     */
    protected LocalDateTime createTime = DateUtils.now();

    public AbstractDomain() {
    }

    public int id() {
        return id;
    }

    public void id(int id) {
        this.id = id;
    }

    public boolean archived() {
        return archived;
    }

    public AbstractDomain archived(boolean archived) {
        this.archived = archived;
        return this;
    }

    public String guid() {
        return guid;
    }

    public void guid(String guid) {
        this.guid = guid;
    }

    public LocalDateTime createTime() {
        return createTime;