59 lines
1.3 KiB
Go
59 lines
1.3 KiB
Go
package i18n
|
|
|
|
import (
|
|
"git.nobla.cn/golang/aeus-admin/models"
|
|
"git.nobla.cn/golang/rest"
|
|
"git.nobla.cn/golang/rest/types"
|
|
)
|
|
|
|
type ZH struct {
|
|
}
|
|
|
|
func (t *ZH) Menu(model *rest.Model, label string) string {
|
|
if _, ok := model.Value().Interface().(models.Menu); ok {
|
|
return "菜单管理"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.User); ok {
|
|
return "用户管理"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.Role); ok {
|
|
return "角色管理"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.Login); ok {
|
|
return "登录记录"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.Permission); ok {
|
|
return "权限管理"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.Department); ok {
|
|
return "部门管理"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.RolePermission); ok {
|
|
return "角色权限"
|
|
}
|
|
if _, ok := model.Value().Interface().(models.Setting); ok {
|
|
return "参数设置"
|
|
}
|
|
return label
|
|
}
|
|
|
|
func (t *ZH) Permission(model *rest.Model, scene string, label string) string {
|
|
switch scene {
|
|
case types.ScenarioList:
|
|
return "查看"
|
|
case types.ScenarioCreate:
|
|
return "新增"
|
|
case types.ScenarioUpdate:
|
|
return "修改"
|
|
case types.ScenarioDelete:
|
|
return "删除"
|
|
case types.ScenarioView:
|
|
return "详情"
|
|
case types.ScenarioExport:
|
|
return "导出"
|
|
case types.ScenarioImport:
|
|
return "导入"
|
|
}
|
|
return label
|
|
}
|