|
|
@ -452,4 +452,47 @@ func RegisterRepairError(party router.Party, path string, method func(*global.Us |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, nil) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterRepairAllError |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 修复所有错误 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 张鑫 |
|
|
|
* |
|
|
|
* @Date : 2022-02-09 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterRepairAllError(party router.Party, path string, method func(*global.User, string) error) { |
|
|
|
|
|
|
|
party.Post(path, func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
return |
|
|
|
} |
|
|
|
type Req struct { |
|
|
|
CallOffId string `json:"calloffId"` |
|
|
|
} |
|
|
|
var data Req |
|
|
|
if err := ctx.ReadJSON(&data); err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err := method(user, data.CallOffId) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, nil) |
|
|
|
}) |
|
|
|
} |