package api import ( "SciencesServer/app/api/website/controller/sys" "SciencesServer/app/basic/api" "github.com/gin-gonic/gin" ) type Sys struct{} func (*Sys) Platform(c *gin.Context) { data, err := sys.NewPlatform()().Instance() api.APIResponse(err, data)(c) } func (*Sys) Navigation(c *gin.Context) { data, err := sys.NewNavigation()(api.GetTenantID()(c).(uint64)).Instance() api.APIResponse(err, data)(c) } func (*Sys) Banner(c *gin.Context) { form := &struct { Key string `json:"key" form:"key" binding:"required"` }{} if err := api.Bind(form)(c); err != nil { api.APIFailure(err.(error))(c) return } data, err := sys.NewBanner()(api.GetTenantID()(c).(uint64)).Instance(form.Key) api.APIResponse(err, data)(c) } func (*Sys) About(c *gin.Context) { data, err := sys.NewAbout()(api.GetTenantID()(c).(uint64)).Instance() api.APIResponse(err, data)(c) } func (*Sys) AboutNavigation(c *gin.Context) { data, err := sys.NewAbout()(api.GetTenantID()(c).(uint64)).Navigation() api.APIResponse(err, data)(c) } func (*Sys) Agreement(c *gin.Context) { data, err := sys.NewAgreement()(api.GetTenantID()(c).(uint64)).Instance() api.APIResponse(err, data)(c) } func (*Sys) AgreementDetail(c *gin.Context) { form := new(api.IDStringForm) if err := api.Bind(form)(c); err != nil { api.APIFailure(err.(error))(c) return } data, err := sys.NewAgreement()(api.GetTenantID()(c).(uint64)).Detail(form.Convert()) api.APIResponse(err, data)(c) } func (*Sys) Industry(c *gin.Context) { data, err := sys.NewIndustry()().Instance() api.APIResponse(err, data)(c) }