package routers

import (
	"cc-officialweb/controllers"
	"cc-officialweb/controllers/admin"
	beego "github.com/beego/beego/v2/server/web"
)

func init() {
	//前台官网
	beego.Router("/", &controllers.MainController{})
	beego.Router("/about", &controllers.AboutController{})
	beego.Router("/services", &controllers.ServicesController{})
	beego.Router("/recruit", &controllers.RecruitController{})
	beego.Router("/services/:id", &controllers.ServicesController{})
	beego.Router("/services-detail/:id", &controllers.ServicesDetailController{})
	beego.Router("/product", &controllers.ProductController{})
	beego.Router("/product/:id", &controllers.DetailController{})
	beego.Router("/product/:id/parameters", &controllers.DetailController{})
	beego.Router("/product/:id/instructions", &controllers.DetailController{})
	beego.Router("/product/:id/software", &controllers.DetailController{})
	beego.Router("/product/:id/accessories", &controllers.DetailController{})
	beego.Router("/portfolio", &controllers.MainController{})
	beego.Router("/contact", &controllers.ContactController{})
	//后台
	beego.Router("/admin", &admin.IndexController{})
	//beego.Router("/admin:any", &admin.IndexController{})
	//新闻管理
	beego.Router("/news", &controllers.NewController{})
	beego.Router("/news/:id", &controllers.NewController{}, "get:NewDetail")
	beego.Router("/api/news", &controllers.NewController{}, "post:GetAllNew")
	beego.Router("/api/news", &controllers.NewController{}, "get:GetNewDetail")
	beego.Router("/api/addnews", &controllers.NewController{}, "post:AddNews")
	beego.Router("/api/news", &controllers.NewController{}, "delete:DeleteNewsById")
	beego.Router("/api/news", &controllers.NewController{}, "put:UpdateNews")
	beego.Router("/api/newstype", &controllers.NewController{}, "get:GetNewsType")
	//资源管理
	beego.Router("/api/upload", &controllers.UploadImageController{})
	beego.Router("/api/updateResource", &controllers.UploadImageController{}, "put:UpdateResource")
	beego.Router("/api/resource", &controllers.UploadImageController{}, "delete:DeleteResourceById")
	beego.Router("/api/resource", &controllers.UploadImageController{}, "post:GetResource")
	beego.Router("/api/resource", &controllers.UploadImageController{}, "get:GetResourceById")
	//登录
	beego.Router("/logon", &controllers.LoginController{}, "post:Login")
	//文件资源管理
	beego.Router("/api/file", &controllers.UploadFileController{})
	//产品管理
	beego.Router("/api/product", &controllers.ProductController{}, "post:AddProduct")
	beego.Router("/api/product", &controllers.ProductController{}, "delete:DeleteProductById")
	beego.Router("/api/productAll", &controllers.ProductController{}, "post:GetAllProduct")
	beego.Router("/api/product", &controllers.ProductController{}, "put:UpdateProductById")
	beego.Router("/api/product", &controllers.ProductController{}, "get:GetProduct")
	beego.Router("/api/productisindex", &controllers.ProductController{}, "put:UpdateIsIndex")
	beego.Router("/api/productsort", &controllers.ProductController{}, "put:UpdateIsSort")
	//服务管理
	beego.Router("/api/service", &controllers.ServicesDetailController{}, "post:AddServices")
	beego.Router("/api/service", &controllers.ServicesDetailController{}, "put:UpdateServices")
	beego.Router("/api/service", &controllers.ServicesDetailController{}, "delete:DeleteServices")
	beego.Router("/api/allservice", &controllers.ServicesDetailController{}, "post:GetAllServices")
	beego.Router("/api/service", &controllers.ServicesDetailController{}, "get:GetServices")
	beego.Router("/api/getservice", &controllers.ServicesDetailController{}, "get:GetServe")
	//招募管理
	beego.Router("/api/recruit", &controllers.RecruitController{}, "post:AddRecruit")
	beego.Router("/api/recruit", &controllers.RecruitController{}, "put:UpdateRecruit")
	beego.Router("/api/recruit", &controllers.RecruitController{}, "delete:DeleteRecruit")
	beego.Router("/api/allrecruit", &controllers.RecruitController{}, "post:GetAllRecruit")
	beego.Router("/api/recruit", &controllers.RecruitController{}, "get:GetRecruit")
	//数据展示
	beego.Router("/api/data", &controllers.DataModelController{}, "get:GetData")
	beego.Router("/api/data", &controllers.DataModelController{}, "put:UpdataModel")
	beego.Router("/api/data", &controllers.DataModelController{}, "delete:DeleteDataModel")
	beego.Router("/api/data", &controllers.DataModelController{}, "post:AddDataModel")
	//新数据展示
	beego.Router("/api/datasall", &controllers.DataModelController{}, "post:GetDatas")
	beego.Router("/api/datas", &controllers.DataModelController{}, "put:UpdataData")
	beego.Router("/api/datas", &controllers.DataModelController{}, "delete:DeleteDataById")
	beego.Router("/api/datas", &controllers.DataModelController{}, "post:AddData")
	beego.Router("/api/datastype", &controllers.DataModelController{}, "get:GetDatasByType")
	beego.Router("/api/getdatatype", &controllers.DataModelController{}, "get:GetDataType")
	//联系我们
	beego.Router("/addcontact", &controllers.ContactController{}, "post:AddContact")
	beego.Router("/api/contact", &controllers.ContactController{}, "delete:DeleteContactById")
	beego.Router("/api/contactall", &controllers.ContactController{}, "post:GetAllContact")
	//友情链接
	beego.Router("/api/links", &controllers.LinksController{}, "post:AddLinks")
	beego.Router("/api/links", &controllers.LinksController{}, "delete:DeleteLinksById")
	beego.Router("/api/links", &controllers.LinksController{}, "put:UpdateLinks")
	beego.Router("/api/alllinks", &controllers.LinksController{}, "post:GetAllLinks")
	//产品类型管理
	beego.Router("/api/producttype", &controllers.ProductController{}, "post:AddProductType")
	beego.Router("/api/producttype", &controllers.ProductController{}, "get:GetProductType")
	beego.Router("/api/producttype", &controllers.ProductController{}, "delete:DeleteProductTypeById")
	beego.Router("/api/allproducttype", &controllers.ProductController{}, "post:GetAllProductType")
	beego.Router("/api/producttype", &controllers.ProductController{}, "put:UpdateProductType")
}
