package com.caimei.www.controller.unlimited;

import com.caimei.www.controller.BaseController;
import com.caimei.www.pojo.page.ProductDetail;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Description
 *
 * @author : Charles
 * @date : 2020/7/31
 */
@Controller
public class FleaMarketController extends BaseController {

	private static final String FLEA_MARKET_INTRO = "flea-market/intro";
	private static final String FLEA_MARKET_LIST = "flea-market/list";
	private static final String FLEA_MARKET_FORM = "flea-market/form";
	private static final String FLEA_MARKET_DETAIL = "flea-market/detail";

    /**
     * 二手市场介绍
     */
    @GetMapping("/flea-market/intro.html")
    public String fleaMarket() {
        return FLEA_MARKET_INTRO;
    }

    /**
     * 二手市场介绍
     */
    @GetMapping("/flea-market/list.html")
    public String fleaMarketList() {
        return FLEA_MARKET_LIST;
    }

    /**
     * 发布二手商品
     */
    @GetMapping("/flea-market/form.html")
    public String fleaMarketForm() {
        return FLEA_MARKET_FORM;
    }

    /**
     * 二手商品详情
     */
    @GetMapping("/flea-market-{id}.html")
    public String fleaMarketDetail(final Model model, @PathVariable("id") Integer productId) {
        model.addAttribute("productId", productId);
        return FLEA_MARKET_DETAIL;
    }

}
