public ApiResult GetMs(string mobile, string type) { if (string.IsNullOrEmpty(mobile) || string.IsNullOrEmpty(type)) { return(new ApiResult() { Msg = "mobile 或者 type 不能为空" }); } int itype = 0; try { itype = Convert.ToInt32(type); } catch { return(new ApiResult() { Msg = "type 类型错误" }); } var serviceMsgLog = new BLL.Sys.Implements.SysShortMessageService(); UserShortMessageLog msgModel = serviceMsgLog.GetLastSMSLog(mobile, itype); if (msgModel == null) { return(new ApiResult() { Msg = "没找到改手机号,type为" + itype + "的验证码" }); } return(new ApiResult() { Data = msgModel.MsgTitle }); }
public UsersController() { userService = new UserService(); serviceMsgLog = new BLL.Sys.Implements.SysShortMessageService(); }