コード例 #1
0
        [LoggingFilter("api/seat")] // <-- AOP(処理開始、終了時のロギング処理)
        public JsonResult <object> Post(JToken reqJson)
        {
            try
            {
                SeatRequest req = JsonUtil.Deserialize <SeatRequest>(reqJson.ToString()); // <-- JSONをモデルに変換

                //トークンを検証
                if (!Service.TokenHandling.InspectToken_direct(req.Token))
                {
                    return(Json((object)new SeatResponse()
                    {
                        ProcessStatus = STATUS.TOKEN_ER,
                        ResponseMessage = MESSAGE.MSG_TOKEN_ER
                    }));
                }

                SeatResponse res = presentationService.FetchSeatInfo(req);
                return(Json((object)res));
            }
            catch (Exception ex)
            {
                Logger.WriteException(MESSAGE.MSG_ER, ex);
                return(Json((object)new SeatResponse()
                {
                    ProcessStatus = STATUS.ER, ResponseMessage = MESSAGE.MSG_ER
                }));
            }
        }
コード例 #2
0
        /// <summary>
        /// 座席情報と登録済み社員情報を取得する
        /// </summary>
        /// <returns></returns>
        public SeatWithEmpResponse FetchSeatWithEmpInfo(SeatRequest req)
        {
            var returnModel = new SeatWithEmpResponse();

            //座席情報の取得
            returnModel.SeatWithEmpInfo = seat_Service.FetchSeatWithEmpInfo_Service(req.ClientAreaDv);

            //処理ステータスと取得結果を返す
            returnModel.ProcessStatus = returnModel.SeatWithEmpInfo.Count() != 0 ? STATUS.OK : STATUS.NG;
            //NGの場合はメッセージを設定
            if (returnModel.ProcessStatus == STATUS.NG)
            {
                returnModel.ResponseMessage = MESSAGE.MSG_FETCH_SEAT_NG;
            }
            return(returnModel);
        }