补充blog接口定义

This commit is contained in:
yumaojun03 2024-12-01 16:05:07 +08:00
parent cd640a3a9b
commit f2082dec6d
6 changed files with 174 additions and 56 deletions

8
vblog/apps/blog/enum.go Normal file
View File

@ -0,0 +1,8 @@
package blog
type STAGE int
const (
STAGE_DRAFT STAGE = iota
STAGE_PUBLISHED
)

View File

@ -1,10 +1,16 @@
package blog
import (
"context"
"gitlab.com/go-course-project/go17/vblog/utils"
)
type Service interface {
// 创建博客
CreateBlog()
CreateBlog(context.Context, *CreateBlogRequest) (*Blog, error)
// 博客列表查询
QueryBlog()
QueryBlog(context.Context, *QueryBlogRequest) (*BlogSet, error)
// 博客详情查询
DescribeBlog()
// 博客编辑
@ -14,3 +20,18 @@ type Service interface {
// 删除
DeleteBlog()
}
type QueryBlogRequest struct {
// 分页参数
utils.PageRequest
// 文章标题模糊匹配, Golang
Keywords string `json:"keywords"`
// 状态过滤参数, 作者nil, 访客: STAGE_PUBLISHED
Stage *STAGE `json:"stage"`
// 查询某个用户具体的文章: 给作者用的
Username string `json:"username"`
// 分类
Category string `json:"category"`
// 查询Tag相关的文章
Tags map[string]string `json:"tag"`
}

45
vblog/apps/blog/model.go Normal file
View File

@ -0,0 +1,45 @@
package blog
import (
"time"
"gitlab.com/go-course-project/go17/vblog/utils"
)
type BlogSet struct {
Total int32 `json:"total"`
Items []*Blog `json:"items"`
}
type Blog struct {
// 存放到数据里的对象的远数据信息
utils.ResourceMeta
// 创建是的具体信息
CreateBlogRequest
// 文章状态
Status
}
func (t *Blog) TableName() string {
return "blogs"
}
type CreateBlogRequest struct {
// 标题
Title string `json:"title" gorm:"column:title;type:varchar(200)"`
// 摘要
Summary string `json:"summary" gorm:"column:summary;type:text"`
// 内容
Content string `json:"content" gorm:"column:content;type:text"`
// 分类
Category string `json:"category" gorm:"column:category;type:text"`
// 标签
Tags map[string]string `json:"tags" gorm:"column:tags;serializer:json"`
}
type Status struct {
// 0: 草稿, 1: 已发布, 2: 审核 ...
Stage STAGE `json:"stage" gorm:"column:stage;type:tinyint(1)"`
// 状态变化的时间, 拿发布时间
ChangeAt *time.Time `json:"change_at" gorm:"column:change_at"`
}

View File

@ -1,10 +1,10 @@
<mxfile host="65bd71144e">
<diagram id="q5X4NpZnwlXZwvvlOuBN" name="第 1 页">
<mxGraphModel dx="893" dy="1679" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="893" dy="1530" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="10" style="edgeStyle=none;html=1;exitX=1;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="6">
<mxCell id="10" style="edgeStyle=none;html=1;exitX=1;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.25;entryDx=0;entryDy=0;" parent="1" source="2" target="6" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="2" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
@ -13,7 +13,7 @@
<mxCell id="3" value="作者" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="75" y="50" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="51" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="4" target="43">
<mxCell id="51" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="4" target="43" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="4" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="1" vertex="1">
@ -25,43 +25,43 @@
<mxCell id="6" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="210" y="120" width="230" height="220" as="geometry"/>
</mxCell>
<mxCell id="7" value="用户名" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="7" value="用户名" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="265" y="170" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="8" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="8" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="265" y="210" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="9" value="提交" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="265" y="260" width="120" height="20" as="geometry"/>
<mxCell id="9" value="提交" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="265" y="290" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="11" target="20">
<mxCell id="21" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="11" target="20" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="11" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="11" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="520" y="80" width="300" height="300" as="geometry"/>
</mxCell>
<mxCell id="12" value="作者的工作台(后台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="12" value="作者的工作台(后台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="520" y="20" width="130" height="30" as="geometry"/>
</mxCell>
<mxCell id="13" value="文章列表" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="13" value="文章列表" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="520" y="50" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="14" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="14" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="530" y="140" width="30" height="220" as="geometry"/>
</mxCell>
<mxCell id="15" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="15" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="580" y="140" width="230" height="220" as="geometry"/>
</mxCell>
<mxCell id="16" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="16" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="620" y="170" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="17" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="17" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="620" y="210" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="18" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="18" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="620" y="250" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="35" value="效果预览" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="19" target="30">
<mxCell id="35" value="效果预览" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" parent="1" source="19" target="30" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="650" y="410"/>
@ -69,119 +69,153 @@
</Array>
</mxGeometry>
</mxCell>
<mxCell id="19" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="19" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="620" y="290" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="20" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="20" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="545" y="470" width="250" height="210" as="geometry"/>
</mxCell>
<mxCell id="22" value="创建文章/编辑文章" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="22" value="创建文章/编辑文章" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="540" y="430" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="23" value="标题" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="23" value="标题" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="575" y="500" width="190" height="30" as="geometry"/>
</mxCell>
<mxCell id="24" value="摘要" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="24" value="摘要" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="575" y="550" width="190" height="30" as="geometry"/>
</mxCell>
<mxCell id="25" value="内容" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="25" value="内容" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="575" y="600" width="190" height="60" as="geometry"/>
</mxCell>
<mxCell id="26" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="26" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="740" y="170" width="60" height="20" as="geometry"/>
</mxCell>
<mxCell id="27" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="27" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="740" y="210" width="60" height="20" as="geometry"/>
</mxCell>
<mxCell id="28" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="28" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="740" y="250" width="60" height="20" as="geometry"/>
</mxCell>
<mxCell id="29" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="29" value="发布" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="740" y="290" width="60" height="20" as="geometry"/>
</mxCell>
<mxCell id="30" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="30" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="185" y="470" width="275" height="210" as="geometry"/>
</mxCell>
<mxCell id="31" value="文章详情浏览页(前台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="31" value="文章详情浏览页(前台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="185" y="430" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="38" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="37" target="11">
<mxCell id="38" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="37" target="11" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="39" value="返回继续编辑" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="38">
<mxCell id="39" value="返回继续编辑" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="38" vertex="1" connectable="0">
<mxGeometry x="0.103" y="-1" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="37" value="返回后台" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="37" value="返回后台" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="360" y="480" width="90" height="30" as="geometry"/>
</mxCell>
<mxCell id="40" value="标题" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="40" value="标题" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="525" width="180" height="25" as="geometry"/>
</mxCell>
<mxCell id="41" value="摘要" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="41" value="摘要" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="562.5" width="180" height="25" as="geometry"/>
</mxCell>
<mxCell id="42" value="内容" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="42" value="内容" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="600" width="180" height="60" as="geometry"/>
</mxCell>
<mxCell id="52" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="43" target="30">
<mxCell id="52" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="43" target="30" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="43" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="43" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="185" y="730" width="275" height="210" as="geometry"/>
</mxCell>
<mxCell id="44" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="44" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="230" y="780" width="200" height="20" as="geometry"/>
</mxCell>
<mxCell id="45" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="45" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="230" y="810" width="200" height="20" as="geometry"/>
</mxCell>
<mxCell id="46" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="46" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="230" y="850" width="200" height="20" as="geometry"/>
</mxCell>
<mxCell id="47" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="47" value="文章列表" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="230" y="890" width="200" height="20" as="geometry"/>
</mxCell>
<mxCell id="48" value="Go" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="48" value="Go" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="210" y="740" width="40" height="20" as="geometry"/>
</mxCell>
<mxCell id="49" value="Python" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="49" value="Python" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="250" y="740" width="40" height="20" as="geometry"/>
</mxCell>
<mxCell id="50" value="文章列表浏览页(前台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="50" value="文章列表浏览页(前台)" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="185" y="690" width="120" height="30" as="geometry"/>
</mxCell>
<mxCell id="53" value="登录页面" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="53" value="登录页面" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="210" y="80" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="54" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="54" value="" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="220" y="-200" width="230" height="180" as="geometry"/>
</mxCell>
<mxCell id="57" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="56" target="54">
<mxCell id="57" style="edgeStyle=orthogonalEdgeStyle;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" parent="1" source="56" target="54" edge="1">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="56" value="注册" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="56" value="注册" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="360" y="130" width="65" height="20" as="geometry"/>
</mxCell>
<mxCell id="58" value="用户名" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="58" value="用户名" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="270" y="-180" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="59" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="59" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="270" y="-140" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="60" value="提交" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="60" value="提交" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="270" y="-70" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="61" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="61" value="密码" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="270" y="-110" width="120" height="20" as="geometry"/>
</mxCell>
<mxCell id="62" value="注册页面" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="1">
<mxCell id="62" value="注册页面" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="220" y="-240" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="63" value="退出" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxCell id="63" value="退出" style="rounded=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="745" y="90" width="65" height="20" as="geometry"/>
</mxCell>
<mxCell id="64" value="工单&lt;br&gt;飞书/xx" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="60" y="1280" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="69" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="65" target="64">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="70" value="申请人" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="69">
<mxGeometry x="-0.0185" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="65" value="自动发起流程审批" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="270" y="1280" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="68" style="edgeStyle=none;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="66" target="65">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="66" value="业务功能" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
<mxGeometry x="470" y="1280" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="67" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="500" y="1180" width="30" height="60" as="geometry"/>
</mxCell>
<mxCell id="72" style="edgeStyle=none;html=1;exitX=1;exitY=0.3333333333333333;exitDx=0;exitDy=0;exitPerimeter=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="71" target="64">
<mxGeometry relative="1" as="geometry"/>
</mxCell>
<mxCell id="73" value="直接" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="72">
<mxGeometry x="-0.1117" y="-3" relative="1" as="geometry">
<mxPoint as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="71" value="Actor" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" vertex="1" parent="1">
<mxGeometry x="20" y="1180" width="30" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>

8
vblog/utils/page.go Normal file
View File

@ -0,0 +1,8 @@
package utils
type PageRequest struct {
// 分页大小
PageSize uint `json:"page_size"`
// 当前是多少页面
PageNumber uint `json:"page_number"`
}

View File

@ -7,6 +7,8 @@ type ResourceMeta struct {
Id uint `json:"id" gorm:"primaryKey;column:id"`
// 创建时间
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null"`
// 用户名称
CreateBy string `json:"create_by" gorm:"column:create_by;type:varchar(100)"`
// 更新时间
UpdatedAt *time.Time `json:"updated_at" gorm:"column:updated_at"`
}