package cn.pluss.platform.controller.home;

import cn.pluss.platform.api.Result;
import cn.pluss.platform.jfShop.JfShopHandler;
import cn.pluss.platform.other.JfShopParam;
import cn.pluss.platform.other.JfShopAccount;
import cn.pluss.platform.other.JfShopValidTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * TODO
 *
 * @author crystal
 * @date 2022/5/16 14:43
 */
@Slf4j
@RestController
@RequestMapping("/api/jf/shop")
public class JfShopController {

    @Resource
    private JfShopHandler jfShopHandler;

    /**
     * 新版积分商城积分数量获取接口
     * @param param
     * @return
     */
    @RequestMapping("/get/account")
    public Result<JfShopAccount> getAccount(@RequestBody JfShopParam param){
        return jfShopHandler.getAccount(param);
    }

    /**
     * 获取积分详情
     * @param param
     * @return
     */
    @RequestMapping("/integral/page")
    public Object page(@RequestBody JfShopParam param){
        return jfShopHandler.page(param);
    }

    /**
     * 积分商城新增接口
     * @param param
     * @return
     */
    @PostMapping("/integral/operate")
    public Result<Object> operate(@RequestBody JfShopParam param){
        return jfShopHandler.operate(param);
    }

    /**
     *
     * 获取积分商城任务完成进度
     * @param param
     * @return
     */
    @PostMapping("/task/status")
    public Result<Object> getTaskStatus(@RequestBody JfShopValidTask param){
        return jfShopHandler.getTaskStatus(param);
    }
}
