Ejemplo n.º 1
0
 public static void Log(string message, LogTheme theme = LogTheme.all, LogMode mode = LogMode.message)
 {
     if (theAcceptedTheme != LogTheme.all && theAcceptedTheme != theme)
     {
         return;
     }
     Debug.Log(message);
 }
Ejemplo n.º 2
0
        public ActionResult AddTheme(Int64 chatId, int themeId)
        {
            try
            {
                Theme theme     = entities.Theme.Find(themeId);
                var   questions = theme.Question.OrderBy(o => o.Sort).ToList();

                if (!theme.LogTheme.Any(o => o.ChatId == chatId))
                {
                    LogTheme model = new LogTheme();
                    model.ChatId  = chatId;
                    model.ThemeId = themeId;
                    entities.LogTheme.Add(model);
                    entities.SaveChanges();
                }

                return(Json(new
                {
                    code = 200,
                    desc = "添加成功",
                    info = new
                    {
                        ChatId = chatId,
                        ThemeId = themeId,
                        theme.Id,
                        theme.Name,
                        theme.NameEn,
                        Questions = questions.Select(o => new { o.Id, o.Name })
                    }
                }));
            }
            catch (Exception ex)
            {
                return(Json(new { code = 201, desc = ex.Message }));
            }
        }
Ejemplo n.º 3
0
 private void Awake()
 {
     theAcceptedTheme = acceptedTheme;
 }