package com.example.gallery.models;

import com.google.gson.annotations.SerializedName;
import java.io.Serializable;

public class Publication implements Serializable {

    public int pk;
    public String description;
    public String image;
    public String video;
    public String content_type;
    public boolean is_pinned;
    public Float average_score;
    public Integer current_user_score;

    @SerializedName("user_detail")
    public UserDetail user_detail;

    public String time_created;

    public String getUsername() {
        return user_detail != null ? user_detail.username : "User";
    }

    public static class UserDetail implements Serializable {
        public String username;
    }
}
