package com.caimei.www.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 兼容旧链接
 *
 * @author : Charles
 * @date : 2020/6/12
 */
@Controller
public class RedirectController {
	/**
	 * 商品详情【旧】
	 */
	@GetMapping("/product-{id}.html")
	public String toProduct(@PathVariable("id") Integer productId) {
		return "redirect:/product/detail.html?id=" + productId;
	}
	/**
	 * 二级页面（找产品/找仪器/找项目/正品联盟）【旧】
	 */
	@GetMapping("/cmpage/info-1-{id}.html")
	public String toTopic(@PathVariable("id") Integer type) {
		return "redirect:/topic.html?type=" + type;
	}
	/**
	 * 项目仪器详情【旧】
	 */
	@GetMapping("/cmpage/info-2-{id}.html")
	public String toInstrument(@PathVariable("id") Integer instrumentId) {
		return "redirect:/instrument/detail.html?id=" + instrumentId;
	}
	/**
	 * 直播页面【旧】
	 */
	@GetMapping("/cmpage/info-3-{id}.html")
	public String toLive(@PathVariable("id") Integer id) {
		return "redirect:/live.html?id=" + id;
	}
	/**
	 * 自由页面【旧】
	 */
	@GetMapping("/cmpage/info-4-{id}.html")
	public String toFreePage(@PathVariable("id") Integer id) {
		return "redirect:/page.html?id=" + id;
	}
	/**
	 * 专题活动列表页【旧】
	 */
	@GetMapping("/cmpage/area.html")
	public String toPromotions() {
		return "redirect:/promotions.html";
	}

    /**
     * 品牌招商介绍页【旧】
     */
	@GetMapping("/html/InvestmentCaiMei/investmentpage.jsp")
	public String toInvestment() {
		return "redirect:/investment.html";
	}

    /**
     * 维修保养介绍页【旧】
     */
    @GetMapping("/html/maintenance/view/mt-entry-index.jsp")
    public String toMaintenance() {
		return "redirect:/maintenance/index.html";
	}

}
