package me.chyxion.tigon.service;

import java.util.List;
import me.chyxion.tigon.model.BaseModel;
import me.chyxion.tigon.model.ViewModel;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;

/**
 * @version 0.0.1
 * @since 0.0.1
 * @author Shaun Chyxion <br>
 * chyxion@163.com <br>
 * Aug 11, 2016 1:36:04 PM
 */
public interface BaseService<PrimaryKey, Model extends BaseModel<PrimaryKey>> {

    /**
     * model to view model
     * @param model db model
     * @return view model
     */
    ViewModel<Model> toViewModel(@NotNull Model model);

    /**
     * model to view model
     * @param models model
     * @return view model
     */
    List<ViewModel<Model>> toViewModel(@NotEmpty List<Model> models);
}
