...
|
...
|
@@ -5,6 +5,7 @@ import ( |
|
|
"github.com/linmadan/egglib-go/web/beego"
|
|
|
service "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_template"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_template/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -59,6 +60,7 @@ func (controller *TemplateController) RemoveTemplate() { |
|
|
func (controller *TemplateController) ListTemplate() {
|
|
|
ruService := service.NewEvaluationTemplateService()
|
|
|
in := &command.QueryTemplateCommand{}
|
|
|
in.State = -1
|
|
|
if err := controller.Unmarshal(in); err != nil {
|
|
|
controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error()))
|
|
|
} else {
|
...
|
...
|
@@ -72,12 +74,15 @@ func (controller *TemplateController) ListTemplate() { |
|
|
|
|
|
func (controller *TemplateController) ListEnableTemplate() {
|
|
|
ruService := service.NewEvaluationTemplateService()
|
|
|
in := &command.AllEnableTemplateCommand{}
|
|
|
in := &command.QueryTemplateCommand{}
|
|
|
in.State = domain.TemplateStateEnable
|
|
|
in.PageNumber = 1
|
|
|
in.PageSize = 999999
|
|
|
if err := controller.Unmarshal(in); err != nil {
|
|
|
controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error()))
|
|
|
} else {
|
|
|
in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
|
|
|
controller.Response(ruService.ListForEnable(in))
|
|
|
controller.Response(ruService.List(in))
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -87,6 +92,7 @@ func (controller *TemplateController) StateTemplate() { |
|
|
if err := controller.Unmarshal(in); err != nil {
|
|
|
controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error()))
|
|
|
} else {
|
|
|
in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
|
|
|
controller.Response(ruService.State(in))
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -97,6 +103,8 @@ func (controller *TemplateController) CopyTemplate() { |
|
|
if err := controller.Unmarshal(in); err != nil {
|
|
|
controller.Response(nil, application.ThrowError(application.ARG_ERROR, err.Error()))
|
|
|
} else {
|
|
|
in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
|
|
|
in.CreatorId = middlewares.GetUserId(controller.Ctx)
|
|
|
controller.Response(ruService.Copy(in))
|
|
|
}
|
|
|
} |
...
|
...
|
|