1 Star 0 Fork 0

万聂青 / ginrest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
viewsets.go 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
万聂青 提交于 2020-11-02 12:07 . update readme.md and reset gomod name
package ginrest
import (
"gitee.com/Ivy1996-encode/ginrest/exceptions"
"github.com/gin-gonic/gin"
)
type ListView struct{}
func (*ListView) List(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type RetrieveView struct{}
func (*ListView) Retrieve(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type CreateView struct{}
func (*CreateView) Create(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type UpdateView struct{}
func (*UpdateView) Update(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type PartialUpdateView struct{}
func (*PartialUpdateView) PartialUpdate(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type DestroyView struct{}
func (m *DestroyView) Destroy(context *gin.Context) {
panic(exceptions.MethodNotAllowedError)
}
type ReadOnlyViewSet struct {
ListView
RetrieveView
}
type UpdateViewSet struct {
UpdateView
PartialUpdateView
}
type ModelViewSet struct {
ReadOnlyViewSet
CreateView
UpdateViewSet
DestroyView
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/Ivy1996-encode/ginrest.git
git@gitee.com:Ivy1996-encode/ginrest.git
Ivy1996-encode
ginrest
ginrest
5823538d6d83

搜索帮助