feat:完善信息,增加需求指派功能

This commit is contained in:
henry
2022-01-24 15:35:43 +08:00
parent 295ca23dcc
commit 1c0d9dfb6b
12 changed files with 184 additions and 68 deletions

View File

@ -291,6 +291,19 @@ func (*Manage) Agent(c *gin.Context) {
api.APIResponse(err, data)(c)
}
func (*Manage) AgentSelect(c *gin.Context) {
form := &struct {
api.TenantIDStringForm
Keyword string `json:"keyword" form:"keyword"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
data, err := manage.NewAgent()(api.GetSession()(c).(*session.Admin)).Select(form.Convert(), form.Keyword)
api.APIResponse(err, data)(c)
}
func (*Manage) AgentDetail(c *gin.Context) {
form := new(api.IDStringForm)

View File

@ -355,6 +355,19 @@ func (*Technology) DemandDelete(c *gin.Context) {
api.APIResponse(err)(c)
}
func (*Technology) DemandAssign(c *gin.Context) {
form := &struct {
api.IDStringForm
AgentID string `json:"agent_id" form:"agent_id" binding:"required"`
}{}
if err := api.Bind(form)(c); err != nil {
api.APIFailure(err.(error))(c)
return
}
err := technology.NewDemand()(api.GetSession()(c).(*session.Admin)).Assign(form.Convert(), (&api.IDStringForm{ID: form.AgentID}).Convert())
api.APIResponse(err)(c)
}
func (*Technology) Project(c *gin.Context) {
form := &struct {
api.TenantIDStringForm