package com.sqx.modules.bl.massage.app;

import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.bl.massage.entity.MassagePackage;
import com.sqx.modules.bl.massage.entity.MassagePackageDetail;
import com.sqx.modules.bl.massage.service.MassagePackageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
@RequestMapping("/app/massage/package")
@Api(value = "服务包管理", tags = {"服务包管理"})
public class AppMassagePackageController {

    @Autowired
    private MassagePackageService service;

    @Login
    @GetMapping("/findPage")
    @ApiOperation("查询按服务包（分页）")
    public Result findPage(MassagePackage massagePackage){
        massagePackage.setStatus(1);
        massagePackage.setIsActivity(0);
        return service.findPage(massagePackage);
    }

    @Login
    @GetMapping("/findPackageAndMassagePage")
    @ApiOperation("查询按服务包及项目（分页）")
    public Result findPackageAndMassagePage(MassagePackage massagePackage){
        massagePackage.setStatus(1);
        return service.findPackageAndMassagePage(massagePackage);
    }

    @Login
    @GetMapping("/findAppActivityPage")
    @ApiOperation("查询按服务包（分页）")
    public Result findAppActivityPage(MassagePackage massagePackage){
        return service.findAppActivityPage(massagePackage);
    }

    @Login
    @GetMapping("/getAppGroupDetail")
    @ApiOperation("查询团购详情")
    public Result getAppGroupDetail(@RequestAttribute("userId") Long userId,MassagePackage massagePackage){
        return service.getAppGroupDetail(userId,massagePackage);
    }

    @Login
    @GetMapping("/getAppFlashDetail")
    @ApiOperation("查询限时秒杀详情")
    public Result getAppFlashDetail(@RequestAttribute("userId") Long userId,MassagePackage massagePackage){
        return service.getAppFlashDetail(userId,massagePackage);
    }

}
