factroy store
This commit is contained in:
@@ -35,7 +35,10 @@ func (l *GroupInfoLogic) GroupInfo(in *factory.IdRequest) (*factory.Response, er
|
||||
if fail := l.checkParams(in, &v); fail != nil {
|
||||
return fail, nil
|
||||
}
|
||||
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
var info dao.GroupInfo
|
||||
modelObj := model.GroupModel{}.Init()
|
||||
w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}}
|
||||
|
||||
@@ -28,6 +28,10 @@ func NewGroupNamesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GroupN
|
||||
}
|
||||
|
||||
func (l *GroupNamesLogic) GroupNames(in *factory.EmptyRequest) (*factory.Response, error) {
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
w := modelbase.Params{Eq: map[string]string{"id": utils.StringStatusOk}}
|
||||
var names []dao.GroupName
|
||||
err := model.GroupModel{}.Init().Items(w, &names)
|
||||
|
||||
@@ -35,7 +35,10 @@ func (l *PostInfoLogic) PostInfo(in *factory.IdRequest) (*factory.Response, erro
|
||||
if fail := l.checkParams(in, &v); fail != nil {
|
||||
return fail, nil
|
||||
}
|
||||
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
var info dao.PostInfo
|
||||
modelObj := model.PostModel{}.Init()
|
||||
w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}}
|
||||
|
||||
@@ -29,6 +29,10 @@ func NewPostNamesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PostNam
|
||||
}
|
||||
|
||||
func (l *PostNamesLogic) PostNames(in *factory.EmptyRequest) (*factory.Response, error) {
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
w := modelbase.Params{Eq: map[string]string{"status": utils.StringStatusOk}}
|
||||
var names []dao.PostName
|
||||
err := model.PostModel{}.Init().Items(w, &names)
|
||||
|
||||
@@ -35,7 +35,10 @@ func (l *WorkerInfoLogic) WorkerInfo(in *factory.IdRequest) (*factory.Response,
|
||||
if fail := l.checkParams(in, &v); fail != nil {
|
||||
return fail, nil
|
||||
}
|
||||
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
var info dao.WorkerInfo
|
||||
modelObj := model.WorkerModel{}.Init()
|
||||
w := modelbase.Params{Eq: map[string]string{"id": strconv.Itoa(int(in.Id))}}
|
||||
|
||||
@@ -29,6 +29,10 @@ func NewWorkerNamesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Worke
|
||||
}
|
||||
|
||||
func (l *WorkerNamesLogic) WorkerNames(in *factory.EmptyRequest) (*factory.Response, error) {
|
||||
adminInfo := utils.GetUserFromCtx(l.ctx)
|
||||
if adminInfo.ID < utils.NumberOne {
|
||||
return l.fail(utils.ErrorNoLoginInfo)
|
||||
}
|
||||
w := modelbase.Params{Eq: map[string]string{"status": utils.StringStatusOk}}
|
||||
var names []dao.WorkerName
|
||||
err := model.WorkerModel{}.Init().Items(w, &names)
|
||||
|
||||
Reference in New Issue
Block a user