|
|
@ -362,3 +362,38 @@ func RegisterUpdateArticle(party router.Party, path string, method func(*models. |
|
|
|
|
|
|
|
RegisterMultiArticle(party, "PUT", path, method) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterSelectAllCarModel |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个查询所有的CarModel的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : zhangxin |
|
|
|
* |
|
|
|
* @Date : 2021-10-28 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterSelectAllCarModel(party router.Party, path string, method func(*models.Usertab) ([]string, error)) { |
|
|
|
|
|
|
|
party.Get(path, func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
result, err := method(user) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, result) |
|
|
|
}) |
|
|
|
} |