Пример #1
0
        public BaseGetResponse <List <DBPoint> > GetPointList(string session)
        {
            BaseGetResponse <List <DBPoint> > res = new BaseGetResponse <List <DBPoint> >()
            {
                Code = -1, Msg = "未知错误"
            };

            var user = UserRepository.FindUser(session);

            if (user != null)
            {
                if (!user.IsManager)
                {
                    res.Code = 2;
                    res.Msg  = "只有管理员才能发起支部活动";
                    return(res);
                }
            }
            else
            {
                res.Code = 1;
                res.Msg  = "用户登录超时";
                return(res);
            }

            res.Code = 0;
            res.Msg  = "获取打卡点成功";
            res.Data = PointRepository.GetPointList();
            return(res);
        }