about.go 544 B

123456789101112131415161718192021222324252627
  1. package controllers
  2. import (
  3. "cc-officialweb/service"
  4. beego "github.com/beego/beego/v2/server/web"
  5. )
  6. type AboutController struct {
  7. beego.Controller
  8. }
  9. func (a *AboutController) Get() {
  10. about, err := service.GetRecruit("about")
  11. if err != nil {
  12. a.Data["content"] = "暂无内容"
  13. } else {
  14. a.Data["content"] = about
  15. }
  16. var success []string
  17. //获取成功案例轮播图
  18. exams := service.GetResource("example")
  19. for _, v := range exams {
  20. success = append(success, v.Url)
  21. }
  22. a.Data["example"] = success
  23. a.TplName = "about.html"
  24. }