public tbl_userConfig getUserConfig(string openId) { SqlSugarClient db = SqlSugarInstance.newInstance(); tbl_userConfig config = db.Queryable <tbl_userConfig>().Where(o => o.userId == openId).First(); return(config); }
public void updateUserConfig(string model) { ConfigModel user = JsonConvert.DeserializeObject <ConfigModel>(model); tbl_userConfig config = ConfigConverter.configModelToEntity(user); UserProvider provider = new UserProvider(); provider.updateUserConfig(config); }
public static tbl_userConfig configModelToEntity(ConfigModel ori) { tbl_userConfig des = new tbl_userConfig(); des.byTime = ori.byTime; des.byViewed = ori.byViewed; des.onlyLoved = ori.onlyLoved; des.userId = ori.userId; des.onlyVerify = ori.onlyVerify; des.videoMuted = ori.videoMuted; return(des); }
public static ConfigModel configEntityToModel(tbl_userConfig ori) { ConfigModel des = new ConfigModel(); des.byTime = ori.byTime; des.byViewed = ori.byViewed; des.onlyLoved = ori.onlyLoved; des.userId = ori.userId; des.onlyVerify = ori.onlyVerify; des.videoMuted = ori.videoMuted; return(des); }
public void updateUserConfig(tbl_userConfig config) { SqlSugarClient db = SqlSugarInstance.newInstance(); db.Updateable <tbl_userConfig>(config).WhereColumns(o => o.userId).ExecuteCommand(); }