promote
This commit is contained in:
34
app/main/api/desc/admin/auth.api
Normal file
34
app/main/api/desc/admin/auth.api
Normal file
@@ -0,0 +1,34 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "认证中心服务"
|
||||
desc: "认证中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/auth
|
||||
group: admin_auth
|
||||
)
|
||||
service main {
|
||||
@doc "登录"
|
||||
@handler AdminLogin
|
||||
post /login (AdminLoginReq) returns (AdminLoginResp)
|
||||
|
||||
}
|
||||
|
||||
type (
|
||||
AdminLoginReq {
|
||||
Username string `json:"username" validate:"required"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
Captcha bool `json:"captcha" validate:"required"`
|
||||
}
|
||||
AdminLoginResp {
|
||||
AccessToken string `json:"access_token"`
|
||||
AccessExpire int64 `json:"access_expire"`
|
||||
RefreshAfter int64 `json:"refresh_after"`
|
||||
Roles []string `json:"roles"`
|
||||
}
|
||||
)
|
||||
149
app/main/api/desc/admin/menu.api
Normal file
149
app/main/api/desc/admin/menu.api
Normal file
@@ -0,0 +1,149 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "菜单中心服务"
|
||||
desc: "菜单中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/menu
|
||||
group: admin_menu
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取菜单列表"
|
||||
@handler GetMenuList
|
||||
get /list (GetMenuListReq) returns ([]MenuListItem)
|
||||
|
||||
@doc "获取菜单详情"
|
||||
@handler GetMenuDetail
|
||||
get /detail/:id (GetMenuDetailReq) returns (GetMenuDetailResp)
|
||||
|
||||
@doc "创建菜单"
|
||||
@handler CreateMenu
|
||||
post /create (CreateMenuReq) returns (CreateMenuResp)
|
||||
|
||||
@doc "更新菜单"
|
||||
@handler UpdateMenu
|
||||
put /update/:id (UpdateMenuReq) returns (UpdateMenuResp)
|
||||
|
||||
@doc "删除菜单"
|
||||
@handler DeleteMenu
|
||||
delete /delete/:id (DeleteMenuReq) returns (DeleteMenuResp)
|
||||
|
||||
@doc "获取所有菜单(树形结构)"
|
||||
@handler GetMenuAll
|
||||
get /all (GetMenuAllReq) returns ([]GetMenuAllResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetMenuListReq {
|
||||
Name string `form:"name,optional"` // 菜单名称
|
||||
Path string `form:"path,optional"` // 路由路径
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
Type string `form:"type,optional"` // 类型
|
||||
}
|
||||
|
||||
// 列表项
|
||||
MenuListItem {
|
||||
Id int64 `json:"id"` // 菜单ID
|
||||
Pid int64 `json:"pid"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path"` // 路由路径
|
||||
Component string `json:"component"` // 组件路径
|
||||
Redirect string `json:"redirect"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
Children []MenuListItem `json:"children"` // 子菜单
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetMenuDetailReq {
|
||||
Id int64 `path:"id"` // 菜单ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetMenuDetailResp {
|
||||
Id int64 `json:"id"` // 菜单ID
|
||||
Pid int64 `json:"pid"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path"` // 路由路径
|
||||
Component string `json:"component"` // 组件路径
|
||||
Redirect string `json:"redirect"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"createTime"` // 创建时间
|
||||
UpdateTime string `json:"updateTime"` // 更新时间
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreateMenuReq {
|
||||
Pid int64 `json:"pid,optional"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path,optional"` // 路由路径
|
||||
Component string `json:"component,optional"` // 组件路径
|
||||
Redirect string `json:"redirect,optional"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status,optional,default=1"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort,optional"` // 排序
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreateMenuResp {
|
||||
Id int64 `json:"id"` // 菜单ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdateMenuReq {
|
||||
Id int64 `path:"id"` // 菜单ID
|
||||
Pid int64 `json:"pid,optional"` // 父菜单ID
|
||||
Name string `json:"name"` // 路由名称
|
||||
Path string `json:"path,optional"` // 路由路径
|
||||
Component string `json:"component,optional"` // 组件路径
|
||||
Redirect string `json:"redirect,optional"` // 重定向路径
|
||||
Meta map[string]interface{} `json:"meta"` // 路由元数据
|
||||
Status int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
Type string `json:"type"` // 类型
|
||||
Sort int64 `json:"sort,optional"` // 排序
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdateMenuResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeleteMenuReq {
|
||||
Id int64 `path:"id"` // 菜单ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeleteMenuResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 获取所有菜单请求
|
||||
GetMenuAllReq {
|
||||
}
|
||||
|
||||
// 获取所有菜单响应
|
||||
GetMenuAllResp {
|
||||
Name string `json:"name"`
|
||||
Path string `json:"path"`
|
||||
Redirect string `json:"redirect,omitempty"`
|
||||
Component string `json:"component,omitempty"`
|
||||
Sort int64 `json:"sort"`
|
||||
Meta map[string]interface{} `json:"meta"`
|
||||
Children []GetMenuAllResp `json:"children"`
|
||||
}
|
||||
)
|
||||
183
app/main/api/desc/admin/promotion.api
Normal file
183
app/main/api/desc/admin/promotion.api
Normal file
@@ -0,0 +1,183 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "推广服务"
|
||||
desc: "推广服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广链接列表"
|
||||
@handler GetPromotionLinkList
|
||||
get /list (GetPromotionLinkListReq) returns (GetPromotionLinkListResp)
|
||||
|
||||
@doc "获取推广链接详情"
|
||||
@handler GetPromotionLinkDetail
|
||||
get /detail/:id (GetPromotionLinkDetailReq) returns (GetPromotionLinkDetailResp)
|
||||
|
||||
@doc "创建推广链接"
|
||||
@handler CreatePromotionLink
|
||||
post /create (CreatePromotionLinkReq) returns (CreatePromotionLinkResp)
|
||||
|
||||
@doc "更新推广链接"
|
||||
@handler UpdatePromotionLink
|
||||
put /update/:id (UpdatePromotionLinkReq) returns (UpdatePromotionLinkResp)
|
||||
|
||||
@doc "删除推广链接"
|
||||
@handler DeletePromotionLink
|
||||
delete /delete/:id (DeletePromotionLinkReq) returns (DeletePromotionLinkResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetPromotionLinkListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Name string `form:"name,optional"` // 链接名称
|
||||
Url string `form:"url,optional"` // 推广链接URL
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
GetPromotionLinkListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []PromotionLinkItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
PromotionLinkItem {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetPromotionLinkDetailReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetPromotionLinkDetailResp {
|
||||
Name string `json:"name"` // 链接名称
|
||||
Url string `json:"url"` // 推广链接URL
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
PayAmount string `json:"pay_amount"` // 付费金额
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
LastClickTime string `json:"last_click_time,optional"` // 最后点击时间
|
||||
LastPayTime string `json:"last_pay_time,optional"` // 最后付费时间
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreatePromotionLinkReq {
|
||||
Name string `json:"name"` // 链接名称
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreatePromotionLinkResp {
|
||||
Id int64 `json:"id"` // 链接ID
|
||||
Url string `json:"url"` // 生成的推广链接URL
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdatePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
Name *string `json:"name,optional"` // 链接名称
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdatePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeletePromotionLinkReq {
|
||||
Id int64 `path:"id"` // 链接ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeletePromotionLinkResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/link
|
||||
group: admin_promotion
|
||||
)
|
||||
service main {
|
||||
@doc "记录链接点击"
|
||||
@handler RecordLinkClick
|
||||
get /record/:path (RecordLinkClickReq) returns (RecordLinkClickResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 记录链接点击请求
|
||||
RecordLinkClickReq {
|
||||
Path string `path:"path"` // 链接路径
|
||||
}
|
||||
|
||||
// 记录链接点击响应
|
||||
RecordLinkClickResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1/admin/promotion/stats
|
||||
group: admin_promotion
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取推广历史记录"
|
||||
@handler GetPromotionStatsHistory
|
||||
get /history (GetPromotionStatsHistoryReq) returns ([]PromotionStatsHistoryItem)
|
||||
|
||||
@doc "获取推广总统计"
|
||||
@handler GetPromotionStatsTotal
|
||||
get /total (GetPromotionStatsTotalReq) returns (GetPromotionStatsTotalResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 获取推广历史记录请求
|
||||
GetPromotionStatsHistoryReq {
|
||||
StartDate string `form:"start_date"` // 开始日期,格式:YYYY-MM-DD
|
||||
EndDate string `form:"end_date"` // 结束日期,格式:YYYY-MM-DD
|
||||
}
|
||||
|
||||
// 推广历史记录项
|
||||
PromotionStatsHistoryItem {
|
||||
Id int64 `json:"id"` // 记录ID
|
||||
LinkId int64 `json:"link_id"` // 链接ID
|
||||
PayAmount float64 `json:"pay_amount"` // 金额
|
||||
ClickCount int64 `json:"click_count"` // 点击数
|
||||
PayCount int64 `json:"pay_count"` // 付费次数
|
||||
StatsDate string `json:"stats_date"` // 统计日期
|
||||
}
|
||||
|
||||
// 获取推广总统计请求
|
||||
GetPromotionStatsTotalReq {
|
||||
}
|
||||
|
||||
// 获取推广总统计响应
|
||||
GetPromotionStatsTotalResp {
|
||||
TodayPayAmount float64 `json:"today_pay_amount"` // 今日金额
|
||||
TodayClickCount int64 `json:"today_click_count"` // 今日点击数
|
||||
TodayPayCount int64 `json:"today_pay_count"` // 今日付费次数
|
||||
TotalPayAmount float64 `json:"total_pay_amount"` // 总金额
|
||||
TotalClickCount int64 `json:"total_click_count"` // 总点击数
|
||||
TotalPayCount int64 `json:"total_pay_count"` // 总付费次数
|
||||
}
|
||||
)
|
||||
124
app/main/api/desc/admin/role.api
Normal file
124
app/main/api/desc/admin/role.api
Normal file
@@ -0,0 +1,124 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "角色服务"
|
||||
desc: "角色服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/role
|
||||
group: admin_role
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取角色列表"
|
||||
@handler GetRoleList
|
||||
get /list (GetRoleListReq) returns (GetRoleListResp)
|
||||
|
||||
@doc "获取角色详情"
|
||||
@handler GetRoleDetail
|
||||
get /detail/:id (GetRoleDetailReq) returns (GetRoleDetailResp)
|
||||
|
||||
@doc "创建角色"
|
||||
@handler CreateRole
|
||||
post /create (CreateRoleReq) returns (CreateRoleResp)
|
||||
|
||||
@doc "更新角色"
|
||||
@handler UpdateRole
|
||||
put /update/:id (UpdateRoleReq) returns (UpdateRoleResp)
|
||||
|
||||
@doc "删除角色"
|
||||
@handler DeleteRole
|
||||
delete /delete/:id (DeleteRoleReq) returns (DeleteRoleResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
GetRoleListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Name string `form:"name,optional"` // 角色名称
|
||||
Code string `form:"code,optional"` // 角色编码
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
GetRoleListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []RoleListItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
RoleListItem {
|
||||
Id int64 `json:"id"` // 角色ID
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
MenuIds []int64 `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
GetRoleDetailReq {
|
||||
Id int64 `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
GetRoleDetailResp {
|
||||
Id int64 `json:"id"` // 角色ID
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort"` // 排序
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
MenuIds []int64 `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
CreateRoleReq {
|
||||
RoleName string `json:"role_name"` // 角色名称
|
||||
RoleCode string `json:"role_code"` // 角色编码
|
||||
Description string `json:"description"` // 角色描述
|
||||
Status int64 `json:"status,default=1"` // 状态:0-禁用,1-启用
|
||||
Sort int64 `json:"sort,default=0"` // 排序
|
||||
MenuIds []int64 `json:"menu_ids"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
CreateRoleResp {
|
||||
Id int64 `json:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
UpdateRoleReq {
|
||||
Id int64 `path:"id"` // 角色ID
|
||||
RoleName *string `json:"role_name,optional"` // 角色名称
|
||||
RoleCode *string `json:"role_code,optional"` // 角色编码
|
||||
Description *string `json:"description,optional"` // 角色描述
|
||||
Status *int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
Sort *int64 `json:"sort,optional"` // 排序
|
||||
MenuIds []int64 `json:"menu_ids,optional"` // 关联的菜单ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
UpdateRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
DeleteRoleReq {
|
||||
Id int64 `path:"id"` // 角色ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
DeleteRoleResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
)
|
||||
131
app/main/api/desc/admin/user.api
Normal file
131
app/main/api/desc/admin/user.api
Normal file
@@ -0,0 +1,131 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "用户中心服务"
|
||||
desc: "用户中心服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: api/v1/admin/user
|
||||
group: admin_user
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@doc "获取用户列表"
|
||||
@handler AdminGetUserList
|
||||
get /list (AdminGetUserListReq) returns (AdminGetUserListResp)
|
||||
|
||||
@doc "获取用户详情"
|
||||
@handler AdminGetUserDetail
|
||||
get /detail/:id (AdminGetUserDetailReq) returns (AdminGetUserDetailResp)
|
||||
|
||||
@doc "创建用户"
|
||||
@handler AdminCreateUser
|
||||
post /create (AdminCreateUserReq) returns (AdminCreateUserResp)
|
||||
|
||||
@doc "更新用户"
|
||||
@handler AdminUpdateUser
|
||||
put /update/:id (AdminUpdateUserReq) returns (AdminUpdateUserResp)
|
||||
|
||||
@doc "删除用户"
|
||||
@handler AdminDeleteUser
|
||||
delete /delete/:id (AdminDeleteUserReq) returns (AdminDeleteUserResp)
|
||||
|
||||
@doc "用户信息"
|
||||
@handler AdminUserInfo
|
||||
get /info (AdminUserInfoReq) returns (AdminUserInfoResp)
|
||||
}
|
||||
|
||||
type (
|
||||
// 列表请求
|
||||
AdminGetUserListReq {
|
||||
Page int64 `form:"page,default=1"` // 页码
|
||||
PageSize int64 `form:"pageSize,default=20"` // 每页数量
|
||||
Username string `form:"username,optional"` // 用户名
|
||||
RealName string `form:"real_name,optional"` // 真实姓名
|
||||
Status int64 `form:"status,optional,default=-1"` // 状态:0-禁用,1-启用
|
||||
}
|
||||
|
||||
// 列表响应
|
||||
AdminGetUserListResp {
|
||||
Total int64 `json:"total"` // 总数
|
||||
Items []UserListItem `json:"items"` // 列表
|
||||
}
|
||||
|
||||
// 列表项
|
||||
UserListItem {
|
||||
Id int64 `json:"id"` // 用户ID
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
RoleIds []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 详情请求
|
||||
AdminGetUserDetailReq {
|
||||
Id int64 `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 详情响应
|
||||
AdminGetUserDetailResp {
|
||||
Id int64 `json:"id"` // 用户ID
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status"` // 状态:0-禁用,1-启用
|
||||
CreateTime string `json:"create_time"` // 创建时间
|
||||
UpdateTime string `json:"update_time"` // 更新时间
|
||||
RoleIds []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建请求
|
||||
AdminCreateUserReq {
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Status int64 `json:"status,default=1"` // 状态:0-禁用,1-启用
|
||||
RoleIds []int64 `json:"role_ids"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 创建响应
|
||||
AdminCreateUserResp {
|
||||
Id int64 `json:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 更新请求
|
||||
AdminUpdateUserReq {
|
||||
Id int64 `path:"id"` // 用户ID
|
||||
Username *string `json:"username,optional"` // 用户名
|
||||
RealName *string `json:"real_name,optional"` // 真实姓名
|
||||
Status *int64 `json:"status,optional"` // 状态:0-禁用,1-启用
|
||||
RoleIds []int64 `json:"role_ids,optional"` // 关联的角色ID列表
|
||||
}
|
||||
|
||||
// 更新响应
|
||||
AdminUpdateUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 删除请求
|
||||
AdminDeleteUserReq {
|
||||
Id int64 `path:"id"` // 用户ID
|
||||
}
|
||||
|
||||
// 删除响应
|
||||
AdminDeleteUserResp {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// 用户信息请求
|
||||
AdminUserInfoReq {
|
||||
}
|
||||
|
||||
// 用户信息响应
|
||||
AdminUserInfoResp {
|
||||
Username string `json:"username"` // 用户名
|
||||
RealName string `json:"real_name"` // 真实姓名
|
||||
Roles []string `json:"roles"` // 角色编码列表
|
||||
}
|
||||
)
|
||||
@@ -33,7 +33,6 @@ service main {
|
||||
prefix: api/v1
|
||||
group: pay
|
||||
jwt: JwtAuth
|
||||
middleware: SourceInterceptor
|
||||
)
|
||||
service main {
|
||||
// 支付
|
||||
|
||||
@@ -1,35 +1,33 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "产品服务"
|
||||
desc: "产品服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
title: "产品服务"
|
||||
desc: "产品服务"
|
||||
author: "Liangzai"
|
||||
email: "2440983361@qq.com"
|
||||
version: "v1"
|
||||
)
|
||||
import (
|
||||
"product/product.api"
|
||||
"product/product.api"
|
||||
)
|
||||
@server (
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
jwt: JwtAuth
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
jwt: JwtAuth
|
||||
)
|
||||
service main {
|
||||
@handler GetProductByID
|
||||
get /:id (GetProductByIDRequest) returns (ProductResponse)
|
||||
@handler GetProductByID
|
||||
get /:id (GetProductByIDRequest) returns (ProductResponse)
|
||||
|
||||
@handler GetProductByEn
|
||||
get /en/:product_en (GetProductByEnRequest) returns (ProductResponse)
|
||||
@handler GetProductByEn
|
||||
get /en/:product_en (GetProductByEnRequest) returns (ProductResponse)
|
||||
}
|
||||
|
||||
@server (
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
middleware: SourceInterceptor
|
||||
prefix: api/v1/product
|
||||
group: product
|
||||
)
|
||||
service main {
|
||||
@handler GetProductRenderList
|
||||
get /render_list/:module (GetProductRenderListRequest) returns (GetProductRenderListResponse)
|
||||
}
|
||||
|
||||
@handler GetProductRenderList
|
||||
get /render_list/:module (GetProductRenderListRequest) returns (GetProductRenderListResponse)
|
||||
}
|
||||
@@ -11,4 +11,9 @@ info (
|
||||
import "./front/user.api"
|
||||
import "./front/query.api"
|
||||
import "./front/pay.api"
|
||||
import "./front/product.api"
|
||||
import "./front/product.api"
|
||||
import "./admin/auth.api"
|
||||
import "./admin/user.api"
|
||||
import "./admin/menu.api"
|
||||
import "./admin/role.api"
|
||||
import "./admin/promotion.api"
|
||||
|
||||
Reference in New Issue
Block a user