fix user info
This commit is contained in:
parent
b3ba9c2301
commit
fe3562325f
@ -16,7 +16,7 @@ import (
|
|||||||
//
|
//
|
||||||
// POST /script-policy
|
// POST /script-policy
|
||||||
func (svc *Service) CreateScriptPolicy(ctx context.Context, req *api.ScriptPolicyCreate) (*api.ID, error){
|
func (svc *Service) CreateScriptPolicy(ctx context.Context, req *api.ScriptPolicyCreate) (*api.ID, error){
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ func (svc *Service) CreateScriptPolicy(ctx context.Context, req *api.ScriptPolic
|
|||||||
//
|
//
|
||||||
// DELETE /script-policy/id/{ScriptPolicyID}
|
// DELETE /script-policy/id/{ScriptPolicyID}
|
||||||
func (svc *Service) DeleteScriptPolicy(ctx context.Context, params api.DeleteScriptPolicyParams) error{
|
func (svc *Service) DeleteScriptPolicy(ctx context.Context, params api.DeleteScriptPolicyParams) error{
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ func (svc *Service) DeleteScriptPolicy(ctx context.Context, params api.DeleteScr
|
|||||||
//
|
//
|
||||||
// GET /script-policy/id/{ScriptPolicyID}
|
// GET /script-policy/id/{ScriptPolicyID}
|
||||||
func (svc *Service) GetScriptPolicy(ctx context.Context, params api.GetScriptPolicyParams) (*api.ScriptPolicy, error){
|
func (svc *Service) GetScriptPolicy(ctx context.Context, params api.GetScriptPolicyParams) (*api.ScriptPolicy, error){
|
||||||
_, ok := ctx.Value("UserInfo").(*UserInfo)
|
_, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ func (svc *Service) GetScriptPolicy(ctx context.Context, params api.GetScriptPol
|
|||||||
//
|
//
|
||||||
// GET /script-policy/hash/{FromScriptHash}
|
// GET /script-policy/hash/{FromScriptHash}
|
||||||
func (svc *Service) GetScriptPolicyFromHash(ctx context.Context, params api.GetScriptPolicyFromHashParams) (*api.ScriptPolicy, error){
|
func (svc *Service) GetScriptPolicyFromHash(ctx context.Context, params api.GetScriptPolicyFromHashParams) (*api.ScriptPolicy, error){
|
||||||
_, ok := ctx.Value("UserInfo").(*UserInfo)
|
_, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ func (svc *Service) GetScriptPolicyFromHash(ctx context.Context, params api.GetS
|
|||||||
//
|
//
|
||||||
// PATCH /script-policy/id/{ScriptPolicyID}
|
// PATCH /script-policy/id/{ScriptPolicyID}
|
||||||
func (svc *Service) UpdateScriptPolicy(ctx context.Context, req *api.ScriptPolicyUpdate, params api.UpdateScriptPolicyParams) error{
|
func (svc *Service) UpdateScriptPolicy(ctx context.Context, req *api.ScriptPolicyUpdate, params api.UpdateScriptPolicyParams) error{
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
//
|
//
|
||||||
// POST /scripts
|
// POST /scripts
|
||||||
func (svc *Service) CreateScript(ctx context.Context, req *api.ScriptCreate) (*api.ID, error){
|
func (svc *Service) CreateScript(ctx context.Context, req *api.ScriptCreate) (*api.ID, error){
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ func (svc *Service) CreateScript(ctx context.Context, req *api.ScriptCreate) (*a
|
|||||||
//
|
//
|
||||||
// DELETE /scripts/{ScriptID}
|
// DELETE /scripts/{ScriptID}
|
||||||
func (svc *Service) DeleteScript(ctx context.Context, params api.DeleteScriptParams) error{
|
func (svc *Service) DeleteScript(ctx context.Context, params api.DeleteScriptParams) error{
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@ func (svc *Service) DeleteScript(ctx context.Context, params api.DeleteScriptPar
|
|||||||
//
|
//
|
||||||
// GET /scripts/{ScriptID}
|
// GET /scripts/{ScriptID}
|
||||||
func (svc *Service) GetScript(ctx context.Context, params api.GetScriptParams) (*api.Script, error){
|
func (svc *Service) GetScript(ctx context.Context, params api.GetScriptParams) (*api.Script, error){
|
||||||
_, ok := ctx.Value("UserInfo").(*UserInfo)
|
_, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ func (svc *Service) GetScript(ctx context.Context, params api.GetScriptParams) (
|
|||||||
//
|
//
|
||||||
// PATCH /scripts/{ScriptID}
|
// PATCH /scripts/{ScriptID}
|
||||||
func (svc *Service) UpdateScript(ctx context.Context, req *api.ScriptUpdate, params api.UpdateScriptParams) error{
|
func (svc *Service) UpdateScript(ctx context.Context, req *api.ScriptUpdate, params api.UpdateScriptParams) error{
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
|
|
||||||
// POST /submissions
|
// POST /submissions
|
||||||
func (svc *Service) CreateSubmission(ctx context.Context, request *api.SubmissionCreate) (*api.ID, error) {
|
func (svc *Service) CreateSubmission(ctx context.Context, request *api.SubmissionCreate) (*api.ID, error) {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return nil, ErrUserInfo
|
return nil, ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ func (svc *Service) ListSubmissions(ctx context.Context, request api.ListSubmiss
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/completed
|
// PATCH /submissions/{SubmissionID}/completed
|
||||||
func (svc *Service) PatchSubmissionCompleted(ctx context.Context, params api.PatchSubmissionCompletedParams) error {
|
func (svc *Service) PatchSubmissionCompleted(ctx context.Context, params api.PatchSubmissionCompletedParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -137,7 +137,7 @@ func (svc *Service) PatchSubmissionCompleted(ctx context.Context, params api.Pat
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/model
|
// PATCH /submissions/{SubmissionID}/model
|
||||||
func (svc *Service) PatchSubmissionModel(ctx context.Context, params api.PatchSubmissionModelParams) error {
|
func (svc *Service) PatchSubmissionModel(ctx context.Context, params api.PatchSubmissionModelParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ func (svc *Service) PatchSubmissionModel(ctx context.Context, params api.PatchSu
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/publish
|
// PATCH /submissions/{SubmissionID}/status/publish
|
||||||
func (svc *Service) ActionSubmissionPublish(ctx context.Context, params api.ActionSubmissionPublishParams) error {
|
func (svc *Service) ActionSubmissionPublish(ctx context.Context, params api.ActionSubmissionPublishParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ func (svc *Service) ActionSubmissionPublish(ctx context.Context, params api.Acti
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/reject
|
// PATCH /submissions/{SubmissionID}/status/reject
|
||||||
func (svc *Service) ActionSubmissionReject(ctx context.Context, params api.ActionSubmissionRejectParams) error {
|
func (svc *Service) ActionSubmissionReject(ctx context.Context, params api.ActionSubmissionRejectParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ func (svc *Service) ActionSubmissionReject(ctx context.Context, params api.Actio
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/request-changes
|
// PATCH /submissions/{SubmissionID}/status/request-changes
|
||||||
func (svc *Service) ActionSubmissionRequestChanges(ctx context.Context, params api.ActionSubmissionRequestChangesParams) error {
|
func (svc *Service) ActionSubmissionRequestChanges(ctx context.Context, params api.ActionSubmissionRequestChangesParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -231,7 +231,7 @@ func (svc *Service) ActionSubmissionRequestChanges(ctx context.Context, params a
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/revoke
|
// PATCH /submissions/{SubmissionID}/status/revoke
|
||||||
func (svc *Service) ActionSubmissionRevoke(ctx context.Context, params api.ActionSubmissionRevokeParams) error {
|
func (svc *Service) ActionSubmissionRevoke(ctx context.Context, params api.ActionSubmissionRevokeParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -258,7 +258,7 @@ func (svc *Service) ActionSubmissionRevoke(ctx context.Context, params api.Actio
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/submit
|
// PATCH /submissions/{SubmissionID}/status/submit
|
||||||
func (svc *Service) ActionSubmissionSubmit(ctx context.Context, params api.ActionSubmissionSubmitParams) error {
|
func (svc *Service) ActionSubmissionSubmit(ctx context.Context, params api.ActionSubmissionSubmitParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -285,7 +285,7 @@ func (svc *Service) ActionSubmissionSubmit(ctx context.Context, params api.Actio
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/trigger-publish
|
// PATCH /submissions/{SubmissionID}/status/trigger-publish
|
||||||
func (svc *Service) ActionSubmissionTriggerPublish(ctx context.Context, params api.ActionSubmissionTriggerPublishParams) error {
|
func (svc *Service) ActionSubmissionTriggerPublish(ctx context.Context, params api.ActionSubmissionTriggerPublishParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ func (svc *Service) ActionSubmissionTriggerPublish(ctx context.Context, params a
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/trigger-validate
|
// PATCH /submissions/{SubmissionID}/status/trigger-validate
|
||||||
func (svc *Service) ActionSubmissionTriggerValidate(ctx context.Context, params api.ActionSubmissionTriggerValidateParams) error {
|
func (svc *Service) ActionSubmissionTriggerValidate(ctx context.Context, params api.ActionSubmissionTriggerValidateParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
@ -327,7 +327,7 @@ func (svc *Service) ActionSubmissionTriggerValidate(ctx context.Context, params
|
|||||||
//
|
//
|
||||||
// PATCH /submissions/{SubmissionID}/status/validate
|
// PATCH /submissions/{SubmissionID}/status/validate
|
||||||
func (svc *Service) ActionSubmissionValidate(ctx context.Context, params api.ActionSubmissionValidateParams) error {
|
func (svc *Service) ActionSubmissionValidate(ctx context.Context, params api.ActionSubmissionValidateParams) error {
|
||||||
userInfo, ok := ctx.Value("UserInfo").(*UserInfo)
|
userInfo, ok := ctx.Value("UserInfo").(UserInfo)
|
||||||
if !ok{
|
if !ok{
|
||||||
return ErrUserInfo
|
return ErrUserInfo
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user