|
|
@ -294,9 +294,9 @@ func RegisterMultiWorkCalendarLst(party router.Party, httpMethod string, path st |
|
|
|
* @Date : 2021-03-18 22:49:12 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterInsertWorkCalendarLst(party router.Party, path string, method func(*models.Usertab, *[]model.WorkCalendarLst) error) { |
|
|
|
func RegisterInsertWorkCalendarLst(party router.Party, path string, method func(*models.Usertab, *model.WorkCalendarLstInsertReq) error) { |
|
|
|
|
|
|
|
RegisterMultiWorkCalendarLst(party, "POST", path, method) |
|
|
|
RegisterMultiInsertWorkCalendarLst(party, "POST", path, method) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
@ -380,3 +380,47 @@ func RegisterUpdateWorkCalendarLst(party router.Party, path string, method func( |
|
|
|
|
|
|
|
RegisterMultiWorkCalendarLst(party, "PUT", path, method) |
|
|
|
} |
|
|
|
|
|
|
|
/****************************************************************************** |
|
|
|
* |
|
|
|
* @Function Name : RegisterMultiInsertWorkCalendarLst |
|
|
|
*----------------------------------------------------------------------------- |
|
|
|
* |
|
|
|
* @Description : 为一个处理插入多条WorkCalendarLst的方法注册路由 |
|
|
|
* |
|
|
|
* @Function Parameters : 路由分组 |
|
|
|
* |
|
|
|
* @Function Parameters : HTTP方法 |
|
|
|
* |
|
|
|
* @Function Parameters : 路径 |
|
|
|
* |
|
|
|
* @Function Parameters : 实际处理请求的方法 |
|
|
|
* |
|
|
|
* @Author : 张鑫 |
|
|
|
* |
|
|
|
* @Date : 2021-04-15 |
|
|
|
* |
|
|
|
******************************************************************************/ |
|
|
|
func RegisterMultiInsertWorkCalendarLst(party router.Party, httpMethod string, path string, method func(*models.Usertab, *model.WorkCalendarLstInsertReq) 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 entities model.WorkCalendarLstInsertReq |
|
|
|
err := ctx.ReadJSON(&entities) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
err = method(user, &entities) |
|
|
|
if err != nil { |
|
|
|
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil) |
|
|
|
return |
|
|
|
} |
|
|
|
supports.Ok(ctx, supports.OptionSuccess, nil) |
|
|
|
}) |
|
|
|
} |