作者 郑周

添加模板拷贝

... ... @@ -85,7 +85,19 @@ func (controller *RuleController) ListRuleRelCreator() {
}
ua := middlewares.GetUser(controller.Ctx)
in.CompanyId = ua.CompanyId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
controller.Response(ruService.ListRelCreator(in))
}
}
func (controller *RuleController) ListCreator() {
ruService := service.NewEvaluationRuleService()
in := &command.QueryCreatorCommand{}
if err := controller.Unmarshal(in); err != nil {
controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error()))
} else {
ua := middlewares.GetUser(controller.Ctx)
in.CompanyId = ua.CompanyId
controller.Response(ruService.ListCreator(in))
}
}
... ...
... ... @@ -111,8 +111,6 @@ func (controller *TemplateController) CopyTemplate() {
ua := middlewares.GetUser(controller.Ctx)
in.CompanyId = ua.CompanyId
in.CreatorId = ua.UserId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
//in.CreatorId = middlewares.GetUserId(controller.Ctx)
controller.Response(ruService.Copy(in))
}
}
... ...
... ... @@ -15,6 +15,7 @@ func init() {
web.NSRouter("/", &controllers.RuleController{}, "Delete:RemoveRule"),
web.NSRouter("/:Id", &controllers.RuleController{}, "Get:GetRule"),
web.NSRouter("/list", &controllers.RuleController{}, "Post:ListRuleRelCreator"),
web.NSRouter("/list-creator", &controllers.RuleController{}, "Post:ListCreator"),
)
web.AddNamespace(ns)
}
... ...
... ... @@ -16,6 +16,7 @@ func init() {
web.NSRouter("/:Id", &controllers.TemplateController{}, "Get:GetTemplate"),
web.NSRouter("/list", &controllers.TemplateController{}, "Post:ListTemplate"),
web.NSRouter("/list-enable", &controllers.TemplateController{}, "Post:ListEnableTemplate"),
web.NSRouter("/copy", &controllers.TemplateController{}, "Post:CopyTemplate"),
)
web.AddNamespace(ns)
}
... ...