/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.groupon.service;

import org.springblade.modules.api.response.GroupStatisResponse;
import org.springblade.modules.groupon.entity.Groupon;
import org.springblade.modules.groupon.vo.GrouponVO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * 团购表 服务类
 *
 * @author BladeX
 * @since 2023-06-02
 */
public interface IGrouponService extends IService<Groupon> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param groupon
	 * @return
	 */
	IPage<GrouponVO> selectGrouponPage(IPage<GrouponVO> page, GrouponVO groupon);

	/**
	 * 最新团购
	 *
	 * @param longitude
	 * @param latitude
	 * @param page
	 * @return
	 */
	IPage<GrouponVO> latestGroupon(String address, Double longitude, Double latitude, IPage<GrouponVO> page);

	/**
	 * 团购历史
	 * @param page
	 * @return
	 */
	IPage<GrouponVO> historyGroupon(String address, Double longitude, Double latitude, IPage<GrouponVO> page);

	/**
	 * 团购详情
	 * @param grouponId
	 * @return
	 */
	GrouponVO detail(Long grouponId);

	/**
	 * 发布团购
	 * @param groupon
	 */
	void publishGroupon(GrouponVO groupon);

	void check(GrouponVO groupon);


	/**
	 * 审核
	 */
    void audit(String id, Integer auditStatus, String remark);

	void perfect(GrouponVO grouponVO);

    GroupStatisResponse groupStatistics(Long userId);

	IPage<GrouponVO> grouponMngList(IPage page, Long userId, Integer state);

	GrouponVO grouponMngDetail(Long groupId);

	/**
	 * 获取团购详情路径
	 * @return
	 */
	String getGrouponPath(Long grouponId);

    void gen(GrouponVO grouponVO);
}
