correct all comments of functions in service

This commit is contained in:
rainyan
2020-04-10 10:36:15 +08:00
parent e0916eeb63
commit 849f0dcf43
15 changed files with 214 additions and 199 deletions

View File

@@ -9,10 +9,10 @@ import (
// @title GetMenuTree
// @description 获取动态菜单树
// @auth 2020/04/05 20:22
// @auth 2020/04/05 20:22
// @param authorityId string
// @return err error
// @return menus []SysMenu
// @return menus []model.SysMenu
func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ? AND authority_menu.parent_id = ?"
@@ -25,9 +25,9 @@ func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
// @title getChildrenList
// @description 获取子菜单
// @auth 2020/04/05 20:22
// @param menu *SysMenu
// @param SQLstatement string
// @auth 2020/04/05 20:22
// @param menu *model.SysMenu
// @param sql string
// @return err error
func getChildrenList(menu *model.SysMenu, sql string) (err error) {
err = global.GVA_DB.Raw(sql, menu.AuthorityId, menu.MenuId).Scan(&menu.Children).Error
@@ -39,9 +39,11 @@ func getChildrenList(menu *model.SysMenu, sql string) (err error) {
// @title GetInfoList
// @description 获取路由分页
// @auth 2020/04/05 20:22
// @param newPassword string
// @auth 2020/04/05 20:22
// @param info request.PageInfo
// @return err error
// @return list interface{}
// @return total int
func GetInfoList(info request.PageInfo) (err error, list interface{}, total int) {
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
@@ -56,8 +58,8 @@ func GetInfoList(info request.PageInfo) (err error, list interface{}, total int)
// @title getBaseChildrenList
// @description get children of menu, 获取菜单的子菜单
// @auth 2020/04/05 20:22
// @param menu *SysBaseMenu
// @auth 2020/04/05 20:22
// @param menu *model.SysBaseMenu
// @return err error
func getBaseChildrenList(menu *model.SysBaseMenu) (err error) {
err = global.GVA_DB.Where("parent_id = ?", menu.ID).Order("sort", true).Find(&menu.Children).Error
@@ -69,8 +71,8 @@ func getBaseChildrenList(menu *model.SysBaseMenu) (err error) {
// @title AddBaseMenu
// @description 函数的详细描述
// @auth 2020/04/05 20:22
// @param newPassword string
// @auth 2020/04/05 20:22
// @param menu *model.SysBaseMenu
// @return err error
//增加基础路由
func AddBaseMenu(menu model.SysBaseMenu) (err error) {
@@ -85,7 +87,7 @@ func AddBaseMenu(menu model.SysBaseMenu) (err error) {
// @title GetBaseMenuTree
// @description 获取基础路由树
// @auth 2020/04/05 20:22
// @auth 2020/04/05 20:22
// @return err error
// @return menus []SysBaseMenu
func GetBaseMenuTree() (err error, menus []model.SysBaseMenu) {
@@ -98,8 +100,8 @@ func GetBaseMenuTree() (err error, menus []model.SysBaseMenu) {
// @title AddMenuAuthority
// @description 为角色增加menu树
// @auth 2020/04/05 20:22
// @param menus []SysBaseMenu
// @auth 2020/04/05 20:22
// @param menus []model.SysBaseMenu
// @param authorityId string
// @return error
func AddMenuAuthority(menus []model.SysBaseMenu, authorityId string) (err error) {
@@ -112,7 +114,7 @@ func AddMenuAuthority(menus []model.SysBaseMenu, authorityId string) (err error)
// @title GetMenuAuthority
// @description 查看当前角色树
// @auth 2020/04/05 20:22
// @auth 2020/04/05 20:22
// @param authorityId string
// @return err error
// @return menus []SysBaseMenu