Skip to content

Commit

Permalink
fix: CreateAt,UpdateAt,DeleteAt 命名不统一 #29
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed Oct 26, 2022
1 parent e280563 commit befa6b6
Show file tree
Hide file tree
Showing 42 changed files with 685 additions and 678 deletions.
4 changes: 2 additions & 2 deletions api/api_desc/apis.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
// ID
Id uint64 `json:"id"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

// API path | API路径
Path string `json:"path"`
Expand All @@ -41,7 +41,7 @@ type (

// Create date | 创建日期
// Required: true
CreateAt int64 `json:"createAt" validate:"number"`
CreatedAt int64 `json:"createdAt" validate:"number"`

// API path | API路径
// Required: true
Expand Down
4 changes: 2 additions & 2 deletions api/api_desc/dictionary.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
// ID
Id uint64 `json:"id"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

// Dictionary title | 字典显示名称
Title string `json:"title"`
Expand Down Expand Up @@ -94,7 +94,7 @@ type (
// ID
Id uint64 `json:"id"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

// Dictionary title | 字典显示名称
Title string `json:"title"`
Expand Down
4 changes: 2 additions & 2 deletions api/api_desc/oauth.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
// ID
Id uint64 `json:"id"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

// Provider name | 提供商名字
Name string `json:"name"`
Expand Down Expand Up @@ -57,7 +57,7 @@ type (

// Create date | 创建日期
// Required: true
CreateAt int64 `json:"createAt" validate:"number"`
CreatedAt int64 `json:"createdAt" validate:"number"`

// Provider name | 提供商名字
// Required: true
Expand Down
2 changes: 1 addition & 1 deletion api/api_desc/role.api
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type (

// Create time | 创建日期
// Required: true
CreateAt int64 `json:"createAt" validate:"number"`
CreatedAt int64 `json:"createdAt" validate:"number"`
}

// The response data of role list | 角色列表数据
Expand Down
4 changes: 2 additions & 2 deletions api/api_desc/token.api
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type (
// ID
Id uint64 `json:"id"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

// User's UUID | 用户的UUID
UUID string `json:"UUID"`
Expand All @@ -44,7 +44,7 @@ type (

// Create date | 创建日期
// Required: true
CreateAt int64 `json:"createAt" validate:"number"`
CreatedAt int64 `json:"createdAt" validate:"number"`

// User's UUID | 用户的UUID
// Required: true
Expand Down
4 changes: 2 additions & 2 deletions api/api_desc/user.api
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ type (
// 1 normal, 2 ban | 1 正常 2 拉黑
Status int32 `json:"status"`

CreateAt int64 `json:"createAt"`
CreatedAt int64 `json:"createdAt"`

UpdateAt int64 `json:"updateAt"`
UpdatedAt int64 `json:"updatedAt"`
}

// The response data of user's basic information | 用户基本信息返回数据
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/api/createorupdateapilogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (l *CreateOrUpdateApiLogic) CreateOrUpdateApi(req *types.CreateOrUpdateApiR
data, err := l.svcCtx.CoreRpc.CreateOrUpdateApi(context.Background(),
&core.ApiInfo{
Id: req.Id,
CreateAt: req.CreateAt,
CreatedAt: req.CreatedAt,
Path: req.Path,
Description: req.Description,
Group: req.Group,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/api/getapilistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (l *GetApiListLogic) GetApiList(req *types.ApiListReq) (resp *types.ApiList
resp.Data = append(resp.Data,
types.ApiInfo{
Id: v.Id,
CreateAt: v.CreateAt,
CreatedAt: v.CreatedAt,
Path: v.Path,
Description: v.Description,
Group: v.Group,
Expand Down
13 changes: 7 additions & 6 deletions api/internal/logic/dictionary/getdetailbydictionarynamelogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dictionary

import (
"context"

"github.com/suyuan32/simple-admin-core/rpc/types/core"

"github.com/suyuan32/simple-admin-core/api/internal/svc"
Expand Down Expand Up @@ -35,12 +36,12 @@ func (l *GetDetailByDictionaryNameLogic) GetDetailByDictionaryName(req *types.Di
resp.Total = result.Total
for _, v := range result.Data {
resp.Data = append(resp.Data, types.DictionaryDetailInfo{
Id: v.Id,
CreateAt: v.CreateAt,
Title: v.Title,
Key: v.Key,
Value: v.Value,
Status: v.Status,
Id: v.Id,
CreatedAt: v.CreatedAt,
Title: v.Title,
Key: v.Key,
Value: v.Value,
Status: v.Status,
})
}

Expand Down
3 changes: 2 additions & 1 deletion api/internal/logic/dictionary/getdictionarylistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dictionary

import (
"context"

"github.com/suyuan32/simple-admin-core/rpc/types/core"

"github.com/suyuan32/simple-admin-core/api/internal/svc"
Expand Down Expand Up @@ -41,7 +42,7 @@ func (l *GetDictionaryListLogic) GetDictionaryList(req *types.DictionaryListReq)
for _, v := range result.Data {
resp.Data = append(resp.Data, types.DictionaryInfo{
Id: v.Id,
CreateAt: v.CreateAt,
CreatedAt: v.CreatedAt,
Title: v.Title,
Name: v.Name,
Status: v.Status,
Expand Down
4 changes: 2 additions & 2 deletions api/internal/logic/menu/getmenulistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func convertMenuList(data []*core.MenuInfo) []*types.Menu {
tmp := &types.Menu{
BaseInfo: types.BaseInfo{
ID: uint(v.Id),
CreatedAt: v.CreateAt,
UpdatedAt: v.UpdateAt,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
},
MenuType: v.MenuType,
ParentId: uint(v.ParentId),
Expand Down
3 changes: 2 additions & 1 deletion api/internal/logic/menu/getmenuparamlistbymenuidlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package menu

import (
"context"

"github.com/suyuan32/simple-admin-core/rpc/types/core"

"github.com/suyuan32/simple-admin-core/api/internal/svc"
Expand Down Expand Up @@ -34,7 +35,7 @@ func (l *GetMenuParamListByMenuIdLogic) GetMenuParamListByMenuId(req *types.IDRe
resp.Total = result.Total
for _, v := range result.Data {
resp.Data = append(resp.Data, types.MenuParamResp{
BaseInfo: types.BaseInfo{ID: uint(v.Id), CreatedAt: v.CreateAt, UpdatedAt: v.UpdateAt},
BaseInfo: types.BaseInfo{ID: uint(v.Id), CreatedAt: v.CreatedAt, UpdatedAt: v.UpdatedAt},
MenuId: uint32(v.MenuId),
DataType: v.Type,
Key: v.Key,
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/oauth/createorupdateproviderlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (l *CreateOrUpdateProviderLogic) CreateOrUpdateProvider(req *types.CreateOr
TokenUrl: req.TokenURL,
AuthStyle: uint64(req.AuthStyle),
InfoUrl: req.InfoURL,
CreateAt: req.CreateAt,
CreatedAt: req.CreatedAt,
})
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion api/internal/logic/oauth/getproviderlistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (l *GetProviderListLogic) GetProviderList(req *types.PageInfo) (resp *types
resp.Data = append(resp.Data,
types.ProviderInfo{
Id: v.Id,
CreateAt: v.CreateAt,
CreatedAt: v.CreatedAt,
Name: v.Name,
ClientID: v.ClientId,
ClientSecret: v.ClientSecret,
Expand Down
14 changes: 7 additions & 7 deletions api/internal/logic/oauth/oauthcallbacklogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ func (l *OauthCallbackLogic) OauthCallback() (resp *types.CallbackResp, err erro
// add token into database
expireAt := time.Now().Add(time.Second * 259200).Unix()
_, err = l.svcCtx.CoreRpc.CreateOrUpdateToken(context.Background(), &core.TokenInfo{
Id: 0,
CreateAt: 0,
UUID: result.Id,
Token: token,
Source: strings.Split(l.r.FormValue("state"), "-")[1],
Status: 1,
ExpireAt: expireAt,
Id: 0,
CreatedAt: 0,
UUID: result.Id,
Token: token,
Source: strings.Split(l.r.FormValue("state"), "-")[1],
Status: 1,
ExpireAt: expireAt,
})

if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions api/internal/logic/role/getrolelistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package role

import (
"context"

"github.com/suyuan32/simple-admin-core/rpc/types/core"

"github.com/zeromicro/go-zero/core/logx"

"github.com/suyuan32/simple-admin-core/api/internal/svc"
"github.com/suyuan32/simple-admin-core/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)

type GetRoleListLogic struct {
Expand Down Expand Up @@ -42,7 +44,7 @@ func (l *GetRoleListLogic) GetRoleList(req *types.PageInfo) (resp *types.RoleLis
Status: v.Status,
Remark: v.Remark,
OrderNo: v.OrderNo,
CreateAt: v.CreateAt,
CreatedAt: v.CreatedAt,
})
}
return resp, nil
Expand Down
14 changes: 7 additions & 7 deletions api/internal/logic/token/createorupdatetokenlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ func NewCreateOrUpdateTokenLogic(ctx context.Context, svcCtx *svc.ServiceContext

func (l *CreateOrUpdateTokenLogic) CreateOrUpdateToken(req *types.CreateOrUpdateTokenReq) (resp *types.SimpleMsg, err error) {
result, err := l.svcCtx.CoreRpc.CreateOrUpdateToken(context.Background(), &core.TokenInfo{
Id: req.Id,
CreateAt: req.CreateAt,
UUID: req.UUID,
Token: req.Token,
Source: req.Source,
Status: req.Status,
ExpireAt: req.ExpireAt,
Id: req.Id,
CreatedAt: req.CreatedAt,
UUID: req.UUID,
Token: req.Token,
Source: req.Source,
Status: req.Status,
ExpireAt: req.ExpireAt,
})

if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions api/internal/logic/token/gettokenlistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ func (l *GetTokenListLogic) GetTokenList(req *types.TokenListReq) (resp *types.T

for _, v := range result.Data {
resp.Data = append(resp.Data, types.TokenInfo{
Id: v.Id,
CreateAt: v.CreateAt,
UUID: v.UUID,
Token: v.Token,
Source: v.Source,
Status: v.Status,
ExpireAt: v.ExpireAt,
Id: v.Id,
CreatedAt: v.CreatedAt,
UUID: v.UUID,
Token: v.Token,
Source: v.Source,
Status: v.Status,
ExpireAt: v.ExpireAt,
})
}

Expand Down
22 changes: 11 additions & 11 deletions api/internal/logic/user/getuserlistlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ func (l *GetUserListLogic) GetUserList(req *types.GetUserListReq) (resp *types.U
var res []types.UserInfoResp
for _, v := range data.Data {
res = append(res, types.UserInfoResp{
Id: int64(v.Id),
Username: v.Username,
Nickname: v.Nickname,
Mobile: v.Mobile,
RoleId: v.RoleId,
Email: v.Email,
Avatar: v.Avatar,
Status: v.Status,
CreateAt: v.CreateAt,
UpdateAt: v.UpdateAt,
UUID: v.UUID,
Id: int64(v.Id),
Username: v.Username,
Nickname: v.Nickname,
Mobile: v.Mobile,
RoleId: v.RoleId,
Email: v.Email,
Avatar: v.Avatar,
Status: v.Status,
CreatedAt: v.CreatedAt,
UpdatedAt: v.UpdatedAt,
UUID: v.UUID,
})
}
resp = &types.UserListResp{}
Expand Down
14 changes: 7 additions & 7 deletions api/internal/logic/user/loginlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ func (l *LoginLogic) Login(req *types.LoginReq) (resp *types.LoginResp, err erro
// add token into database
expireAt := time.Now().Add(time.Second * 259200).Unix()
_, err = l.svcCtx.CoreRpc.CreateOrUpdateToken(context.Background(), &core.TokenInfo{
Id: 0,
CreateAt: 0,
UUID: user.Id,
Token: token,
Source: "core",
Status: 1,
ExpireAt: expireAt,
Id: 0,
CreatedAt: 0,
UUID: user.Id,
Token: token,
Source: "core",
Status: 1,
ExpireAt: expireAt,
})

if err != nil {
Expand Down
Loading

0 comments on commit befa6b6

Please sign in to comment.