22
来源:互联网 发布:only的淘宝代购靠谱吗 编辑:程序博客网 时间:2024/06/08 04:13
//Javascript Code : User add/delete informationvar member = function(userId, name, sex, age, password, remark){this.userId = userId;this.name = name;this.sex = sex;this.age = age;this.password = password;this.remark = remark;};member.prototype = {addInfo:function(userId, infoBody, date){//addInfo(userId, infoBody, date);},deleteInfo:function(infoId){//deleteInfo(infoId);},addComment:function(userId, commentBody, date){//addComment(userId, commentBody, date);},deleteComment:function(commentId){//deleteComment(commentId)''},addLike:function(userId, infoId){//addLike(userId, infoId);},deleteLike:function(likeId){//deleteLike(likeId);}}function user(){member.call(this);this.isAdmin = false;}user.prototype = new member();function admin(name, sex, age, password, isAdmin, remark){member.call(this);this.isAdmin = true;}admin.prototype = new member();admin.prototype.addUser = function(userName, userPwd){//addUser(userName, userPwd);}admin.prototype.deleteUser = function(userId){//deleteUser(userId);}//create user & adminvar User = new user(1, 'user', 1, 22, '123456', 0, 'this is a normal user.');var Admin = new admin(2 , 'admin', 1, 22, '123456', 0, 'this is a super admin.');//addinfo//if success, console.log('this is a information by user at 2014-12-10');User.addInfo(1, 'this is a information', new Date('2014-12-10'));//addComment//if success, console.log('this is a comment by user at 2014-12-10');User.addComment(1, 'this is a comment', new Date('2014-12-10'));//deleteLike//if success, console.log('the likeId 2 has been delete.');User.deleteLike(2);//deleteUser//if success, console.log('the userId 1 has been deleted by admin.');admin.deleteUser(1);
0 0
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 22
- 复数的加减
- C# 串口操作系列(1) -- 入门篇,一个标准的,简陋的串口例子。 ——兔子党逍遥原创,转来分享学习
- Visual Studio 2013快捷键相关小结
- C++常量折叠
- HDU 4799 LIKE vs CANDLE 树形dp
- 22
- Sublime Text 2/3 [Decode error - output not utf-8]
- ECG数据在Matlab下的读取/显示方法
- CSPRO 有趣的数
- OC:代码块(blocks)
- 获取当前网络ip
- PHP文件注释标记及规范小结
- WIFI小车记录四:用Adobe Illustrator绘制应用磁贴
- 使用Serv-U搭建FTP服务器