// Copyright (c) Shenyang Leading Edge Intelligent Technology Co., Ltd. All rights reserved.
/******************************************************************************
 *
 * @Interface Name           : RegisterRoutes
 *-----------------------------------------------------------------------------
 *
 * @Description              : 基础接口
 *
 * @Author                   : lou wenzhi
 *
 * @Date                     : 2021-07-21 10:36:05
 *
 ******************************************************************************/
package home

import (
	svr "LAPP_ACURA_MOM_BACKEND/services/base"
	"github.com/kataras/iris/v12/core/router"
)

/******************************************************************************
 *
 * @Interface Name           : RegisterBaseRoutes
 *-----------------------------------------------------------------------------
 *
 * @Description              : 注册基本路由路由
 *
 * @Author                   : 代码生成器创建
 *
 * @Date                     : 2021-07-21 10:36:05
 *
 ******************************************************************************/
func RegisterBaseRoutes(home router.Party) {

	// RoleMenu的服务实例
	var serviceOfRoleMenu = svr.NewRoleMenuService()
	//获取动态菜单
	RegisterDynamicMenu(home, "GET", "/sysMenu", serviceOfRoleMenu.GetMenuRole)

	user := home.Party("/user")
	// User的服务实例
	var serviceOfUser = svr.NewUserService()
	//登录接口
	RegisterLogin(user, "POST", "/login", serviceOfUser.GetUserByUsername)
	//获取用户基本信息
	RegisterGetUserInfo(user, "GET", "/getuserinfo", serviceOfUser.SelectOne)

	// Plant的服务实例
	var serviceOfPlant = svr.NewPlantService()
	//获取工厂列表
	RegisterSelectPlants(user, "GET", "/plants", serviceOfPlant.GetPlants)

}
