签入脚本
This commit is contained in:
+155
@@ -0,0 +1,155 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/util/gmeta"
|
||||
)
|
||||
|
||||
// ============================== 城市模块 ==============================
|
||||
|
||||
// CityItem 城市行数据
|
||||
// 用于分页列表、下拉列表等场景的城市基础信息
|
||||
type CityItem struct {
|
||||
Id int64 `json:"id"` // 主键ID
|
||||
CityCode string `json:"cityCode"` // 城市编码
|
||||
AreaCode string `json:"areaCode"` // 区域编码
|
||||
ParentCode string `json:"parentCode"` // 父级编码
|
||||
ZipCode string `json:"zipCode"` // 邮政编码
|
||||
Level int `json:"level"` // 层级:1-省 2-市 3-区 4-街道
|
||||
LevelText string `json:"levelText"` // 层级文本
|
||||
Pid int64 `json:"pid"` // 父级ID
|
||||
Name string `json:"name"` // 城市名称
|
||||
ShortName string `json:"shortName"` // 城市简称
|
||||
FullName string `json:"fullName"` // 城市全称
|
||||
Pinyin string `json:"pinyin"` // 拼音
|
||||
Lng string `json:"lng"` // 经度
|
||||
Lat string `json:"lat"` // 纬度
|
||||
}
|
||||
|
||||
// CityPageReq 城市分页请求
|
||||
// 支持关键词、名称、拼音及层级等条件组合查询
|
||||
type CityPageReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/city/page" summary:"城市分页" permission:"sys:city:page" log:"城市管理-查询分页记录" logType:"query"`
|
||||
PageReq // 分页基础参数
|
||||
Keyword string `json:"keyword" dc:"关键词(名称/拼音模糊)"` // 关键词,名称或拼音模糊匹配
|
||||
Name string `json:"name" dc:"城市名称模糊"` // 城市名称模糊匹配
|
||||
Pinyin string `json:"pinyin" dc:"拼音模糊"` // 拼音模糊匹配
|
||||
Level int `json:"level" dc:"层级:1-省 2-市 3-区 4-街道"` // 层级
|
||||
}
|
||||
|
||||
// CityPageRes 城市分页结果
|
||||
type CityPageRes = PageData[CityItem]
|
||||
|
||||
// CityListReq 城市列表请求
|
||||
// 按父级编码、层级等条件查询,供级联选择场景使用
|
||||
type CityListReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/city/list" summary:"城市列表" permission:"sys:city:list" log:"城市管理-查询列表" logType:"query"`
|
||||
Keyword string `json:"keyword" dc:"关键词"` // 关键词
|
||||
Level int `json:"level" dc:"层级"` // 层级
|
||||
ParentCode string `json:"parentCode" dc:"父级编码(顶级为空)"` // 父级编码
|
||||
Limit int `json:"limit" dc:"条数上限"` // 条数上限
|
||||
}
|
||||
|
||||
// CityListRes 城市列表结果
|
||||
type CityListRes = []CityItem
|
||||
|
||||
// CityDetailReq 城市详情请求
|
||||
type CityDetailReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/city/detail/:id" summary:"城市详情" permission:"sys:city:detail" log:"城市管理-查询详情" logType:"query"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"城市ID"` // 城市ID
|
||||
}
|
||||
|
||||
// CityDetailRes 城市详情结果
|
||||
type CityDetailRes struct {
|
||||
CityItem
|
||||
ParentName string `json:"parentName" dc:"父级名称"` // 父级名称
|
||||
}
|
||||
|
||||
// CityAddReq 新增城市请求
|
||||
type CityAddReq struct {
|
||||
gmeta.Meta `method:"post" path:"/api/city/add" summary:"新增城市" permission:"sys:city:add" log:"城市管理-新增记录" logType:"add"`
|
||||
CityCode string `json:"cityCode" v:"required#请输入城市编码" dc:"城市编码"` // 城市编码
|
||||
AreaCode string `json:"areaCode" dc:"区域编码"` // 区域编码
|
||||
ParentCode string `json:"parentCode" dc:"父级编码"` // 父级编码
|
||||
ZipCode string `json:"zipCode" dc:"邮编"` // 邮政编码
|
||||
Level int `json:"level" dc:"层级"` // 层级
|
||||
Pid int64 `json:"pid" dc:"父级ID"` // 父级ID
|
||||
Name string `json:"name" v:"required#请输入名称" dc:"名称"` // 城市名称
|
||||
ShortName string `json:"shortName" dc:"简称"` // 城市简称
|
||||
FullName string `json:"fullName" dc:"全称"` // 城市全称
|
||||
Pinyin string `json:"pinyin" dc:"拼音"` // 拼音
|
||||
Lng string `json:"lng" dc:"经度"` // 经度
|
||||
Lat string `json:"lat" dc:"纬度"` // 纬度
|
||||
}
|
||||
|
||||
// CityUpdateReq 修改城市请求
|
||||
type CityUpdateReq struct {
|
||||
gmeta.Meta `method:"put" path:"/api/city/update" summary:"修改城市" permission:"sys:city:update" log:"城市管理-修改记录" logType:"update"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"城市ID"` // 城市ID
|
||||
CityCode string `json:"cityCode" dc:"城市编码"` // 城市编码
|
||||
AreaCode string `json:"areaCode" dc:"区域编码"` // 区域编码
|
||||
ParentCode string `json:"parentCode" dc:"父级编码"` // 父级编码
|
||||
ZipCode string `json:"zipCode" dc:"邮编"` // 邮政编码
|
||||
Level int `json:"level" dc:"层级"` // 层级
|
||||
Pid int64 `json:"pid" dc:"父级ID"` // 父级ID
|
||||
Name string `json:"name" dc:"名称"` // 城市名称
|
||||
ShortName string `json:"shortName" dc:"简称"` // 城市简称
|
||||
FullName string `json:"fullName" dc:"全称"` // 城市全称
|
||||
Pinyin string `json:"pinyin" dc:"拼音"` // 拼音
|
||||
Lng string `json:"lng" dc:"经度"` // 经度
|
||||
Lat string `json:"lat" dc:"纬度"` // 纬度
|
||||
}
|
||||
|
||||
// CityUpdateRes 修改城市结果
|
||||
type CityUpdateRes struct{}
|
||||
|
||||
// CityDeleteReq 删除城市请求
|
||||
type CityDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/city/delete/:id" summary:"删除城市" permission:"sys:city:delete" log:"城市管理-删除记录" logType:"delete"`
|
||||
Id int64 `json:"id" v:"required#缺少ID" dc:"城市ID"` // 城市ID
|
||||
}
|
||||
|
||||
// CityDeleteRes 删除城市结果
|
||||
type CityDeleteRes struct{}
|
||||
|
||||
// CityBatchDeleteReq 批量删除城市请求
|
||||
type CityBatchDeleteReq struct {
|
||||
gmeta.Meta `method:"delete" path:"/api/city/batchDelete" summary:"批量删除城市" permission:"sys:city:batchDelete" log:"城市管理-批量删除记录" logType:"delete"`
|
||||
Ids []int64 `json:"ids" v:"required#请选择要删除的记录" dc:"城市ID列表"` // 城市ID列表
|
||||
}
|
||||
|
||||
// CityBatchDeleteRes 批量删除结果
|
||||
type CityBatchDeleteRes struct{}
|
||||
|
||||
// CityByParentReq 按父编码查询下级城市请求
|
||||
// 登录用户即可访问,用于查询指定父级下的直属下级城市
|
||||
type CityByParentReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/area/findByParentCode" summary:"按父编码查询城市" log:"城市查询-查询下级城市" logType:"query"`
|
||||
ParentCode string `json:"parentCode" v:"required#请输入父级编码" dc:"父级编码"` // 父级编码
|
||||
}
|
||||
|
||||
// CityByParentRes 按父编码查询结果
|
||||
type CityByParentRes struct {
|
||||
List []CityItem `json:"list"` // 城市列表
|
||||
}
|
||||
|
||||
// AreaParentReq 省份列表请求
|
||||
// 登录用户即可访问,用于查询顶级省份列表
|
||||
type AreaParentReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/area/getParent" summary:"查询省份列表" log:"城市查询-查询省份列表" logType:"query"`
|
||||
}
|
||||
|
||||
// AreaParentRes 省份列表结果
|
||||
type AreaParentRes struct {
|
||||
List []CityItem `json:"list"` // 省份列表
|
||||
}
|
||||
|
||||
// CityGetListReq 按父编码获取下级城市请求
|
||||
// 登录用户即可访问,用于级联选择器懒加载下级城市
|
||||
type CityGetListReq struct {
|
||||
gmeta.Meta `method:"get" path:"/api/city/getCityList/:parentCode" summary:"按父编码获取城市列表" log:"城市查询-查询城市列表" logType:"query"`
|
||||
ParentCode string `json:"parentCode" v:"required#缺少父级编码" dc:"父级行政编码(顶级为0)"` // 父级行政编码,顶级为0
|
||||
}
|
||||
|
||||
// CityGetListRes 城市列表结果
|
||||
// data 直接为数组
|
||||
type CityGetListRes = []CityItem
|
||||
Reference in New Issue
Block a user