|
|
@ -390,3 +390,120 @@ func RegisterUpdateReclinerReclst(party router.Party, path string, method func(* |
|
|
|
|
|
|
|
RegisterMultiReclinerReclst(party, "PUT", path, method) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterInsertOneReclinerReclst |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个插入单条ReclinerReclst的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 代码生成器创建 |
|
|
|
* |
|
|
|
* @Date : 2021-07-12 14:05:20 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterInsertSeriOneReclinerReclst(party router.Party, path string, method func(*global.User, *model.ReclinerReclst) error) { |
|
|
|
|
|
|
|
RegisterOneSeriReclinerReclst(party, "POST", path, method) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterOneSeriReclinerReclst |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个处理单条ReclinerReclst的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : HTTP方法 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 代码生成器创建 |
|
|
|
* |
|
|
|
* @Date : 2021-07-12 14:05:20 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterOneSeriReclinerReclst(party router.Party, httpMethod string, path string, method func(*global.User, *model.ReclinerReclst) error) { |
|
|
|
|
|
|
|
party.Handle(httpMethod, path, func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var err error = nil |
|
|
|
|
|
|
|
entity := new(model.ReclinerReclst) |
|
|
|
if ctx.GetContentLength() > 0 { |
|
|
|
err := ctx.ReadJSON(entity) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
entity = nil |
|
|
|
} |
|
|
|
|
|
|
|
err = method(user, entity) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, nil) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterSelectSeriOneReclinerReclst |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个查找单条ReclinerReclst的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 代码生成器创建 |
|
|
|
* |
|
|
|
* @Date : 2021-07-12 14:05:20 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterSelectSeriOneReclinerReclst(party router.Party, path string, method func(*global.User, string) (*model.ReclinerReclst, error)) { |
|
|
|
|
|
|
|
party.Get(path+"/{orderId:string}", func(ctx iris.Context) { |
|
|
|
user, ok := jwts.ParseToken(ctx) |
|
|
|
if !ok { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
orderId := ctx.Params().GetString("orderId") |
|
|
|
result, err := method(user, orderId) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
if result == nil { |
|
|
|
supports.Error(ctx, iris.StatusNotFound, supports.NotFound, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, result) |
|
|
|
}) |
|
|
|
} |