|
12345678910111213141516171819202122232425262728293031323334353637383940 |
- package hdl
-
- import (
- "applet/app/db"
- "applet/app/e"
- "github.com/gin-gonic/gin"
- )
-
- func NoticeList(c *gin.Context) {
- noticeDb := db.NoticeDb{}
- noticeDb.Set()
- notices, err := noticeDb.FindNotice(0, 0)
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- e.OutSuc(c, map[string]interface{}{
- "list": notices,
- }, nil)
- return
- }
-
- func PopCentralKitchen(c *gin.Context) {
- noticeDb := db.NoticeDb{}
- noticeDb.Set()
- notices, err := noticeDb.GetPopToCentralKitchen()
- if err != nil {
- e.OutErr(c, e.ERR_DB_ORM, err.Error())
- return
- }
- var isPop bool
- if notices == nil {
- isPop = true
- }
- e.OutSuc(c, map[string]interface{}{
- "data": notices,
- "is_pop": isPop,
- }, nil)
- return
- }
|