package cn.reghao.tnb.file.app.zdisk.model.po;

import cn.reghao.jutil.jdk.web.db.BaseObject;
import cn.reghao.tnb.common.auth.UserContext;
import cn.reghao.tnb.file.app.zdisk.model.dto.ShareCreate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author reghao
 * @date 2025-09-05 17:06:14
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
public class DiskShare extends BaseObject<Integer> {
    private Long shareId;
    private Integer albumType;
    private Long albumId;
    private Long createAt;
    private Long createBy;

    public DiskShare(long shareId, ShareCreate shareCreate) {
        this.shareId = shareId;
        this.albumType = shareCreate.getAlbumType();
        this.albumId = shareCreate.getAlbumId();
        this.createAt = System.currentTimeMillis();
        this.createBy = UserContext.getUserId();
    }
}
