feat:完善信息
This commit is contained in:
@ -16,6 +16,7 @@ type (
|
||||
tenantForm struct {
|
||||
Name string `json:"name" form:"name" binding:"required"` // 名称
|
||||
Domain string `json:"domain" form:"domain" binding:"required"` // 域名
|
||||
IP string `json:"ip" form:"ip" binding:"required"` // IP
|
||||
Contact string `json:"contact" form:"contact" binding:"required"` // 联系人
|
||||
ContactMobile string `json:"contact_mobile" form:"contact_mobile" binding:"required"` // 联系方式
|
||||
Province string `json:"province" form:"province" binding:"required"` // 省
|
||||
@ -52,7 +53,7 @@ func (a *Tenant) Form(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
err := tenant.NewInstance()(api.GetSession()(c).(*session.Admin)).Form(&tenant.InstanceParams{ID: form.Convert(),
|
||||
Name: form.Name, Domain: form.Domain, Contact: form.Contact, ContactMobile: form.ContactMobile,
|
||||
Name: form.Name, Domain: form.Domain, IP: form.IP, Contact: form.Contact, ContactMobile: form.ContactMobile,
|
||||
Area: config.Area{Province: form.Province, City: form.City}, Remark: form.Remark,
|
||||
})
|
||||
api.APIResponse(err)(c)
|
||||
|
@ -38,10 +38,10 @@ type (
|
||||
}
|
||||
// InstanceParams 参数信息
|
||||
InstanceParams struct {
|
||||
ID uint64
|
||||
Name, Domain, Remark string
|
||||
Area config.Area
|
||||
Contact, ContactMobile string
|
||||
ID uint64
|
||||
Name, Domain, IP, Remark string
|
||||
Area config.Area
|
||||
Contact, ContactMobile string
|
||||
}
|
||||
)
|
||||
|
||||
@ -118,6 +118,9 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
|
||||
isExist := false
|
||||
|
||||
if !utils.ValidateIP(params.IP) {
|
||||
return errors.New("操作错误,IP地址异常")
|
||||
}
|
||||
if params.ID > 0 {
|
||||
mSysTenant.ID = params.ID
|
||||
|
||||
@ -143,6 +146,7 @@ func (c *Instance) Form(params *InstanceParams) error {
|
||||
Province: params.Area.Province,
|
||||
City: params.Area.City,
|
||||
}
|
||||
mSysTenant.IP = params.IP
|
||||
mSysTenant.Contact = params.Contact
|
||||
mSysTenant.ContactMobile = params.ContactMobile
|
||||
mSysTenant.Remark = params.Remark
|
||||
|
Reference in New Issue
Block a user