feat:完善项目信息
This commit is contained in:
@ -9,6 +9,39 @@ import (
|
||||
|
||||
type Sys struct{}
|
||||
|
||||
func (*Sys) Industry(c *gin.Context) {
|
||||
data, err := sys.NewIndustry()(api.GetSession()(c).(*session.Admin)).Instance()
|
||||
api.APIResponse(err, data)(c)
|
||||
}
|
||||
|
||||
func (*Sys) IndustryForm(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
ParentID string `json:"parent_id" form:"parent_id"`
|
||||
Name string `json:"name" form:"name"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := sys.NewIndustry()(api.GetSession()(c).(*session.Admin)).Form(&sys.IndustryParams{
|
||||
ID: form.IDStringForm.Convert(), PatentID: (&api.IDStringForm{ID: form.ParentID}).Convert(),
|
||||
Name: form.Name,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Sys) IndustryDelete(c *gin.Context) {
|
||||
form := new(api.IDStringForm)
|
||||
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
return
|
||||
}
|
||||
err := sys.NewIndustry()(api.GetSession()(c).(*session.Admin)).Delete(form.Convert())
|
||||
api.APIResponse(err)(c)
|
||||
}
|
||||
|
||||
func (*Sys) Navigation(c *gin.Context) {
|
||||
form := new(api.TenantIDStringForm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user