-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
完善json数据到php类文件生成工具的细节,主要是注解中对类型的判断方面
- Loading branch information
Showing
2 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,29 @@ | |
$jo = new JSONObject; | ||
|
||
$json_str = '{ | ||
"id": 2, | ||
"name": "钉钉事业部", | ||
"order" : 10, | ||
"parentid": 1, | ||
"createDeptGroup": true, | ||
"autoAddUser": true, | ||
"deptHiding" : true, | ||
"deptPerimits" : "3|4", | ||
"orgDeptOwner" : "manager1122", | ||
"deptManagerUseridList" : "manager1122|manager3211" | ||
"userid": "zhangsan", | ||
"name": "张三", | ||
"tel" : "010-123333", | ||
"workPlace" :"", | ||
"remark" : "", | ||
"mobile" : "13800000000", | ||
"email" : "[email protected]", | ||
"active" : true, | ||
"orderInDepts" : "{1:10, 2:20}", | ||
"isAdmin" : false, | ||
"isBoss" : false, | ||
"dingId" : "WsUDaq7DCVIHc6z1GAsYDSA", | ||
"isLeaderInDepts" : "{1:true, 2:false}", | ||
"isHide" : false, | ||
"department": [1, 2], | ||
"position": "工程师", | ||
"avatar": "dingtalk.com/abc.jpg", | ||
"jobnumber": "111111", | ||
"extattr": { | ||
"爱好":"旅游", | ||
"年龄":"24" | ||
} | ||
}'; | ||
|
||
|
||
echo $jo->toClass('Department', json_decode($json_str, true)); | ||
echo $jo->toClass('User', json_decode($json_str, true)); |