mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-27 07:19:37 +08:00
【更新】更新restful
This commit is contained in:
@@ -13,16 +13,7 @@ type NoticeApi struct {
|
||||
NoticeApp services.SysNoticeModel
|
||||
}
|
||||
|
||||
// @Summary 通知列表数据
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Param noticeType query string false "noticeType"
|
||||
// @Param title query string false "title"
|
||||
// @Param pageSize query int false "页条数"
|
||||
// @Param pageNum query int false "页码"
|
||||
// @Success 200 {string} string "{"code": 200, "data": [...]}"
|
||||
// @Router /system/post [get]
|
||||
// @Security
|
||||
// GetNoticeList 通知列表数据
|
||||
func (p *NoticeApi) GetNoticeList(rc *restfulx.ReqCtx) {
|
||||
pageNum := restfulx.QueryInt(rc, "pageNum", 1)
|
||||
pageSize := restfulx.QueryInt(rc, "pageSize", 10)
|
||||
@@ -45,16 +36,7 @@ func (p *NoticeApi) GetNoticeList(rc *restfulx.ReqCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// @Summary 添加通知
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysNotice true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/notice [post]
|
||||
// @Security X-TOKEN
|
||||
// InsertNotice 添加通知
|
||||
func (p *NoticeApi) InsertNotice(rc *restfulx.ReqCtx) {
|
||||
var notice entity.SysNotice
|
||||
restfulx.BindQuery(rc, ¬ice)
|
||||
@@ -62,16 +44,7 @@ func (p *NoticeApi) InsertNotice(rc *restfulx.ReqCtx) {
|
||||
p.NoticeApp.Insert(notice)
|
||||
}
|
||||
|
||||
// @Summary 修改通知
|
||||
// @Description 获取JSON
|
||||
// @Tags 通知
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body entity.SysNotice true "body"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "添加失败"}"
|
||||
// @Router /system/notice [put]
|
||||
// @Security X-TOKEN
|
||||
// UpdateNotice 修改通知
|
||||
func (p *NoticeApi) UpdateNotice(rc *restfulx.ReqCtx) {
|
||||
var notice entity.SysNotice
|
||||
restfulx.BindQuery(rc, ¬ice)
|
||||
@@ -79,13 +52,7 @@ func (p *NoticeApi) UpdateNotice(rc *restfulx.ReqCtx) {
|
||||
p.NoticeApp.Update(notice)
|
||||
}
|
||||
|
||||
// @Summary 删除通知
|
||||
// @Description 删除数据
|
||||
// @Tags 通知
|
||||
// @Param noticeId path string true "noticeId "
|
||||
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
|
||||
// @Success 200 {string} string "{"code": 400, "message": "删除失败"}"
|
||||
// @Router /system/notice/{noticeId} [delete]
|
||||
// DeleteNotice 删除通知
|
||||
func (p *NoticeApi) DeleteNotice(rc *restfulx.ReqCtx) {
|
||||
noticeId := restfulx.PathParam(rc, "noticeId")
|
||||
noticeIds := utils.IdsStrToIdsIntGroup(noticeId)
|
||||
|
||||
Reference in New Issue
Block a user