feat:完善项目管理

This commit is contained in:
henry
2021-12-16 13:22:14 +08:00
parent 8ab89cc051
commit d594725972
9 changed files with 209 additions and 1 deletions

View File

@ -0,0 +1,28 @@
package model
import (
"SciencesServer/app/common/model"
"SciencesServer/serve/orm"
)
type SysNavigation struct {
*model.SysNavigation
}
// Navigation 导航信息
func (m *SysNavigation) Navigation() ([]*model.SysNavigation, error) {
out := make([]*model.SysNavigation, 0)
err := orm.GetDB().Table(m.TableName()).
Select("id", "parent_id", "title", "link").
Where("status = ?", model.SysNavigationStatusForShow).
Where("is_deleted = ?", model.DeleteStatusForNot).
Order("sort " + model.OrderModeToDesc).
Scan(&out).Error
return out, err
}
func NewSysNavigation() *SysNavigation {
return &SysNavigation{model.NewSysNavigation()}
}

View File

@ -0,0 +1,27 @@
package model
import (
"SciencesServer/app/common/model"
"SciencesServer/serve/orm"
)
type SysPlatform struct {
*model.SysPlatform
}
// Platform 平台信息
func (m *SysPlatform) Platform() ([]*model.SysPlatform, error) {
out := make([]*model.SysPlatform, 0)
err := orm.GetDB().Table(m.TableName()).
Select("id", "parent_id", "`key`", "`code`", "title", "link").
Where("is_deleted = ?", model.DeleteStatusForNot).
Order("sort " + model.OrderModeToDesc).
Scan(&out).Error
return out, err
}
func NewSysPlatform() *SysPlatform {
return &SysPlatform{model.NewSysPlatform()}
}