Skip to content

Commit

Permalink
refactor: rename BaseInfo to BaseIDInfo
Browse files Browse the repository at this point in the history
chore: update tool version to v0.2.9-beta
  • Loading branch information
suyuan32 committed Mar 24, 2023
1 parent 61518c5 commit 33d48f6
Show file tree
Hide file tree
Showing 37 changed files with 70 additions and 75 deletions.
2 changes: 1 addition & 1 deletion api/desc/api.api
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import "base.api"
type (
// The API information | API信息
ApiInfo {
BaseInfo
BaseIDInfo

// Translated Name | 多语言名称
Trans string `json:"trans,optional"`
Expand Down
6 changes: 3 additions & 3 deletions api/desc/base.api
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ type UUIDsReq {
Ids []string `json:"ids"`
}

// The base response data | 基础信息
type BaseInfo {
// The base ID response data | 基础ID信息
type BaseIDInfo {
// ID
Id uint64 `json:"id"`

Expand All @@ -106,7 +106,7 @@ type BaseInfo {
UpdatedAt int64 `json:"updatedAt,optional"`
}

// The base UUID response data | 基础信息
// The base UUID response data | 基础UUID信息
type BaseUUIDInfo {
// ID
Id string `json:"id"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/department.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of department information | 部门信息
DepartmentInfo {
BaseInfo
BaseIDInfo

// Translated Name | 展示名称
Trans string `json:"trans,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/dictionary.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of dictionary information | 字典信息
DictionaryInfo {
BaseInfo
BaseIDInfo

// Translated Name | 字典多语言名称
Trans string `json:"trans,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/dictionary_detail.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of dictionary detail information | 字典键值信息
DictionaryDetailInfo {
BaseInfo
BaseIDInfo

// Status | 状态
Status uint32 `json:"status,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/menu.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of menu information | 菜单信息
MenuInfo {
BaseInfo
BaseIDInfo

// Translated Name | 国际化展示名称
Trans string `json:"trans,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/menu_param.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of menu param information | 菜单参数信息
MenuParamInfo {
BaseInfo
BaseIDInfo

// Type | 参数类型
Type string `json:"type,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/oauth_provider.api
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import(
type (
// The response data of oauth provider information | 第三方信息
OauthProviderInfo {
BaseInfo
BaseIDInfo

// Provider name | 第三方提供商名称
Name string `json:"name,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/position.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of position information | 职位信息
PositionInfo {
BaseInfo
BaseIDInfo

// Translated Name | 展示名称
Trans string `json:"trans,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/role.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of role information | 角色信息
RoleInfo {
BaseInfo
BaseIDInfo

// Translated Name | 展示名称
Trans string `json:"trans,optional"`
Expand Down
2 changes: 1 addition & 1 deletion api/desc/task.api
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "base.api"
type (
// The response data of task information | 定时任务信息
TaskInfo {
BaseInfo
BaseIDInfo

// Status | 状态
Status uint32 `json:"status,optional"`
Expand Down
8 changes: 4 additions & 4 deletions api/desc/user.api
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ type (
}

// The response data of user's basic information | 用户基本信息返回数据
UserBaseInfoResp {
UserBaseIDInfoResp {
BaseDataInfo

// The data of user's basic information | 用户基本信息
Data UserBaseInfo `json:"data"`
Data UserBaseIDInfo `json:"data"`
}

// The data of user's basic information | 用户基本信息
UserBaseInfo {
UserBaseIDInfo {
// User's UUID | 用户的UUID
UUID string `json:"userId"`

Expand Down Expand Up @@ -320,7 +320,7 @@ service core {

// Get user basic information | 获取用户基本信息
@handler getUserInfo
get /user/info returns (UserBaseInfoResp)
get /user/info returns (UserBaseIDInfoResp)

// Get user's permission code | 获取用户权限码
@handler getUserPermCode
Expand Down
2 changes: 1 addition & 1 deletion api/internal/handler/user/get_user_info_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// Get user basic information | 获取用户基本信息
//
// Responses:
// 200: UserBaseInfoResp
// 200: UserBaseIDInfoResp

func GetUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/api/get_api_by_id_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetApiByIdLogic) GetApiById(req *types.IDReq) (resp *types.ApiInfoResp,
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.ApiInfo{
BaseInfo: types.BaseInfo{Id: data.Id, CreatedAt: data.CreatedAt, UpdatedAt: data.UpdatedAt},
BaseIDInfo: types.BaseIDInfo{Id: data.Id, CreatedAt: data.CreatedAt, UpdatedAt: data.UpdatedAt},
Trans: l.svcCtx.Trans.Trans(l.ctx, data.Description),
Path: data.Path,
Description: data.Description,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/api/get_api_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (l *GetApiListLogic) GetApiList(req *types.ApiListReq) (resp *types.ApiList
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.ApiInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetDepartmentByIdLogic) GetDepartmentById(req *types.IDReq) (resp *type
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.DepartmentInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/department/get_department_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (l *GetDepartmentListLogic) GetDepartmentList(req *types.DepartmentListReq)
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.DepartmentInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetDictionaryByIdLogic) GetDictionaryById(req *types.IDReq) (resp *type
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.DictionaryInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/dictionary/get_dictionary_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (l *GetDictionaryListLogic) GetDictionaryList(req *types.DictionaryListReq)
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.DictionaryInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetDictionaryDetailByIdLogic) GetDictionaryDetailById(req *types.IDReq)
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.DictionaryDetailInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (l *GetDictionaryDetailListLogic) GetDictionaryDetailList(req *types.Dictio
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.DictionaryDetailInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/menu/get_menu_list_by_role_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (l *GetMenuListByRoleLogic) GetMenuListByRole() (resp *types.MenuListResp,
resp.Data.Total = data.Total
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data, types.MenuInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: 0,
UpdatedAt: 0,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/menuparam/get_menu_param_by_id_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetMenuParamByIdLogic) GetMenuParamById(req *types.IDReq) (resp *types.
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.MenuParamInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/menuparam/get_menu_param_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (l *GetMenuParamListLogic) GetMenuParamList(req *types.MenuParamListReq) (r
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.MenuParamInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetOauthProviderByIdLogic) GetOauthProviderById(req *types.IDReq) (resp
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.OauthProviderInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (l *GetOauthProviderListLogic) GetOauthProviderList(req *types.OauthProvide
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.OauthProviderInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/position/get_position_by_id_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetPositionByIdLogic) GetPositionById(req *types.IDReq) (resp *types.Po
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.PositionInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/position/get_position_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (l *GetPositionListLogic) GetPositionList(req *types.PositionListReq) (resp
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.PositionInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/role/get_role_by_id_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetRoleByIdLogic) GetRoleById(req *types.IDReq) (resp *types.RoleInfoRe
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.RoleInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/role/get_role_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (l *GetRoleListLogic) GetRoleList(req *types.RoleListReq) (resp *types.Role
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.RoleInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/task/get_task_by_id_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (l *GetTaskByIdLogic) GetTaskById(req *types.IDReq) (resp *types.TaskInfoRe
Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success),
},
Data: types.TaskInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: data.Id,
CreatedAt: data.CreatedAt,
UpdatedAt: data.UpdatedAt,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/task/get_task_list_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (l *GetTaskListLogic) GetTaskList(req *types.TaskListReq) (resp *types.Task
for _, v := range data.Data {
resp.Data.Data = append(resp.Data.Data,
types.TaskInfo{
BaseInfo: types.BaseInfo{
BaseIDInfo: types.BaseIDInfo{
Id: v.Id,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
Expand Down
6 changes: 3 additions & 3 deletions api/internal/logic/user/get_user_info_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUs
}
}

func (l *GetUserInfoLogic) GetUserInfo() (resp *types.UserBaseInfoResp, err error) {
func (l *GetUserInfoLogic) GetUserInfo() (resp *types.UserBaseIDInfoResp, err error) {
user, err := l.svcCtx.CoreRpc.GetUserById(l.ctx,
&core.UUIDReq{Id: l.ctx.Value("userId").(string)})
if err != nil {
return nil, err
}

return &types.UserBaseInfoResp{
return &types.UserBaseIDInfoResp{
BaseDataInfo: types.BaseDataInfo{Msg: l.svcCtx.Trans.Trans(l.ctx, i18n.Success)},
Data: types.UserBaseInfo{
Data: types.UserBaseIDInfo{
UUID: user.Id,
Username: user.Username,
Nickname: user.Nickname,
Expand Down
Loading

0 comments on commit 33d48f6

Please sign in to comment.