feat:完善项目管理

This commit is contained in:
henry
2021-12-14 09:05:47 +08:00
parent 4e1f179af7
commit 3bb8f96d84
9 changed files with 312 additions and 4 deletions

View File

@ -235,3 +235,50 @@ func (*Manage) ResearchVisit(c *gin.Context) {
Visit(form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
func (*Manage) AgentCompany(c *gin.Context) {
form := &struct {
Name string `json:"name" form:"name"`
api.PageForm
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := manage.NewAgent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Company(form.Name, form.Page, form.PageSize)
api.APIResponse(err, data)(c)
}
func (*Manage) AgentCompanyAdd(c *gin.Context) {
form := &struct {
Name string `json:"name" form:"name"`
Industrys []string `json:"industrys" form:"industrys"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := manage.NewAgent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(0, form.Name, form.Industrys)
api.APIResponse(err)(c)
}
func (*Manage) AgentCompanyEdit(c *gin.Context) {
form := &struct {
api.IDStringForm
Name string `json:"name" form:"name"`
Industrys []string `json:"industrys" form:"industrys"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := manage.NewAgent()(api.GetSession()(c).(*session.Enterprise), api.GetLocal()(c).(string)).
Form(form.Convert(), form.Name, form.Industrys)
api.APIResponse(err)(c)
}
func (*Manage) AgentCompanyDelete(c *gin.Context) {
}