Sfoglia il codice sorgente

sys_user添加adress字段

huangyh 5 anni fa
parent
commit
0af589e5de

+ 16 - 2
controllers/partial/SystemController.go

@@ -373,7 +373,18 @@ func System_UpdateUser(c *entitys.CtrlContext) {
 	session.Begin()
 
 	//paramMap, _ := sysutils.BeanToMap(&postData)
-	paramMap := map[string]interface{}{"id": postData.Id, "temp_id": postData.TempId, "temp_value": postData.TempValue, "name": postData.Name, "email": postData.Email, "mobile": postData.Mobile, "org_id": postData.OrgId, "last_update_time": time.Now().UnixNano(), "last_update_by": user.UserId}
+	paramMap := map[string]interface{}{
+		"id":               postData.Id,
+		"temp_id":          postData.TempId,
+		"temp_value":       postData.TempValue,
+		"name":             postData.Name,
+		"email":            postData.Email,
+		"mobile":           postData.Mobile,
+		"org_id":           postData.OrgId,
+		"address":          postData.Address,
+		"last_update_time": time.Now().UnixNano(),
+		"last_update_by":   user.UserId,
+	}
 	_, err = session.SqlMapClient("update_user", &paramMap).Execute()
 	if err != nil {
 		session.Rollback()
@@ -893,7 +904,10 @@ func System_FindPermissions(c *entitys.CtrlContext) {
 // @Failure 403 :id is empty
 func System_AddMenu(c *entitys.CtrlContext) {
 	var paramObj0 models.SysMenu
-	c.Ctx.BindJSON(&paramObj0)
+	if err := c.Ctx.BindJSON(&paramObj0); err != nil {
+		c.Ctx.JSON(500, sysmodel.SysReturn{500, err.Error(), nil})
+		return
+	}
 
 	tk, _ := c.Ctx.Get("token")
 	user := tk.(*entitys.Token)

+ 1 - 0
light-apiengine.xml

@@ -1016,6 +1016,7 @@
             <column name="type" caption="用户类型" type="int32"/>
             <column name="status" caption="状态 0:禁用   1:正常" type="int32"/>
             <column isNull="false" name="avatar" caption="头像" type="string" size="255" dbtype="varchar(255)"/>
+            <column isNull="false" name="address" caption="地址" type="string" size="500" dbtype="varchar(500)"/>
             <column isNull="false" name="domain" caption="域" type="string" size="50" dbtype="varchar(50)"/>
             <column isNull="false" name="create_by" caption="创建人" type="string" size="36" dbtype="varchar(36)"/>
             <column isNull="false" name="create_time" caption="创建时间" type="local_time" />

+ 26 - 25
models/SysUser_gen.go

@@ -1,51 +1,52 @@
-
 package models
+
 import (
-	//__import_packages__
+//__import_packages__
 )
 
 type SysUser struct {
 	//主键
-	Id   string    `xorm:"'id' varchar(36) pk notnull "json:"id"`
+	Id string `xorm:"'id' varchar(36) pk   notnull "json:"id"`
 	//登录ID
-	LoginId   string    `xorm:"'login_id' varchar(36) notnull "json:"login_id"`
+	LoginId string `xorm:"'login_id' varchar(36)   notnull "json:"login_id"`
 	//密码
-	Password   string    `xorm:"'password' varchar(36) notnull "json:"password"`
+	Password string `xorm:"'password' varchar(36)   notnull "json:"password"`
 	//名字
-	Name   string    `xorm:"'name' varchar(36) notnull "json:"name"`
+	Name string `xorm:"'name' varchar(36)   notnull "json:"name"`
 	//全名
-	FullName   string    `xorm:"'full_name' varchar(36) notnull "json:"full_name"`
+	FullName string `xorm:"'full_name' varchar(36)   notnull "json:"full_name"`
 	//电话
-	Mobile   string    `xorm:"'mobile' varchar(50) notnull "json:"mobile"`
+	Mobile string `xorm:"'mobile' varchar(50)   notnull "json:"mobile"`
 	//邮箱
-	Email   string    `xorm:"'email' varchar(50) notnull "json:"email"`
+	Email string `xorm:"'email' varchar(50)   notnull "json:"email"`
 	//组织ID
-	OrgId   string    `xorm:"'org_id' varchar(36) notnull "json:"org_id"`
-	//性别 0:女    1:男 
-	Gender   int32    `xorm:"'gender' notnull "json:"gender"`
+	OrgId string `xorm:"'org_id' varchar(36)   notnull "json:"org_id"`
+	//性别 0:女    1:男
+	Gender int32 `xorm:"'gender'   notnull "json:"gender"`
 	//用户类型
-	Type   int32    `xorm:"'type' notnull "json:"type"`
+	Type int32 `xorm:"'type'   notnull "json:"type"`
 	//状态 0:禁用   1:正常
-	Status   int32    `xorm:"'status' notnull "json:"status"`
+	Status int32 `xorm:"'status'   notnull "json:"status"`
 	//头像
-	Avatar   string    `xorm:"'avatar' varchar(255) notnull "json:"avatar"`
+	Avatar string `xorm:"'avatar' varchar(255)   notnull "json:"avatar"`
+	//地址
+	Address string `xorm:"'address' varchar(500)   notnull "json:"address"`
 	//域
-	Domain   string    `xorm:"'domain' varchar(50) notnull "json:"domain"`
+	Domain string `xorm:"'domain' varchar(50)   notnull "json:"domain"`
 	//创建人
-	CreateBy   string    `xorm:"'create_by' varchar(36) notnull "json:"create_by"`
+	CreateBy string `xorm:"'create_by' varchar(36)   notnull "json:"create_by"`
 	//创建时间
-	CreateTime   LocalTime    `xorm:"'create_time' notnull "json:"create_time"`
+	CreateTime LocalTime `xorm:"'create_time'   notnull "json:"create_time"`
 	//最后更新人
-	LastUpdateBy   string    `xorm:"'last_update_by' varchar(36) notnull "json:"last_update_by"`
+	LastUpdateBy string `xorm:"'last_update_by' varchar(36)   notnull "json:"last_update_by"`
 	//最后更新时间
-	LastUpdateTime   int64    `xorm:"'last_update_time' notnull "json:"last_update_time"`
+	LastUpdateTime int64 `xorm:"'last_update_time'   notnull "json:"last_update_time"`
 	//是否删除 1:删除   0:正常
-	DelFlag   int32    `xorm:"'del_flag' notnull "json:"del_flag"`
+	DelFlag int32 `xorm:"'del_flag'   notnull "json:"del_flag"`
 	//模板id
-	TempId   string    `xorm:"'temp_id' varchar(36) notnull "json:"temp_id"`
+	TempId string `xorm:"'temp_id' varchar(36)   notnull "json:"temp_id"`
 	//模板值
-	TempValue   string    `xorm:"'temp_value' text notnull "json:"temp_value"`
-
+	TempValue string `xorm:"'temp_value' text   notnull "json:"temp_value"`
 }
 
 func (t *SysUser) TableName() string {
@@ -53,6 +54,6 @@ func (t *SysUser) TableName() string {
 }
 
 func init() {
-    AddTableName("sys_user")
+	AddTableName("sys_user")
 	RegisterModel(new(SysUser))
 }

+ 5 - 5
sqlconfig/light-apiengine/sys_user_gen.xml

@@ -2,13 +2,13 @@
 <sqlMap>
     <sql id="insert_sys_user">
         insert into sys_user
-		(`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`)
+		(`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`address`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`)
 		values
-		(?id,?login_id,?password,?name,?full_name,?mobile,?email,?org_id,?gender,?type,?status,?avatar,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag,?temp_id,?temp_value)
+		(?id,?login_id,?password,?name,?full_name,?mobile,?email,?org_id,?gender,?type,?status,?avatar,?address,?domain,?create_by,?create_time,?last_update_by,?last_update_time,?del_flag,?temp_id,?temp_value)
     </sql>
     <sql id="update_sys_user">
         update sys_user set
-		`login_id` = ?login_id,`password` = ?password,`name` = ?name,`full_name` = ?full_name,`mobile` = ?mobile,`email` = ?email,`org_id` = ?org_id,`gender` = ?gender,`type` = ?type,`status` = ?status,`avatar` = ?avatar,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag,`temp_id` = ?temp_id,`temp_value` = ?temp_value
+		`login_id` = ?login_id,`password` = ?password,`name` = ?name,`full_name` = ?full_name,`mobile` = ?mobile,`email` = ?email,`org_id` = ?org_id,`gender` = ?gender,`type` = ?type,`status` = ?status,`avatar` = ?avatar,`address` = ?address,`domain` = ?domain,`create_by` = ?create_by,`create_time` = ?create_time,`last_update_by` = ?last_update_by,`last_update_time` = ?last_update_time,`del_flag` = ?del_flag,`temp_id` = ?temp_id,`temp_value` = ?temp_value
 		where id = ?id
     </sql>
     <sql id="deleteone_sys_user">
@@ -17,13 +17,13 @@
     </sql>
     <sql id="selectone_sys_user">
         select 
-			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`
+			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`address`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`
         from sys_user
 		where id = ?id
     </sql>
     <sql id="selectall_sys_user">
         select 
-			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`
+			`id`,`login_id`,`password`,`name`,`full_name`,`mobile`,`email`,`org_id`,`gender`,`type`,`status`,`avatar`,`address`,`domain`,`create_by`,`create_time`,`last_update_by`,`last_update_time`,`del_flag`,`temp_id`,`temp_value`
         from sys_user
     </sql>
 </sqlMap>