📄 user.java
字号:
package com.gctech.sms.sp.dwzb;import java.util.*;import com.gctech.augury.bo.*;import com.gctech.augury.util.ProcessUtil;import com.gctech.augury.dao.*;import com.gctech.augury.util.*;/** * 用户 * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: gctech</p> * @author lijz@gctech.com.cn * @version 1.0 */public class User{ String phone; String userId="0001"; String password = ""; boolean isMan = true; Date bir = null; SYSProcessIF sys = null; TUserValueObject vo = null; TSubscribeValueObject subvo = null; private static final Integer BOY = new Integer(1); private static final Integer GIRL = new Integer(0); public User(String phone) { this.phone = phone; sys = ProcessUtil.getSYSProcessInstance(); try { vo = sys.getUserInfo(phone); subvo = sys.getSubribeInfo(phone); } catch(Exception ex) { ; } } /** * 首先调用 * <pre> * User user = new User("0102323233"); * if(!user.isSubscriber())throw new Exception(""); * else doSomething(); * </pre> * @return */ public boolean isSubscriber() { return subvo!=null&&subvo.getStatus().equals("1"); } public boolean isMan() { return true; } public String getUserId() { return phone; } /** * 取消订阅 * @return 0表示成功,1表示系统错误,2表示改用户已经取消订阅 */ public int unSub() { try { return sys.cancelSubscrib(phone)?0:1; } catch(Exception ex) { return 1; } } /** * 订阅 * return 0 成功 1 系统错误 */ public int sub(String bir,String sex) { try { vo = new TUserValueObject(); vo.setPassword(""+(int)(Math.random()*1000000)); vo.setSex(sex.equals("男")?BOY:GIRL); vo.setBirthday(DateFormatParser.parse(bir)); sys.userRegister(vo,phone); return 0; } catch(Exception ex) { return 1; } } /** * 用户计费类型 0,免费 2,便宜,3 贵 * @return */ public int feeType() { return 3; } public Date getBir() { return vo.getBirthday(); } public String getPassword() { return vo.getPassword(); } public static void main(String[] args) {// Users users1 = new Users(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -