功能更新
This commit is contained in:
25
internal/controller/notice.go
Normal file
25
internal/controller/notice.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"nl-pms-api/internal/commonservice"
|
||||
"nl-pms-api/internal/service"
|
||||
)
|
||||
|
||||
// NoticeController 团队通知。
|
||||
type NoticeController struct {
|
||||
Svc *service.NoticeService
|
||||
}
|
||||
|
||||
func (h *NoticeController) List(c *gin.Context) {
|
||||
after := commonservice.ParseID(c.Query("after"))
|
||||
rows, err := h.Svc.ListNotices(commonservice.UserID(c), after)
|
||||
if err != nil {
|
||||
writeErr(c, err)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"items": rows})
|
||||
}
|
||||
Reference in New Issue
Block a user