package cn.com.qmth.examcloud.core.questions.service;

import java.util.List;

import cn.com.qmth.examcloud.api.commons.security.bean.User;
import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PropertyDto;
import cn.com.qmth.examcloud.core.questions.dao.entity.Property;

/**
 * @author weiwenhai
 * @describle 属性service
 * @date 2017.11.6
 */
public interface PropertyService {

    /**
     * 保存属性
     *
     * @param propertyDtos
     */
    public void saveProperty(List<PropertyDto> propertyDtos, User user);

    /**
     * 查询属性
     *
     * @param coursePropertyId
     * @param user
     * @return
     */
    public List<PropertyDto> propertyDtos(Long coursePropertyId, User user);

    /**
     * 新增属性
     *
     * @param property
     * @param user
     */
    public void saveProperty(Property property, User user) throws Exception;

    /**
     * 删除属性
     *
     * @param propertyId
     */
    public void deleteProperty(Long propertyId, Long coursePropertyId, User user);

    /**
     * 查询所有属性
     *
     * @param coursePropertyId
     * @param user
     * @return
     */
    public List<Property> findAll(Long coursePropertyId, User user);

    /**
     * 查询某个树下的子节点
     *
     * @param property
     * @return
     */
    public List<Property> findPropertySons(Property property);

    /**
     * 查询某个树下的子节点
     *
     * @param property
     * @return
     */
    public List<Property> findPropertySons(Long propertyId);

    /**
     * 查询课程属性下面的所有父节点
     *
     * @param property
     * @return
     */
    public List<Property> findPropertyParents(Long coursePropertyId, Long orgId);

    /**
     * 上移
     *
     * @param property
     */
    public void moveUp(Property property) throws Exception;

    /**
     * 下移
     *
     * @param property
     */
    public void moveDown(Property property) throws Exception;
}
