feat:完善项目管理
This commit is contained in:
28
app/api/website/model/sys_navigation.go
Normal file
28
app/api/website/model/sys_navigation.go
Normal 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()}
|
||||
}
|
27
app/api/website/model/sys_platform.go
Normal file
27
app/api/website/model/sys_platform.go
Normal 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()}
|
||||
}
|
Reference in New Issue
Block a user