package com.xunwang.education.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xunwang.education.entity.StuNeeds;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xunwang.education.entity.vo.StuNeedsVo;
import io.swagger.annotations.ApiOperation;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 需求表 服务类
 * </p>
 *
 * @author Long
 * @since 2022-11-16
 */
public interface StudentRequirementsService extends IService<StuNeeds> {

    // 发布学生需求
    boolean publishRequirements(StuNeeds requirements, HttpServletRequest request);

    /**
     * 个人发布的需求
     * @param request
     * @return
     */
    HashMap<String, Object> getPersonCourse(HttpServletRequest request);

    // 更新个人需求上下架
    boolean updatePersonDisplay(HttpServletRequest request);

    /**
     * 分页查询所有需求
     * @param stuNeedsVo
     * @return
     */
    Map<String, Object> getAllRequirements(StuNeedsVo stuNeedsVo);

    /**
     * 根据需求id查询需求是否上锁或下架
     * @param needId
     * @return
     */
    String queryLockOrDisplay(String needId);

    /**
     * 锁定需求号
     * @param needId
     * @param version
     * @return
     */
    boolean lockStuNeedId(String needId, String version);

    /**
     * 获取需求详情
     * @param request
     * @return
     */
    StuNeeds getStuNeedDetail(HttpServletRequest request);
}
